From 8481ba9bc4687c9acc22ec6de6668723d8dab361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9cate=20Moonlight?= Date: Mon, 16 Sep 2024 10:01:37 +0200 Subject: [PATCH] Refine the CI a bit more --- .github/workflows/ci.yml | 3 +-- .github/workflows/release.yml | 19 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86e0e5f..fd7b20c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,9 +161,8 @@ jobs: strip distribution/get-tested upx -9 distribution/get-tested - - name: Tar get-tested executable + - name: Create artifact name run: | - GETTESTED_EXEC=distribution/get-tested ARTIFACT_NAME="get-tested-head-${{ runner.os }}-static-${{ env.ARCH }}" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fd4408..87aabd5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,7 @@ on: jobs: generate-matrix: + if: startsWith(github.ref, 'refs/tags/v') name: 'Generate matrix from cabal' outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -80,20 +81,19 @@ jobs: mkdir distribution cp ${bin} distribution/get-tested - - id: version - run: | - version=$(./distribution/get-tested --version) - echo "VERSION=${version}" >> "$GITHUB_ENV" - - name: Post-process executables if: ${{ matrix.os == 'ubuntu-latest' }} run: | strip distribution/get-tested upx -9 distribution/get-tested - - name: Package the get-tested executable + - id: version + run: | + version=$(./distribution/get-tested --version) + echo "VERSION=${version}" >> "$GITHUB_ENV" + + - name: Create artifact name run: | - executable=distribution/get-tested ARTIFACT_NAME="get-tested-${{ env.VERSION }}-${{ runner.os }}-${{ env.ARCH }}" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV @@ -101,7 +101,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} - path: ${{ env.ARTIFACT_NAME }}.tar.gz + path: distribution/get-tested build-alpine: env: @@ -181,9 +181,8 @@ jobs: strip distribution/get-tested upx -9 distribution/get-tested - - name: Package the get-tested executable + - name: get-tested executable run: | - GETTESTED_EXEC=distribution/get-tested ARTIFACT_NAME="get-tested-${{ env.VERSION }}-${{ runner.os }}-static-${{ env.ARCH }}" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV