2.11.3 #59
Workflow file for this run
This file contains 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: Deploy release | |
on: | |
release: | |
types: [prereleased, released] | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
outputs: | |
VCODE: ${{ steps.get_vcode.outputs.VCODE }} | |
steps: | |
- uses: gitboard-io/gitboard-action@main | |
with: | |
username: frimtec | |
key: ${{ secrets.GITBOARD_IO_KEY }} | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Set version | |
run: | | |
sed -i 's/$version/${{ steps.get_version.outputs.VERSION }}/g' app/version.properties | |
- name: Get VCODE | |
id: get_vcode | |
run: echo "VCODE=$(expr $(date +%s) / 60 - 26797800)" >> $GITHUB_OUTPUT | |
- name: Build APK | |
run: bash ./gradlew assembleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | |
- name: Build AAB | |
run: bash ./gradlew :app:bundleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | |
- name: Setup build tool version variable | |
shell: bash | |
run: | | |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
echo Last build tool version is: $BUILD_TOOL_VERSION | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app APK | |
id: sign_app_apk | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app AAB | |
id: sign_app_aab | |
with: | |
releaseDirectory: app/build/outputs/bundle/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- name: Upload APK Release Asset | |
id: upload-release-asset-apk | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ${{steps.sign_app_apk.outputs.signedReleaseFile}} | |
asset_name: app-release.apk | |
asset_content_type: application/zip | |
- name: Choose Release track | |
id: get_track | |
run: echo TRACK=$(if [[ "${{ steps.get_release.outputs.prerelease }}" == "false" ]] ; then echo production ; else echo alpha ; fi) >> $GITHUB_OUTPUT | |
- name: Generate whatsnew | |
id: generate_whatsnew | |
run: | | |
mkdir -p google-play/whatsnew | |
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' >> google-play/whatsnew/whatsnew-de-DE | |
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' >> google-play/whatsnew/whatsnew-en-US | |
- name: Upload AAB Google Play | |
id: upload-release-asset-aab | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT }} | |
packageName: com.github.frimtec.android.pikettassist | |
releaseFiles: ${{steps.sign_app_aab.outputs.signedReleaseFile}} | |
track: ${{ steps.get_track.outputs.TRACK }} | |
whatsNewDirectory: google-play/whatsnew | |
status: completed | |
update-repo: | |
runs-on: ubuntu-22.04 | |
needs: deploy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | |
- name: Checkout master | |
run: | | |
git checkout master | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Create fastlane changelog | |
run: | | |
mkdir -p fastlane/metadata/android/en-US/changelogs | |
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' | head -n 10 >> fastlane/metadata/android/en-US/changelogs/${{needs.deploy.outputs.VCODE}}.txt | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add fastlane/metadata/android/en-US/changelogs/${{needs.deploy.outputs.VCODE}}.txt | |
git commit -m "Update release changelog for ${{ steps.get_version.outputs.VERSION }}" | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'master' |