Skip to content

Commit f02c1d8

Browse files
committed
Tidy up
1 parent 356aa45 commit f02c1d8

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.github/workflows/build_libzim_wasm.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
push:
99
branches: [ master ]
1010
tags:
11-
- 'v*' # Push events matching v*, i.e. v1.0, v20.15.10
11+
- 'v*' # Tag push events matching v*, i.e. v1.0, v20.15.10
1212
# pull_request:
1313
# branches: [ master ]
1414
workflow_dispatch:
@@ -29,6 +29,7 @@ env:
2929
jobs:
3030
build:
3131
name: Build and publish W/ASM artefacts
32+
if: github.even_name != 'release'
3233
runs-on: ubuntu-latest
3334
steps:
3435
- uses: actions/checkout@v3
@@ -42,7 +43,9 @@ jobs:
4243
run: ls -l
4344
# If we are not creating a release, archive the artefacts under this Action run
4445
- name: Archive build artefacts
45-
if: github.event_name == 'pull_request' || github.event_name == 'push' && ! startsWith(github.ref_name, 'v') || ! startsWith(github.event.inputs.version, 'v')
46+
if: |
47+
github.event_name == 'pull_request' || github.event_name == 'push' && ! startsWith(github.ref_name, 'v')
48+
|| ! startsWith(github.event.inputs.version, 'v')
4649
uses: actions/upload-artifact@v3
4750
with:
4851
name: libzim-wasm-artefacts
@@ -54,7 +57,9 @@ jobs:
5457
id: zip-release
5558
if: github.event_name == 'push' && startsWith(github.ref_name, 'v') || startsWith(github.event.inputs.version, 'v')
5659
run: |
60+
if [[ ! $VERSION =~ ^v?[0-9.]+ ]]; then
61+
VERSION=$DISPATCH_VERSION
62+
fi
5763
# Create a draft release and upload zipped artefacts as release assets
5864
chmod +x ./scripts/create_draft_release.sh
5965
./scripts/create_draft_release.sh
60-
# TODO: Publish artefacts to master.download.kiwix.org/release

scripts/create_draft_release.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
# This script packages the ASM and WASM artefacts, and creates a draft release
44
# It is designed to be run by a GitHub action. To test, from the commandline, supply $VERSION and $GITHUB_TOKEN.
55

6-
if [[ ! $VERSION =~ ^v?[0-9.]+ ]]; then
7-
VERSION=$DISPATCH_VERSION
8-
fi
96
echo "Zipping the release archives..."
10-
zip libzim-wasm_$VERSION.zip libzim-wasm.*
11-
zip libzim-asm_$VERSION.zip libzim-asm.*
7+
zip libzim_wasm_$VERSION.zip libzim-wasm.*
8+
zip libzim_asm_$VERSION.zip libzim-asm.*
129
echo "Creating the draft release..."
1310
REST_RESPONSE=$(
1411
curl \
@@ -29,7 +26,7 @@ else
2926
fi
3027
# echo "UPLOAD_URL=$REST_RESPONSE" >> $GITHUB_OUTPUT # Use this if you need to access the URL in a later step with steps.zip-release.outputs.UPLOAD_URL
3128
# Upload archives to the draft release
32-
for FILE in "libzim-wasm_$VERSION.zip" "libzim-asm_$VERSION.zip"
29+
for FILE in "libzim_wasm_$VERSION.zip" "libzim_asm_$VERSION.zip"
3330
do
3431
echo -e "\nUploading $FILE to $UPLOAD_URL?name=$FILE..."
3532
curl \

0 commit comments

Comments
 (0)