From d04a156df9d87c493cb3360e7a569a4f6614ef35 Mon Sep 17 00:00:00 2001 From: Codel1417 <13484789+Codel1417@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:45:02 -0400 Subject: [PATCH] Set release version to tag --- .github/workflows/build_apk.yml | 7 ++++--- Scripts/build.sh | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_apk.yml b/.github/workflows/build_apk.yml index 39d2b549..3783d467 100644 --- a/.github/workflows/build_apk.yml +++ b/.github/workflows/build_apk.yml @@ -10,7 +10,6 @@ jobs: outputs: SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }} SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }} - steps: - uses: actions/checkout@v4 with: @@ -27,6 +26,8 @@ jobs: id: build run: bash ${GITHUB_WORKSPACE}/Scripts/build.sh working-directory: Scripts + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} - uses: actions/upload-artifact@v4 with: path: | @@ -39,8 +40,8 @@ jobs: SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} SENTRY_URL: ${{ secrets.SENTRY_URL }} - SENTRY_DIST: ${{ needs.build_android.outputs.SENTRY_DIST }} - SENTRY_RELEASE: ${{ needs.build_android.outputs.SENTRY_RELEASE }} + SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }} + SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }} release-job: name: Releasing needs: build_android diff --git a/Scripts/build.sh b/Scripts/build.sh index f2632874..da4eb76a 100644 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -6,6 +6,11 @@ if [[ "$(pwd)" == *"/Scripts" ]]; then fi VERSION="$(cat VERSION)" BUILD_NUMBER="$(git rev-list HEAD --count)" +# Assumes tags start with V +if [[ -v RELEASE_TAG ]] && [[ -n $RELEASE_TAG ]]; then + TAG="${RELEASE_TAG,,}" + VERSION="${TAG//"v"}" +fi flutter config --no-cli-animations flutter pub get flutter gen-l10n