|
| 1 | +name: Bump App Version |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + type: |
| 6 | + description: 'Bump type' |
| 7 | + required: true |
| 8 | + default: 'patch' |
| 9 | + type: choice |
| 10 | + options: |
| 11 | + - patch |
| 12 | + - minor |
| 13 | + - major |
| 14 | + releaseNote: |
| 15 | + description: 'Release Note' |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + |
| 19 | +jobs: |
| 20 | + bump: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: 🏗 Bump App Version |
| 26 | + id: bump-app-version |
| 27 | + run: | |
| 28 | + newVersion=$(bash ./scripts/versionBump.sh $TYPE "$RELEASE_NOTES") |
| 29 | + echo "::newVersion::$newVersion" |
| 30 | + echo "newVersion=$newVersion" >> "$GITHUB_OUTPUT" |
| 31 | + env: |
| 32 | + TYPE: ${{ inputs.type }} |
| 33 | + RELEASE_NOTES: ${{ inputs.releaseNote }} |
| 34 | + |
| 35 | + - name: Git Add and Commit |
| 36 | + run: | |
| 37 | + git config --global user.name 'Yogesh Choudhary Paliyal' |
| 38 | + git config --global user.email '[email protected]' |
| 39 | + git add . |
| 40 | + git commit -am "Github Actions: App version Bumped to ${{ steps.bump-app-version.outputs.newVersion }}" |
| 41 | +
|
| 42 | + - name: Print newVersion |
| 43 | + run: echo "${{ steps.bump-app-version.outputs.newVersion }}" |
| 44 | + |
| 45 | + - name: Build Release AAB |
| 46 | + id: buildFreeRelease |
| 47 | + run: ./gradlew bundleRelease |
| 48 | + |
| 49 | + - name: Sign Release AAB |
| 50 | + id: signPro |
| 51 | + uses: r0adkll/sign-android-release@fix/bundle-signing |
| 52 | + with: |
| 53 | + releaseDirectory: app/build/outputs/bundle/release |
| 54 | + signingKeyBase64: ${{ secrets.SIGNING_KEY }} |
| 55 | + alias: ${{ secrets.ALIAS }} |
| 56 | + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} |
| 57 | + keyPassword: ${{ secrets.KEY_PASSWORD }} |
| 58 | + |
| 59 | + - name: Push to protected branch |
| 60 | + uses: CasperWA/push-protected@v2 |
| 61 | + with: |
| 62 | + token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }} |
| 63 | + branch: master |
| 64 | + unprotect_reviews: true |
| 65 | + |
| 66 | + - name: Git push tag |
| 67 | + run: | |
| 68 | + git tag -a ${{ steps.bump-app-version.outputs.newVersion }} -m "Release version ${{ steps.bump-app-version.outputs.newVersion }}" |
| 69 | + git push origin ${{ steps.bump-app-version.outputs.newVersion }} |
| 70 | +
|
| 71 | + - name: Rename aab names |
| 72 | + run: | |
| 73 | + mv app/build/outputs/bundle/release/app-release.aab app/build/outputs/bundle/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.aab |
| 74 | +
|
| 75 | + - name: Create Release |
| 76 | + |
| 77 | + with: |
| 78 | + tag: "${{ steps.bump-app-version.outputs.newVersion }}" |
| 79 | + generateReleaseNotes: true |
| 80 | + commit: "master" |
| 81 | + artifacts: "app/build/outputs/bundle/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.aab" |
| 82 | + discussionCategory: "Release feedbacks" |
| 83 | + makeLatest: true |
| 84 | + |
| 85 | + - uses: snnaplab/universal-apk-generate-action@v1 |
| 86 | + id: apk-release-generate |
| 87 | + with: |
| 88 | + aab-path: 'app/build/outputs/bundle/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.aab' |
| 89 | + keystore-base64: ${{ secrets.SIGNING_KEY }} |
| 90 | + keystore-password: ${{ secrets.KEY_STORE_PASSWORD }} |
| 91 | + key-alias: ${{ secrets.ALIAS }} |
| 92 | + key-password: ${{ secrets.KEY_PASSWORD }} |
| 93 | + |
| 94 | + - name: Upload binaries to github release |
| 95 | + uses: svenstaro/upload-release-action@v2 |
| 96 | + with: |
| 97 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + file: ${{ steps.apk-free-generate.outputs.apk-path }} |
| 99 | + asset_name: 'deepr-release-${{steps.bump-app-version.outputs.newVersion}}.apk' |
| 100 | + tag: ${{ steps.bump-app-version.outputs.newVersion }} |
| 101 | + overwrite: true |
0 commit comments