🧮 Monthly alpha #330
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: 🧮 Monthly alpha | |
| on: | |
| workflow_dispatch: # to be able to run it manually | |
| schedule: | |
| - cron: '53 21 27 * *' # on 27 every month | |
| jobs: | |
| evaluateChanges: | |
| name: 🔋 Evaluate changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| SHOULD_BUILD: ${{ steps.check.outputs.shouldBuild }} | |
| steps: | |
| - name: 🌡️ Check | |
| id: check | |
| run: | | |
| echo shouldBuild=true >> $GITHUB_OUTPUT | |
| build: | |
| name: 📆 Monthlies | |
| runs-on: ubuntu-latest | |
| needs: evaluateChanges | |
| if: needs.evaluateChanges.outputs.SHOULD_BUILD == 'true' | |
| env: | |
| TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }} | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| SCHEDULED_BUILD_VARIANT: "assembleWebsiteFullAlpha" | |
| steps: | |
| - name: 🥏 Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: ☕️ JDKv17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: 🎪 Secrets | |
| if: success() | |
| # TODO: change build variant to fdroid if json does not exist | |
| # developers.google.com/android/guides/google-services-plugin#adding_the_json_file | |
| run: | | |
| mkdir -p app/src/debug | |
| echo "${GSCV_TEST_JSON}" > app/src/alpha/google-services.json | |
| # expected: l:29 w:45 m:691 | |
| wc -lwm app/src/debug/google-services.json | |
| env: | |
| GSCV_TEST_JSON: ${{ secrets.GOOGLE_SERVICES_TEST_JSON }} | |
| - name: 🫙 Alpha keystore | |
| run: | | |
| echo "${{ secrets.ALPHA_KS_ASC }}" > alphaKeystore.jks.asc | |
| gpg -d --passphrase "${{ secrets.ALPHA_KS_PASSPHRASE }}" --batch alphaKeystore.jks.asc > app/rdnsAlpha.jks | |
| wc -wcl alphaKeystore.jks.asc app/rdnsAlpha.jks | |
| - name: 🏗️ Build & notify | |
| run: | | |
| ./gradlew ${SCHEDULED_BUILD_VARIANT} --info --warning-mode all | |
| env: | |
| ALPHA_KS_ALIAS: ${{ vars.ALPHA_KS_ALIAS }} | |
| ALPHA_KS_FILE: ${{ vars.ALPHA_KS_FILE }} | |
| ALPHA_KS_STORE_PASSPHRASE: ${{ secrets.ALPHA_KS_STORE_PASSPHRASE }} | |
| ALPHA_KS_PASSPHRASE: ${{ secrets.ALPHA_KS_PASSPHRASE }} | |
| VERSION_CODE: ${{ github.run_number }} | |
| # version-code: archive.is/y8uCB | |
| - name: 🍫 Grab APK | |
| run: | | |
| apk_path="$(find . -type f -iname '*.apk' | head -n1)" | |
| echo $apk_path | |
| echo "APKFILE=${apk_path}" >> $GITHUB_ENV | |
| # github.com/actions/upload-artifact | |
| - name: 📜 Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: rdns-${{ github.sha }} | |
| path: ${{ env.APKFILE }} | |
| if-no-files-found: error | |
| # github.com/softprops/action-gh-release | |
| - name: 🎬 Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| prerelease: true | |
| files: | | |
| ${{ env.APKFILE }} | |
| - name: 💬 Telegram | |
| continue-on-error: true | |
| if: env.TELEGRAM_CHAT_ID && env.SCHEDULED_BUILD_VARIANT && env.TELEGRAM_TOKEN | |
| run: | | |
| # exit okay on errors | |
| set +e | |
| apk_path="$(find . -type f -iname '*.apk' | head -n1)" | |
| echo $apk_path | |
| echo "APKFILE=${apk_path}" >> $GITHUB_ENV | |
| curl https://api.telegram.org/bot$TELEGRAM_TOKEN/sendDocument \ | |
| -F chat_id="$TELEGRAM_CHAT_ID" \ | |
| -F "caption=Size: $(ls -l --block-size=K "$apk_path" | awk '{ print $5 }')" \ | |
| -F parse_mode=HTML \ | |
| -F document=@"$apk_path" | |