From d3fd4ed69f5b54feada0c2b69ea87d607d861d86 Mon Sep 17 00:00:00 2001 From: Josh Junon Date: Tue, 9 Apr 2024 23:40:49 +0200 Subject: [PATCH] use artifacts to transfer version number --- .github/workflows/publish.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index efbbea78e..9c0f5d18c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -98,7 +98,7 @@ jobs: CURRENT_VERSION="$(curl --silent "https://app.gitbutler.com/releases/${{ env.channel }}" | jq -r '.version')" NEXT_VERSION=$(./scripts/next.sh "${CURRENT_VERSION}" "${{ env.bump }}") echo "version=$NEXT_VERSION" >> $GITHUB_ENV - echo "::set-output name=version::$NEXT_VERSION" + mkdir -p release && echo "$NEXT_VERSION" > release/version - name: import gpg key if: runner.os == 'Linux' @@ -186,6 +186,11 @@ jobs: with: name: "${{ needs.build-tauri.outputs.channel }}-${{ matrix.platform }}" path: release + - name: Extract version + shell: bash + run: | + VERSION="$(cat release/version)" + echo "version=$VERSION" >> $GITHUB_ENV - uses: shallwefootball/s3-upload-action@master name: Upload To S3 id: S3 @@ -194,7 +199,7 @@ jobs: aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws_bucket: "releases.gitbutler.com" source_dir: "release/" - destination_dir: "releases/${{ needs.build-tauri.outputs.channel }}/${{ needs.build-tauri.outputs.version }}-${{ github.run_number }}" + destination_dir: "releases/${{ needs.build-tauri.outputs.channel }}/${{ env.version }}-${{ github.run_number }}" # tell our server to update with the version number - name: Tell our server to update @@ -205,12 +210,12 @@ jobs: --request POST \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: ${{ secrets.BOT_AUTH_TOKEN }}' \ - --data '{"channel":"${{ needs.build-tauri.outputs.channel }}","version":"${{ needs.build-tauri.outputs.version }}-${{ github.run_number }}","sha":"${{ github.sha }}"}' + --data '{"channel":"${{ needs.build-tauri.outputs.channel }}","version":"${{ env.version }}-${{ github.run_number }}","sha":"${{ github.sha }}"}' - name: Tag release shell: bash env: - TAG_NAME: "${{ needs.build-tauri.outputs.channel }}/${{ needs.build-tauri.outputs.version }}" + TAG_NAME: "${{ needs.build-tauri.outputs.channel }}/${{ env.version }}" run: | function tag_exists() { git tag --list | grep -q "^$1$"