diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fed15144..1cd06b91a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Determine Version Name from Tag id: get_version_name - run: echo "APP_VERSION_NAME=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT + run: echo "APP_VERSION_NAME=$(echo ${GITHUB_REF_NAME#v} | sed 's/-.*//')" >> $GITHUB_OUTPUT - name: Calculate Version Code id: calculate_version_code @@ -245,28 +245,46 @@ jobs: ./build-artifacts/google/apk/app-google-release.apk ./build-artifacts/fdroid/app-fdroid-release.apk - - name: Determine Play Store Track - id: get_track + - name: Determine Play Store Action + id: play_action run: | TAG_NAME="${{ github.ref_name }}" if [[ "$TAG_NAME" == *"-internal"* ]]; then echo "track=internal" >> $GITHUB_OUTPUT + echo "action=upload" >> $GITHUB_OUTPUT elif [[ "$TAG_NAME" == *"-closed"* ]]; then echo "track=NewAlpha" >> $GITHUB_OUTPUT + echo "from_track=internal" >> $GITHUB_OUTPUT + echo "action=promote" >> $GITHUB_OUTPUT elif [[ "$TAG_NAME" == *"-open"* ]]; then echo "track=beta" >> $GITHUB_OUTPUT + echo "from_track=alpha" >> $GITHUB_OUTPUT + echo "action=promote" >> $GITHUB_OUTPUT else echo "track=production" >> $GITHUB_OUTPUT + echo "from_track=beta" >> $GITHUB_OUTPUT + echo "action=promote" >> $GITHUB_OUTPUT fi - - name: Upload AAB to Google Play - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + - name: Attempt to Promote on Google Play + id: promote + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && steps.play_action.outputs.action == 'promote' + uses: r0adkll/upload-google-play@v1.1.3 + continue-on-error: true + with: + serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_JSON_KEY }} + packageName: com.geeksville.mesh + track: ${{ steps.play_action.outputs.track }} + fromTrack: ${{ steps.play_action.outputs.from_track }} + + - name: Upload to Google Play + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && (steps.play_action.outputs.action == 'upload' || steps.promote.outcome == 'failure') uses: r0adkll/upload-google-play@v1.1.3 with: serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_JSON_KEY }} packageName: com.geeksville.mesh releaseFiles: ./build-artifacts/google/bundle/app-google-release.aab - track: ${{ steps.get_track.outputs.track }} - status: ${{ steps.get_track.outputs.track == 'internal' && 'completed' || 'draft' }} + track: ${{ steps.play_action.outputs.track }} + status: ${{ steps.play_action.outputs.track == 'internal' && 'completed' || 'draft' }} whatsNewDirectory: ./whatsnew/ mappingFile: ./build-artifacts/google/mapping/mapping.txt