Merge pull request #70 from bisq-network/dependabot/github_actions/wz… #39
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: Master | |
on: | |
push: | |
branches: [ master ] | |
# Allows for running this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
outputs: | |
new_tag: ${{ steps.bump_version.outputs.new_tag }} | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Bump version | |
id: bump_version | |
uses: oflynned/Android-Semantic-Release@c2a5e19a1239f4e1639f270ebd0aeb913438520d | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Write version to file for use in other workflows | |
run: | | |
echo ${{ steps.bump_version.outputs.new_tag }} > VERSION | |
- name: Create google-services.json from secrets | |
env: | |
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
run: echo $GOOGLE_SERVICES_JSON > app/google-services.json | |
- name: Set up JDK 11 | |
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Clear gradle cache | |
run: | | |
mv ~/.gradle ~/.invalid || true | |
- name: Cache dependencies | |
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
- name: Check Gradle wrapper | |
uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81 | |
- name: Build the app | |
run: ./gradlew assembleRelease bundleRelease | |
- name: Upload VERSION | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | |
with: | |
name: VERSION | |
path: VERSION | |
if-no-files-found: error | |
- name: Upload unsigned APK | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | |
with: | |
name: bisq-release.apk | |
path: app/build/outputs/apk/release/bisq-release.apk | |
if-no-files-found: error | |
- name: Upload unsigned AAB | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | |
with: | |
name: bisq-release.aab | |
path: app/build/outputs/bundle/release/bisq-release.aab | |
if-no-files-found: error | |
sign: | |
name: Sign | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: build | |
steps: | |
- name: Download unsigned APK | |
uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 | |
with: | |
name: bisq-release.apk | |
path: app/build/outputs/apk/release | |
- name: Download unsigned AAB | |
uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 | |
with: | |
name: bisq-release.aab | |
path: app/build/outputs/bundle/release | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f | |
id: sign_apk | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Sign AAB | |
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f | |
id: sign_aab | |
with: | |
releaseDirectory: app/build/outputs/bundle/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Upload signed APK | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | |
with: | |
name: bisq-release-signed.apk | |
path: ${{ steps.sign_apk.outputs.signedReleaseFile }} | |
- name: Upload signed AAB | |
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | |
with: | |
name: bisq-release-signed.aab | |
path: ${{ steps.sign_aab.outputs.signedReleaseFile }} | |
upload_to_firebase: | |
name: Upload to Firebase | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: [ build, sign ] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Download signed APK | |
uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 | |
with: | |
name: bisq-release-signed.apk | |
path: app/build/outputs/apk/release | |
- name: Download signed AAB | |
uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 | |
with: | |
name: bisq-release-signed.aab | |
path: app/build/outputs/bundle/release | |
- name: Upload signed APK to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@a41b2f7ab3f7c2631b6a73fb2f660b517cef45a9 | |
with: | |
appId: ${{ secrets.FIREBASE_APP_ID }} | |
token: ${{ secrets.FIREBASE_TOKEN }} | |
file: app/build/outputs/apk/release/bisq-release-signed.apk | |
- name: Upload signed AAB to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@a41b2f7ab3f7c2631b6a73fb2f660b517cef45a9 | |
with: | |
appId: ${{ secrets.FIREBASE_APP_ID }} | |
token: ${{ secrets.FIREBASE_TOKEN }} | |
file: app/build/outputs/bundle/release/bisq-release.aab |