2.14.0 #67
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 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Get release | |
id: get_release | |
uses: bruceadams/get-release@v1.3.2 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Build APK | |
run: bash ./gradlew assembleOssRelease --stacktrace | |
- name: Build AAB | |
run: bash ./gradlew :app:bundlePlaystoreRelease --stacktrace -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/oss/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/playstoreRelease | |
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/upload-google-play@v1.1.3 | |
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: Checkout release/next branch | |
run: | | |
git checkout release/next | |
- name: Read version.properties | |
id: read_version_properties | |
run: | | |
while IFS='=' read -r key value; do | |
if [ "$key" ]; then | |
echo "$key=$value" | |
# Set as environment variable | |
echo "$key=$value" >> $GITHUB_OUTPUT | |
fi | |
done < app/version.properties | |
- name: Checkout master branch | |
run: | | |
git checkout master | |
- name: Get release | |
id: get_release | |
uses: bruceadams/get-release@v1.3.2 | |
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/${{ steps.read_version_properties.outputs.VERSION_CODE }}.txt | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add fastlane/metadata/android/en-US/changelogs/${{ steps.read_version_properties.outputs.VERSION_CODE }}.txt | |
git commit -m "Update release changelog for ${{ steps.read_version_properties.outputs.VERSION_NAME }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@v0.8.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'master' |