From 6e1f4fffccd4994f4ec6dcdb60ab0932e7d0e48a Mon Sep 17 00:00:00 2001 From: Martin Lange Date: Wed, 8 Oct 2025 21:52:00 +0200 Subject: [PATCH 1/3] Always build and archive artifacts --- .github/workflows/release.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b458d6..2c6cc36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,10 @@ name: Release on: release: - types: [ created ] + types: [created] + push: + branches: [master] + pull_request: env: CARGO_TERM_COLOR: always @@ -27,18 +30,34 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Get tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Get tag or commit + run: | + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + else + echo "RELEASE_VERSION=${GITHUB_SHA}" >> $GITHUB_ENV + fi shell: bash + - name: Build run: | cargo build --release + - name: Compress run: | cp -f target/release/$REPO${{ matrix.bin_extension }} . tar -czf release.tar.gz $REPO${{ matrix.bin_extension }} shell: bash + + - name: Archive build artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ env.REPO }}-${{ env.RELEASE_VERSION }}-${{ matrix.os_name }} + path: release.tar.gz + - name: Upload binaries to release + if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From cea642d3bf91ec312888e4536696b5f16bf1aaa9 Mon Sep 17 00:00:00 2001 From: Martin Lange Date: Wed, 8 Oct 2025 21:52:21 +0200 Subject: [PATCH 2/3] fix acton version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c6cc36..75c9aba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: shell: bash - name: Archive build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.REPO }}-${{ env.RELEASE_VERSION }}-${{ matrix.os_name }} path: release.tar.gz From 7041ed4ec72e20b85516eb2ba23a560d3c7720c9 Mon Sep 17 00:00:00 2001 From: Martin Lange Date: Wed, 8 Oct 2025 21:56:01 +0200 Subject: [PATCH 3/3] shorten hash --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75c9aba..13e02df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,8 @@ jobs: if [[ "${GITHUB_REF}" == refs/tags/* ]]; then echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV else - echo "RELEASE_VERSION=${GITHUB_SHA}" >> $GITHUB_ENV + SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) + echo "RELEASE_VERSION=${SHORT_SHA}" >> $GITHUB_ENV fi shell: bash