-
Notifications
You must be signed in to change notification settings - Fork 2
280 lines (273 loc) · 7.99 KB
/
blank.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
name: Build binary artifacts
on:
push:
tags:
- weekly.**
- 0.**
jobs:
build-linux:
runs-on: ubuntu-20.04
env:
CC: gcc
ZIPNAME: vpaint_linux.zip
steps:
- name: Setup V
uses: vlang/setup-v@v1.4
with:
# Default: ${{ github.token }}
token: ${{ github.token }}
version: 'weekly.2024.37'
version-file: ''
check-latest: true
stable: false
architecture: ''
- uses: actions/checkout@v1
- name: Compile
run: |
sudo apt-get -qq update
sudo apt-get -qq install libgc-dev
sudo apt install build-essential
sudo apt-get --yes --force-yes install libxi-dev libxcursor-dev mesa-common-dev
sudo apt-get --yes --force-yes install libgl1-mesa-glx
v install https://github.com/pisaiah/ui
git clone https://github.com/pisaiah/ui iui
cd iui
git clone https://github.com/pisaiah/vpaint --depth 1
v -cc $CC -skip-unused -gc boehm vpaint
- name: Remove excluded
run: |
rm -rf .git
rm -rf docs
cd iui
cd vpaint
rm -rf docs
rm -rf *.v
cd ..
cd ..
- name: Create ZIP archive
run: |
cd iui
zip -r9 --symlinks $ZIPNAME vpaint/
mv $ZIPNAME ../
cd ..
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: linux
path: vpaint_linux.zip
build-macos:
runs-on: macos-latest
env:
CC: clang
ZIPNAME: vpaint_macos.zip
steps:
- name: Setup V
uses: vlang/setup-v@v1.4
with:
# Default: ${{ github.token }}
token: ${{ github.token }}
version: 'weekly.2024.37'
version-file: ''
check-latest: true
stable: false
architecture: ''
- uses: actions/checkout@v1
- name: Compile
run: |
v install https://github.com/pisaiah/ui
git clone https://github.com/pisaiah/ui iui
cd iui
git clone https://github.com/pisaiah/vpaint --depth 1
v -cc $CC -skip-unused -gc boehm vpaint
- name: Remove excluded
run: |
rm -rf .git
rm -rf docs
cd iui
cd vpaint
rm -rf docs
rm -rf *.v
cd ..
cd ..
- name: Create ZIP archive
run: |
cd iui
zip -r9 --symlinks $ZIPNAME vpaint/
mv $ZIPNAME ../
cd ..
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: macos
path: vpaint_macos.zip
build-windows:
runs-on: windows-latest
env:
CC: msvc
ZIPNAME: vpaint_windows.zip
steps:
- name: Setup V
uses: vlang/setup-v@v1.4
with:
# Default: ${{ github.token }}
token: ${{ github.token }}
version: 'weekly.2024.37'
version-file: ''
check-latest: true
stable: false
architecture: ''
- uses: actions/checkout@v1
- uses: msys2/setup-msys2@v2
- name: Compile
run: |
where v
v install https://github.com/pisaiah/ui
git clone https://github.com/pisaiah/vpaint --depth 1
v -cc gcc -skip-unused -gc boehm -cflags -static -cflags -mwindows vpaint
- name: Remove excluded
shell: msys2 {0}
run: |
rm -rf .git
rm -rf docs
cd vpaint
rm -rf docs
rm -rf *.v
cd ..
- name: Create archive
shell: msys2 {0}
run: |
cd vpaint
cd ..
powershell Compress-Archive vpaint $ZIPNAME
# NB: the powershell Compress-Archive line is from:
# https://superuser.com/a/1336434/194881
# It is needed, because `zip` is not installed by default :-|
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: windows
path: vpaint_windows.zip
build-emscripten:
env:
EM_VERSION: 1.39.18
EM_CACHE_FOLDER: 'emsdk-cache'
CC: gcc
ZIPNAME: vpaint_emscripten.zip
runs-on: ubuntu-latest
steps:
- uses: mymindstorm/setup-emsdk@v14
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
# Make sure to set a version number!
version: 3.1.67
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: 'emsdk-cache'
- name: Verify
run: emcc -v
- name: Setup V
uses: vlang/setup-v@v1.4
with:
# Default: ${{ github.token }}
token: ${{ github.token }}
version: 'weekly.2024.37'
version-file: ''
check-latest: true
stable: false
architecture: ''
- uses: actions/checkout@v1
- name: Compile
run: |
sudo apt-get -qq update
sudo apt-get -qq install libgc-dev
sudo apt install build-essential
sudo apt-get --yes --force-yes install libxi-dev libxcursor-dev mesa-common-dev
sudo apt-get --yes --force-yes install libgl1-mesa-glx
v install https://github.com/pisaiah/ui
git clone https://github.com/pisaiah/ui iui
cd iui
git clone https://github.com/vlang/v --depth 1
cd v
make
mv v v.exe
git clone https://github.com/pisaiah/v-emscripten-script
cd v-emscripten-script
../v.exe . -o v2w.exe
git clone https://github.com/pisaiah/vpaint --depth 1
dir
./v2w.exe ../ vpaint -Os
- name: Remove excluded
run: |
rm -rf .git
- name: Create ZIP archive
run: |
cd iui
cd v
zip -r9 --symlinks $ZIPNAME v-emscripten-script/output/
mv $ZIPNAME ../../
cd ..
cd ..
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: emscripten
path: vpaint_emscripten.zip
release:
name: Create Github Release
needs: [build-linux, build-windows, build-macos, build-emscripten]
runs-on: ubuntu-20.04
steps:
- name: Get short tag name
uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref }}
separator: /
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.split.outputs._2 }}
name: ${{ steps.split.outputs._2 }}
commit: ${{ github.sha }}
draft: false
prerelease: false
publish:
needs: [release]
runs-on: ubuntu-20.04
strategy:
matrix:
version: [linux, macos, windows, emscripten]
steps:
- uses: actions/checkout@v1
- name: Fetch artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.version }}
path: ./${{ matrix.version }}
- name: Get short tag name
uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref }}
separator: /
- name: Get release
id: get_release_info
uses: leahlundqvist/get-release@v1.3.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.split.outputs._2 }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ matrix.version }}/vpaint_${{ matrix.version }}.zip
asset_name: vpaint_${{ matrix.version }}.zip
asset_content_type: application/zip