mastodon-app-ufficiale-android/.github/workflows/build_and_deploy.yml

79 lines
2.3 KiB
YAML
Raw Normal View History

2024-03-01 07:38:31 +01:00
name: Build and deploy
on:
2024-03-01 07:48:01 +01:00
push:
branches:
- 'ci_setup'
workflow_dispatch:
2024-03-01 07:38:31 +01:00
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-03-01 07:38:31 +01:00
- name: Set up JDK
uses: actions/setup-java@v2
2024-03-01 07:38:31 +01:00
with:
java-version: 21
2024-03-01 23:30:12 +01:00
distribution: temurin
2024-03-01 07:38:31 +01:00
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
2024-03-01 07:38:31 +01:00
bundler-cache: true
- name: Set up Android SDK
uses: android-actions/setup-android@v3
2024-03-01 07:38:31 +01:00
- name: Decode keystore
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "release.jks"
encodedString: ${{ secrets.KEYSTORE_FILE }}
2024-03-01 08:29:12 +01:00
- name: Prepare Gradle environment
2024-03-01 08:35:14 +01:00
run: |
2024-03-01 07:41:36 +01:00
echo "apply from: 'ci_signing.gradle'" >> mastodon/build.gradle
2024-03-01 08:29:12 +01:00
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
2024-03-01 07:38:31 +01:00
- name: Build and deploy to Google Play
run: bundle exec fastlane deploy
env:
KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
SUPPLY_JSON_KEY_DATA: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
2024-03-01 08:43:48 +01:00
SUPPLY_SKIP_UPLOAD_METADATA: true
SUPPLY_SKIP_UPLOAD_CHANGELOGS: true
2024-03-01 07:38:31 +01:00
- name: Build release apk
run: ./gradlew assembleRelease
env:
KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload release apk
uses: actions/upload-artifact@v4
with:
name: mastodon-release.apk
path: mastodon/build/outputs/apk/release/mastodon-release.apk
2024-03-01 07:38:31 +01:00
- name: Build githubRelease apk
run: ./gradlew assembleGithubRelease
env:
KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload githubRelease apk
uses: actions/upload-artifact@v4
with:
name: mastodon-githubRelease.apk
path: mastodon/build/outputs/apk/githubRelease/mastodon-githubRelease.apk
- name: Upload mappings
uses: actions/upload-artifact@v4
2024-03-01 07:38:31 +01:00
with:
name: mappings
path: mastodon/build/outputs/mapping/*/mapping.txt