GitHub CI: create continuous release if needed

For Linux AppImages in release channel, zsync files are stored as an
artefact in continuous release assets so ensure that it is present.
This commit is contained in:
Martin Pulec
2021-11-02 15:51:23 +01:00
parent 61e2bb8adf
commit ddee6968c8
2 changed files with 20 additions and 0 deletions

17
.github/scripts/create_continuous_release.sh vendored Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh -eu
#
# Ensures that tag "continuous" is present is released on GH. This is required for
# zsync AppImage release asset.
#
sudo apt install jq
URL=$(curl -S -H "Authorization: token $GITHUB_TOKEN" -X GET https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$TAG | jq -r '.url')
if [ $URL != null ]; then # release exists
exit 0
fi
git fetch --prune --unshallow --tags
git tag continuous && git push origin refs/tags/continuous
curl -S -H "Authorization: token $GITHUB_TOKEN" -X POST $URL -T - <<EOF
{
"tag_name": "continuous"}
}

View File

@@ -49,6 +49,9 @@ jobs:
- name: Update Release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: .github/scripts/create_release.sh
- name: Create continuous release # ensure continuous release is present for AppImage zsync
if: startsWith(github.ref, 'refs/tags/')
run: .github/scripts/create_continuous_release.sh
Ubuntu:
name: run Ubuntu