@@ -17,16 +17,18 @@ jobs:
1717 with :
1818 fetch-depth : 0 # ensures a reachable tag
1919
20+ - name : Determine distname
21+ run : |
22+ echo "distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')" >> $GITHUB_ENV
23+
2024 - name : Build tarball distribution
2125 run : |
22- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
2326 autoreconf -i
2427 ./configure --disable-dependency-tracking --disable-scalar --disable-threaded --disable-native --without-gmp --without-zlib
2528 make distdir=$distname dist-gzip
2629
2730 - name : Print tarball information
2831 run : |
29- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
3032 ls -l $distname.tar.gz
3133 file $distname.tar.gz
3234 tar -tf $distname.tar.gz
4345 # statically linked in such a way that they are suitable for binary distributions.
4446 build-bin :
4547 name : Build ${{ matrix.bin }} on ${{ matrix.os }}
46- needs : [ build-src]
48+ needs : build-src
4749 runs-on : ${{ matrix.os }}
4850 defaults :
4951 run :
@@ -63,15 +65,14 @@ jobs:
6365 - {os: ubuntu-18.04, shell: bash, bin: tform}
6466 - {os: macos-10.15, shell: bash, bin: form}
6567 - {os: macos-10.15, shell: bash, bin: tform}
66- # Disable Windows native executables that have too many problems, for now.
67- # - {os: windows-2019, shell: msys2, bin: form}
68- # - {os: windows-2019, shell: msys2, bin: tform}
68+ # NOTE: Windows native executables have too many problems.
69+ # We include them in artifacts but not in releases.
70+ # Unfortunately, "allow-failure" is not available on GitHub Actions
71+ # (https://github.com/actions/toolkit/issues/399).
72+ # We have to use "continue-on-error", instead.
73+ - {os: windows-2019, shell: msys2, bin: form}
74+ - {os: windows-2019, shell: msys2, bin: tform}
6975 steps :
70- - name : Download tarball
71- uses : actions/download-artifact@v3
72- with :
73- name : src
74-
7576 - name : Install dependencies (Windows)
7677 if : runner.os == 'Windows'
7778 uses : msys2/setup-msys2@v2
8485 mingw-w64-x86_64-zlib
8586 ruby
8687
87- - name : Configure
88+ - name : Download tarball
89+ uses : actions/download-artifact@v3
90+ with :
91+ name : src
92+
93+ - name : Uncompress tarball
8894 run : |
8995 tar -xf *.tar.gz --strip-components 1
96+ rm *.tar.gz
97+
98+ - name : Configure
99+ run : |
90100 opts='--disable-dependency-tracking --disable-scalar --disable-threaded --disable-native --enable-static-link --with-gmp --with-zlib'
91101 case ${{ matrix.bin }} in
92102 form) opts="$opts --enable-scalar";;
@@ -109,16 +119,24 @@ jobs:
109119 ./configure $opts
110120
111121 - name : Build
122+ id : build
123+ continue-on-error : ${{ runner.os == 'Windows' }}
112124 run : |
113125 if [ "$RUNNER_OS" == "macOS" ]; then
114126 export LIBRARY_PATH="$(pwd)/static-lib:${LIBRARY_PATH:-}"
115127 fi
116128 make -j 4
117129
130+ # NOTE: Currently, many tests on Windows miserably fail.
118131 - name : Test
132+ if : steps.build.outcome == 'success' && steps.build.conclusion == 'success'
133+ continue-on-error : ${{ runner.os == 'Windows' }}
119134 run : make check
120135
121136 - name : Print executable information
137+ id : check-portability
138+ if : steps.build.outcome == 'success' && steps.build.conclusion == 'success'
139+ continue-on-error : ${{ runner.os == 'Windows' }}
122140 run : |
123141 binname=${{ matrix.bin }}
124142 if [ "$RUNNER_OS" == "Windows" ]; then
@@ -144,6 +162,7 @@ jobs:
144162 fi
145163
146164 - name : Upload binary as artifact
165+ if : steps.check-portability.outcome == 'success' && steps.check-portability.conclusion == 'success'
147166 uses : actions/upload-artifact@v3
148167 with :
149168 name : ${{ matrix.bin }}-${{ matrix.os }}
@@ -155,12 +174,22 @@ jobs:
155174 # Generate the PDF reference manual, e.g., "form-4.2.1-manual.pdf" for v4.2.1.
156175 build-doc-pdf :
157176 name : Build PDF document
177+ needs : build-src
158178 runs-on : ubuntu-latest
159179 steps :
160- - name : Checkout repository
161- uses : actions/checkout @v3
180+ - name : Download tarball
181+ uses : actions/download-artifact @v3
162182 with :
163- fetch-depth : 0 # ensures a reachable tag
183+ name : src
184+
185+ - name : Determine distname
186+ run : |
187+ echo "distname=$(basename *.tar.gz .tar.gz)-manual" >> $GITHUB_ENV
188+
189+ - name : Uncompress tarball
190+ run : |
191+ tar -xf *.tar.gz --strip-components 1
192+ rm *.tar.gz
164193
165194 # Currently, cache-apt-pkgs-action doesn't work for LaTeX.
166195 # https://github.com/awalsh128/cache-apt-pkgs-action/issues/57
@@ -177,17 +206,13 @@ jobs:
177206
178207 - name : Build PDF file
179208 run : |
180- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
181- distname=$distname-manual
182209 autoreconf -i
183210 ./configure --disable-dependency-tracking --disable-scalar --disable-threaded --disable-native --without-gmp --without-zlib
184211 make pdf
185212 cp doc/manual/manual.pdf $distname.pdf
186213
187214 - name : Print document information
188215 run : |
189- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
190- distname=$distname-manual
191216 ls -l $distname.pdf
192217 file $distname.pdf
193218
@@ -202,12 +227,22 @@ jobs:
202227 # "form-4.2.1-manual-html.tar.gz" for v4.2.1.
203228 build-doc-html :
204229 name : Build HTML document
230+ needs : build-src
205231 runs-on : ubuntu-latest
206232 steps :
207- - name : Checkout repository
208- uses : actions/checkout @v3
233+ - name : Download tarball
234+ uses : actions/download-artifact @v3
209235 with :
210- fetch-depth : 0 # ensures a reachable tag
236+ name : src
237+
238+ - name : Determine distname
239+ run : |
240+ echo "distname=$(basename *.tar.gz .tar.gz)-manual-html" >> $GITHUB_ENV
241+
242+ - name : Uncompress tarball
243+ run : |
244+ tar -xf *.tar.gz --strip-components 1
245+ rm *.tar.gz
211246
212247 # Currently, cache-apt-pkgs-action doesn't work for LaTeX.
213248 # https://github.com/awalsh128/cache-apt-pkgs-action/issues/57
@@ -224,8 +259,6 @@ jobs:
224259
225260 - name : Build HTML files
226261 run : |
227- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
228- distname=$distname-manual-html
229262 autoreconf -i
230263 ./configure --disable-dependency-tracking --disable-scalar --disable-threaded --disable-native --without-gmp --without-zlib
231264 make -C doc/manual latex2html
@@ -238,8 +271,6 @@ jobs:
238271
239272 - name : Print file information
240273 run : |
241- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
242- distname=$distname-manual-html
243274 ls -l $distname.tar.gz
244275 file $distname.tar.gz
245276 tar -tf $distname.tar.gz
@@ -263,22 +294,20 @@ jobs:
263294 - build-doc-html
264295 runs-on : ubuntu-latest
265296 steps :
266- - name : Checkout repository
267- uses : actions/checkout@v3
268- with :
269- fetch-depth : 0 # ensures a reachable tag
270-
271297 - name : Download all artifacts
272298 uses : actions/download-artifact@v3
273299 with :
274300 path : artifacts
275301
302+ - name : Determine distname
303+ run : |
304+ echo "distname=$(basename artifacts/src/*.tar.gz .tar.gz)" >> $GITHUB_ENV
305+
276306 - name : Print all artifacts
277307 run : ls -l -R artifacts
278308
279309 - name : Prepare distributions
280310 run : |
281- distname=form-$(./scripts/git-version-gen.sh -r | sed '2q;d' | sed 's/^v//')
282311 mkdir dist
283312 mv artifacts/src/*.tar.gz dist
284313 mv artifacts/doc-html/*.tar.gz dist
@@ -299,26 +328,31 @@ jobs:
299328 tar -c $pkgname/* | gzip -c -9 >dist/$pkgname.tar.gz
300329 rm -rf $pkgname
301330 fi
302- if ls artifacts/*-windows-*/*form.exe >/dev/null 2>&1; then
303- pkgname=$distname-x86_64-windows
304- mkdir $pkgname
305- mv artifacts/*-windows-*/*form.exe $pkgname
306- chmod +x $pkgname/*form.exe
307- tar -c $pkgname/* | gzip -c -9 >dist/$pkgname.tar.gz
308- rm -rf $pkgname
309- fi
331+ # Do not include Windows binaries into the distribution, for now.
332+ #
333+ # if ls artifacts/*-windows-*/*form.exe >/dev/null 2>&1; then
334+ # pkgname=$distname-x86_64-windows
335+ # mkdir $pkgname
336+ # mv artifacts/*-windows-*/*form.exe $pkgname
337+ # chmod +x $pkgname/*form.exe
338+ # # Zip may be more popular than tar.gz for Windows(?)
339+ # # tar -c $pkgname/* | gzip -c -9 >dist/$pkgname.tar.gz
340+ # zip -9 dist/$pkgname.zip $pkgname/*
341+ # rm -rf $pkgname
342+ # fi
310343
311344 - name : Print distributions
312345 run : ls -l dist
313346
314347 # Publish the distributions to GitHub Releases, only if the commit has
315348 # a versioning tag.
316349 - name : Publish distributions
317- uses : softprops/action-gh-release@v1
318350 if : startsWith(github.ref, 'refs/tags/v')
351+ uses : softprops/action-gh-release@v1
319352 with :
320353 files : |
321354 dist/*.tar.gz
355+ dist/*.zip
322356 dist/*.pdf
323357
324358 # Upload the distributions as an artifact, regardless of whether
@@ -329,5 +363,6 @@ jobs:
329363 name : dist
330364 path : |
331365 dist/*.tar.gz
366+ dist/*.zip
332367 dist/*.pdf
333368 if-no-files-found : error
0 commit comments