Skip to content

Commit

Permalink
Update actions used in CI workflow. (#647)
Browse files Browse the repository at this point in the history
* Update upload/download-artifact actions.

* Also update microsoft/setup-msbuild.
  • Loading branch information
Apprentice-Alchemist authored Jan 31, 2024
1 parent c25d8a7 commit a769c3a
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

- name: Add msbuild to PATH
if: matrix.build_system == 'vs2019'
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[16.0,17.0)'

Expand Down Expand Up @@ -287,8 +287,9 @@ jobs:
- name: "Share: build artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-${{ matrix.build_system }}-${{ matrix.architecture }}
path: ${{ env.HASHLINK_DISTRIBUTION }}


Expand All @@ -307,27 +308,14 @@ jobs:
uses: actions/checkout@v4

- name: "Get: all build artifacts"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: "Delete previous 'latest' release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
api_base_url="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
# delete 'latest' github release
release_id=$(curl -fsL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[] | select(.tag_name == "latest") | .id')
if [[ -n $release_id ]]; then
echo "Deleting release [$api_base_url/releases/$release_id]..."
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -fsSL -X DELETE "$api_base_url/releases/$release_id"
fi
# delete 'latest' git tag
tag_url="$api_base_url/git/refs/tags/latest"
if curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -fsLo /dev/null --head "$tag_url"; then
echo "Deleting tag [$tag_url]..."
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -fsSL -X DELETE "$tag_url"
fi
gh release delete latest --cleanup-tag --yes || true
- name: "Create 'latest' Release"
env:
Expand All @@ -342,7 +330,7 @@ jobs:
gh release create latest \
--prerelease \
--title "HashLink Nightly Build" \
"artifact/hashlink-${short_commit}-darwin.tar.gz#hashlink-latest-darwin.tar.gz" \
"artifact/hashlink-${short_commit}-linux-amd64.tar.gz#hashlink-latest-linux-amd64.tar.gz" \
"artifact/hashlink-${short_commit}-win32.zip#hashlink-latest-win32.zip" \
"artifact/hashlink-${short_commit}-win64.zip#hashlink-latest-win64.zip"
"darwin-make-64/hashlink-${short_commit}-darwin.tar.gz#hashlink-latest-darwin.tar.gz" \
"linux-make-64/hashlink-${short_commit}-linux-amd64.tar.gz#hashlink-latest-linux-amd64.tar.gz" \
"windows-vs2019-32/hashlink-${short_commit}-win32.zip#hashlink-latest-win32.zip" \
"windows-vs2019-64/hashlink-${short_commit}-win64.zip#hashlink-latest-win64.zip"

0 comments on commit a769c3a

Please sign in to comment.