build: 1.4.0 #33
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Releases | |
| on: | |
| push: | |
| branches: | |
| - 'update/v*' | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-and-publish-github-release: | |
| name: Build and publish GitHub release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant Permission to Execute | |
| run: chmod +x gradlew | |
| - name: Decode GitHub Release Keystore | |
| env: | |
| ENCODED_KEYSTORE: ${{ secrets.ENCODED_KEYSTORE }} | |
| run: | | |
| echo $ENCODED_KEYSTORE | base64 -d > app/keystore | |
| - name: Build Signed Release APK and AAB | |
| env: | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: ./gradlew assembleRelease bundleRelease | |
| - name: Run Unit Tests | |
| run: ./gradlew test | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-builds | |
| path: | | |
| app/build/outputs/apk/release/app-release.apk | |
| app/build/outputs/bundle/release/app-release.aab | |
| - name: Get version name | |
| id: get_version | |
| run: | | |
| VERSION_NAME=$(echo ${GITHUB_REF#refs/tags/}) | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release ${{ env.VERSION_NAME }} | |
| draft: false | |
| prerelease: false | |
| files: app/build/outputs/apk/release/app-release.apk | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cleanup sensitive files | |
| run: | | |
| rm -f play-store-config.json | |
| rm -f app/keystore | |
| build-and-publish-play-store: | |
| name: Build and publish to Play Store | |
| runs-on: ubuntu-latest | |
| needs: build-and-publish-github-release | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set up Ruby and Bundler | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Setup Fastlane | |
| run: gem install fastlane | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-builds | |
| - name: Decode service account key | |
| env: | |
| PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} | |
| run: echo $PLAY_STORE_CONFIG_JSON > play-store-config.json | |
| - name: Decode GitHub Release Keystore | |
| env: | |
| ENCODED_KEYSTORE: ${{ secrets.ENCODED_KEYSTORE }} | |
| run: | | |
| echo $ENCODED_KEYSTORE | base64 -d > app/keystore | |
| - name: Deploy to Play Store (All Tracks) | |
| env: | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: fastlane android release_all | |
| - name: Cleanup sensitive files | |
| run: | | |
| rm -f play-store-config.json | |
| rm -f app/keystore |