separate key per flavor #26
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: Build, Release | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
PROD_RELEASE: true | |
jobs: | |
build_release_github: | |
environment: production | |
env: | |
FLAVOR: github | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Generate keystore.properties | |
run: | | |
cat <<EOF > keystore.properties | |
storeFile:${{ vars.GH_KEYSTORE_STORE_FILE_PATH }} | |
storePassword:${{ secrets.GH_KEYSTORE_STORE_PASSWORD }} | |
keyAlias:${{ secrets.GH_KEYSTORE_KEY_ALIAS }} | |
keyPassword:${{ secrets.GH_KEYSTORE_KEY_PASSWORD }} | |
EOF | |
- name: Generate keystore.jks | |
run: echo "${{ secrets.GH_KEYSTORE_JKS_BASE64 }}" | base64 --decode > ${{ vars.GH_KEYSTORE_STORE_FILE_PATH }} | |
- name: Generate google-services.json | |
run: echo "${{ secrets.GOOGLE_SERVICES_BASE64 }}" | base64 --decode > app/google-services.json | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build release APK for Github Release | |
run: ./gradlew assembleGithub --no-daemon | |
- name: Generate release notes | |
run: | | |
{ | |
echo 'RELEASE_NOTE<<EOF' | |
awk -v version="${{ github.ref_name }}" '($0 ~ "^## " version "($|[[:space:]])") {p=1;next} /^## / {p=0} p && NF' CHANGELOG.md | |
echo EOF | |
} >> "$GITHUB_ENV" | |
- name: Publish APK on Github Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: app/build/outputs/apk/${{ env.FLAVOR }}/release/app-${{ env.FLAVOR }}-release.apk | |
generate_release_notes: true | |
append_body: true | |
body: ${{ env.RELEASE_NOTE }} | |
build_release_google_play: | |
environment: production | |
env: | |
FLAVOR: play | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Generate keystore.properties | |
run: | | |
cat <<EOF > keystore.properties | |
storeFile:${{ vars.PLAY_KEYSTORE_STORE_FILE_PATH }} | |
storePassword:${{ secrets.PLAY_KEYSTORE_STORE_PASSWORD }} | |
keyAlias:${{ secrets.PLAY_KEYSTORE_KEY_ALIAS }} | |
keyPassword:${{ secrets.PLAY_KEYSTORE_KEY_PASSWORD }} | |
EOF | |
- name: Generate keystore.jks | |
run: echo "${{ secrets.PLAY_KEYSTORE_JKS_BASE64 }}" | base64 --decode > ${{ vars.PLAY_KEYSTORE_STORE_FILE_PATH }} | |
- name: Generate google-services.json | |
run: echo "${{ secrets.GOOGLE_SERVICES_BASE64 }}" | base64 --decode > app/google-services.json | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build Release AAB for Google Play | |
run: ./gradlew bundlePlay --no-daemon | |
- name: Upload AAB | |
uses: actions/upload-artifact@v4 | |
with: | |
name: subspace | |
path: app/build/outputs/bundle/${{ env.FLAVOR }}/app-${{ env.FLAVOR }}-release.aab | |