release: v1.0.3-rc.1 #33
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: Music Automatic Release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | |
workflow_dispatch: | |
jobs: | |
buildAPKs: | |
name: build APKs from Release Tag for GitHub Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: mobile | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js & pnpm | |
uses: ./.github/actions/setup | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: microsoft | |
java-version: 17 | |
- name: Setup Gradle action for optimized execution and caching | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Save commit tag as environment variable & display it | |
run: | | |
COMMIT_TAG=$(git describe --tags --abbrev=0) | |
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV | |
echo "Commit Tag: $COMMIT_TAG" | |
- name: Create `sentry.properties` file | |
run: | | |
echo "${{ secrets.SENTRY_PROPERTIES }}" > android/sentry.properties | |
- name: Add upload key secrets for signing APKs | |
run: | | |
git submodule update --init --recursive | |
echo "${{ secrets.RELEASE_CRED }}" >> android/gradle.properties | |
- name: Build upload keystore `.jks` file | |
uses: timheuer/[email protected] | |
with: | |
fileName: keystore.jks | |
fileDir: mobile/android/app | |
encodedString: ${{ secrets.KEYSTORE_BASE64 }} | |
- name: Clean generated builds | |
run: rm -rf android/app/build/generated/ | |
- name: Build and sign APKs with Gradle | |
run: cd android && chmod +x gradlew && ./gradlew assembleRelease | |
- name: Zip files used for deobfuscation | |
run: | | |
zip -j deobfuscate.zip android/app/build/outputs/mapping/release/mapping.txt \ | |
android/app/build/outputs/native-debug-symbols/release/native-debug-symbols.zip | |
- name: Create GitHub Release draft with APKs | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.COMMIT_TAG }} | |
tag_name: ${{ env.COMMIT_TAG }} | |
token: ${{ secrets.MISSINGCORE_BOT_GITHUB_TOKEN }} | |
files: | | |
mobile/android/app/build/outputs/apk/release/*.apk | |
mobile/deobfuscate.zip | |
draft: true | |
# Mark release as prerelease if the tag contains `-rc.` | |
prerelease: ${{ contains(env.COMMIT_TAG, '-rc.') }} | |
generate_release_notes: true | |
buildAAB: | |
name: build AAB from Release Tag for Play Console | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: mobile | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js & pnpm | |
uses: ./.github/actions/setup | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: microsoft | |
java-version: 17 | |
- name: Setup Gradle action for optimized execution and caching | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Create `sentry.properties` file | |
run: | | |
echo "${{ secrets.SENTRY_PROPERTIES }}" > android/sentry.properties | |
- name: Add upload key secrets for signing APKs | |
run: | | |
git submodule update --init --recursive | |
echo "${{ secrets.RELEASE_CRED }}" >> android/gradle.properties | |
- name: Build upload keystore `.jks` file | |
uses: timheuer/[email protected] | |
with: | |
fileName: keystore.jks | |
fileDir: mobile/android/app | |
encodedString: ${{ secrets.KEYSTORE_BASE64 }} | |
- name: Clean generated builds | |
run: rm -rf android/app/build/generated/ | |
- name: Build and sign app bundle with Gradle | |
run: cd android && chmod +x gradlew && ./gradlew bundleRelease | |
# Save `.aab` as artifact before upload to Play Console incase upload fails. | |
- name: Upload AAB as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: outputAAB | |
path: mobile/android/app/build/outputs/bundle/release/*.aab | |
- name: Upload AAB to Google Play Console "Internal Testing" track | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | |
packageName: com.cyanchill.missingcore.music | |
releaseFiles: mobile/android/app/build/outputs/bundle/release/app-release.aab | |
# No need for `changesNotSentForReview: true` as internal track shouldn't | |
# get reviewed. | |
track: internal |