Skip to content

Commit

Permalink
github.workflow: reconstruct current release URL from tag
Browse files Browse the repository at this point in the history
Instead of relying on the "latest" release, we use the actual release tag
to make sure to retrieve the right release.
That does not work better for pre-releases, though.
  • Loading branch information
Victor Paleologue committed Sep 13, 2021
1 parent 2d3cf56 commit f736b79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/make_feed.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
# Retrieves the latest release output to generate a QiToolchain XML feed.
set -e
echo "Getting packages from current release at ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/latest"
ASSETS_URL=$(curl --silent "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/latest" |
RELEASE_URL="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${CURRENT_RELEASE_TAG}"
echo "Getting packages from current release at $RELEASE_URL"
ASSETS_URL=$(curl --silent $RELEASE_URL |
jq -r '.assets_url')
PACKAGES_URLS=$(curl --silent ${ASSETS_URL} |
PACKAGES_URLS=$(curl --silent $ASSETS_URL |
jq '.[] | .browser_download_url' |
grep .zip | xargs -L 1 echo) # echo removes the extra quotes

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:

- name: Make Feed # Outputs feed.xml
run: .github/workflows/make_feed.sh
env:
CURRENT_RELEASE_TAG: ${{ steps.release.outputs.automatic_releases_tag }}

- name: Release Feed
uses: actions/upload-release-asset@v1
Expand Down

0 comments on commit f736b79

Please sign in to comment.