From a769c3a6770dd6e1f6f11183de34ad3db8805670 Mon Sep 17 00:00:00 2001 From: Zeta <53486764+Apprentice-Alchemist@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:57:42 +0100 Subject: [PATCH] Update actions used in CI workflow. (#647) * Update upload/download-artifact actions. * Also update microsoft/setup-msbuild. --- .github/workflows/build.yml | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc3f00f95..634a78bc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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)' @@ -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 }} @@ -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: @@ -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"