From 45af518733257959c59c6d6fc202a4fd265ead3a Mon Sep 17 00:00:00 2001 From: Mikkel Kjeldsen Date: Tue, 19 Sep 2023 21:28:20 +0200 Subject: [PATCH 1/3] ci: fix gh/checkout action deprecation warnings --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35d20d3..97ab612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: RUST_BACKTRACE: 1 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb9044c..504bedf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: TARGET_DIR: ./target steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare environment shell: bash From be34c3dcba0ee8d6ceb8b9942847a94e6b1123ac Mon Sep 17 00:00:00 2001 From: Mikkel Kjeldsen Date: Tue, 19 Sep 2023 22:07:06 +0200 Subject: [PATCH 2/3] ci: replace deprecated gh/actions-rs builder --- .github/workflows/ci.yml | 4 +--- .github/workflows/release.yml | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97ab612..0c947d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,11 +47,9 @@ jobs: uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true - name: Build run: cargo build --verbose diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 504bedf..94a6d71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,13 +95,11 @@ jobs: run: brew install asciidoctor - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: # Build all releases on nightly for latest optimizations. toolchain: nightly - profile: minimal - override: true - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - name: Install Cross run: cargo install cross From e28e39c24fe0d597fc03b9591b8b67e594cd757d Mon Sep 17 00:00:00 2001 From: Mikkel Kjeldsen Date: Wed, 20 Sep 2023 21:58:35 +0200 Subject: [PATCH 3/3] ci: replace deprecated gh/{create,upload}-release* actions Note that the substitute action reports the new release as a bogus tag .../releases/tag/untagged-*, including asset download URLs. This may or may not be a draft artifact. In any case, when the draft is published the URLs correct to the specified tag and all remain operational. --- .github/workflows/release.yml | 40 +++++------------------------------ 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94a6d71..118503d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,34 +7,8 @@ on: jobs: - # First register a new release we can attach files to. - create-release: - name: create-release - runs-on: ubuntu-latest - outputs: - version: ${{ steps.release_version.outputs.version }} - upload_url: ${{ steps.release.outputs.upload_url }} - steps: - # Yes, we really need to get the plain tag name like this. There are even - # dedicated actions for it. - # https://stackoverflow.com/a/58178121/482758 - - name: Share release version - id: release_version - run: printf '::set-output name=version::%s\n' "${GITHUB_REF#refs/tags/}" - - - name: Publish new release - id: release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.release_version.outputs.version }} - release_name: ${{ steps.release_version.outputs.version }} - build-package: name: build-package - needs: - - create-release runs-on: ${{ matrix.os }} strategy: matrix: @@ -71,8 +45,7 @@ jobs: run: | printf 'TARGET_FLAGS=--target %s\n' "${{ matrix.target }}" >> $GITHUB_ENV printf 'TARGET_DIR=./target/${{ matrix.target }}\n' >> $GITHUB_ENV - printf 'RELEASE_URL=%s\n' "${{ needs.create-release.outputs.upload_url }}" >> $GITHUB_ENV - printf 'RELEASE_VERSION=%s\n' "${{ needs.create-release.outputs.version }}" >> $GITHUB_ENV + printf 'RELEASE_VERSION=%s\n' "${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV printf 'RELEASE_BINARY=%s\n' "target/${{ matrix.target }}/release/commitmsgfmt${{ matrix.binary_ext }}" >> $GITHUB_ENV # So much cruft just to install Asciidoctor. @@ -135,11 +108,8 @@ jobs: fi - name: Upload package - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ env.RELEASE_URL }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ env.ASSET }} - asset_content_type: application/octet-stream + draft: true + tag_name: ${{ env.RELEASE_VERSION }} + files: ${{ env.ASSET }}