From 3adbc769027451dc7dae678ab44b0819476669ea Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Thu, 23 Nov 2023 02:43:48 +0100 Subject: [PATCH] Updated workflows --- .github/workflows/release-beta.yaml | 14 ++++++---- .github/workflows/release-stable.yaml | 38 +++++++++++++++++++-------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-beta.yaml b/.github/workflows/release-beta.yaml index 93b09b1..792353e 100644 --- a/.github/workflows/release-beta.yaml +++ b/.github/workflows/release-beta.yaml @@ -12,6 +12,9 @@ jobs: env: ANDROID_AAB_RELEASE_PATH: build/app/outputs/bundle/release ANDROID_APK_RELEASE_PATH: build/app/outputs/apk/release + outputs: + VERSION_NAME: ${{ steps.save_version.outputs.version_name }} + VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }} steps: - uses: actions/checkout@v3 with: @@ -29,13 +32,14 @@ jobs: file: './pubspec.yaml' key-path: '["version"]' - name: Save version on env variable + id: save_version run: | version=${{ steps.read_pubspec.outputs.data }} IFS='+' read -r -a split <<< "$version" echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV - echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_OUTPUT - echo "VERSION_NUMBER=$(echo ${split[1]})" >> $GITHUB_OUTPUT + echo "version_name=${split[0]}" >> $GITHUB_OUTPUT + echo "version_number=${split[1]}" >> $GITHUB_OUTPUT - name: Update KeyStore password in gradle properties run: sed -i 's/#{KEYSTORE_PASS}#/${{ secrets.KEYSTORE_PASS }}/g' android/key.properties - name: Update KeyStore key password in gradle properties @@ -71,8 +75,8 @@ jobs: runs-on: ubuntu-latest needs: [build-android] env: - VERSION_NAME: ${{ needs.build-android.outputs.version_name }} - VERSION_NUMBER: ${{ needs.build-android.outputs.version_number }} + VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }} + VERSION_NUMBER: ${{ needs.build-android.outputs.VERSION_NUMBER }} steps: - uses: actions/checkout@v3 with: @@ -99,7 +103,7 @@ jobs: runs-on: ubuntu-latest needs: [build-android] env: - VERSION_NAME: ${{ needs.build-android.outputs.version_name }} + VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }} steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/release-stable.yaml b/.github/workflows/release-stable.yaml index 6611233..f5a4ee6 100644 --- a/.github/workflows/release-stable.yaml +++ b/.github/workflows/release-stable.yaml @@ -11,6 +11,9 @@ jobs: env: ANDROID_AAB_RELEASE_PATH: build/app/outputs/bundle/release ANDROID_APK_RELEASE_PATH: build/app/outputs/apk/release + outputs: + VERSION_NAME: ${{ steps.save_version.outputs.version_name }} + VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }} steps: - uses: actions/checkout@v3 - name: Decode android/app/keystore.jks @@ -26,13 +29,14 @@ jobs: file: './pubspec.yaml' key-path: '["version"]' - name: Save version on env variable + id: save_version run: | version=${{ steps.read_pubspec.outputs.data }} IFS='+' read -r -a split <<< "$version" echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV - echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_OUTPUT - echo "VERSION_NUMBER=$(echo ${split[1]})" >> $GITHUB_OUTPUT + echo "version_name=${split[0]}" >> $GITHUB_OUTPUT + echo "version_number=${split[1]}" >> $GITHUB_OUTPUT - name: Update KeyStore password in gradle properties run: sed -i 's/#{KEYSTORE_PASS}#/${{ secrets.KEYSTORE_PASS }}/g' android/key.properties - name: Update KeyStore key password in gradle properties @@ -68,6 +72,9 @@ jobs: runs-on: macos-latest env: MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release + outputs: + VERSION_NAME: ${{ steps.save_version.outputs.version_name }} + VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }} steps: - uses: actions/checkout@v3 - name: Decode .env @@ -79,13 +86,14 @@ jobs: file: './pubspec.yaml' key-path: '["version"]' - name: Save version on env variable + id: save_version run: | version=${{ steps.read_pubspec.outputs.data }} IFS='+' read -r -a split <<< "$version" echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV - echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_OUTPUT - echo "VERSION_NUMBER=$(echo ${split[1]})" >> $GITHUB_OUTPUT + echo "version_name=${split[0]}" >> $GITHUB_OUTPUT + echo "version_number=${split[1]}" >> $GITHUB_OUTPUT - uses: subosito/flutter-action@v2 with: channel: "stable" @@ -124,6 +132,9 @@ jobs: build-linux: name: Build Linux .tar.gz and .deb runs-on: ubuntu-latest + outputs: + VERSION_NAME: ${{ steps.save_version.outputs.version_name }} + VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }} steps: - uses: actions/checkout@v3 - name: Decode .env @@ -135,13 +146,14 @@ jobs: file: './pubspec.yaml' key-path: '["version"]' - name: Save version on env variable + id: save_version run: | version=${{ steps.read_pubspec.outputs.data }} IFS='+' read -r -a split <<< "$version" echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV - echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_OUTPUT - echo "VERSION_NUMBER=$(echo ${split[1]})" >> $GITHUB_OUTPUT + echo "version_name=${split[0]}" >> $GITHUB_OUTPUT + echo "version_number=${split[1]}" >> $GITHUB_OUTPUT - name: Update version in debian.yaml run: sed -i 's//${{ env.VERSION_NAME }}/g' debian/debian.yaml - name: Update dependencies list @@ -181,6 +193,9 @@ jobs: build-windows: name: Build Windows installer runs-on: windows-latest + outputs: + VERSION_NAME: ${{ steps.save_version.outputs.version_name }} + VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }} steps: - uses: actions/checkout@v3 - name: Decode .env @@ -195,13 +210,14 @@ jobs: key-path: '["version"]' - name: Save version on env variable shell: bash + id: save_version run: | version=${{ steps.read_pubspec.outputs.data }} IFS='+' read -r -a split <<< "$version" echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV - echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_OUTPUT - echo "VERSION_NUMBER=$(echo ${split[1]})" >> $GITHUB_OUTPUT + echo "version_name=${split[0]}" >> $GITHUB_OUTPUT + echo "version_number=${split[1]}" >> $GITHUB_OUTPUT - name: Update version in innosetup config file shell: pwsh run: | @@ -226,8 +242,8 @@ jobs: runs-on: ubuntu-latest needs: [build-android, build-macos, build-linux, build-windows] env: - VERSION_NAME: ${{ needs.build-android.outputs.version_name }} - VERSION_NUMBER: ${{ needs.build-android.outputs.version_number }} + VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }} + VERSION_NUMBER: ${{ needs.build-android.outputs.VERSION_NUMBER }} steps: - uses: actions/checkout@v3 - name: Create builds directory @@ -267,7 +283,7 @@ jobs: runs-on: ubuntu-latest needs: [build-android, build-macos, build-linux, build-windows] env: - VERSION_NAME: ${{ needs.build-android.outputs.version_name }} + VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }} steps: - uses: actions/checkout@v3 - name: Download Android artifacts