build_and_deploy.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Build and deploy
  2. on:
  3. push:
  4. branches:
  5. - 'ci_setup'
  6. workflow_dispatch:
  7. jobs:
  8. deploy:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. - name: Set up JDK
  13. uses: actions/setup-java@v2
  14. with:
  15. java-version: 21
  16. distribution: temurin
  17. - name: Set up Ruby
  18. uses: ruby/setup-ruby@v1
  19. with:
  20. ruby-version: 2.7.2
  21. bundler-cache: true
  22. - name: Set up Android SDK
  23. uses: android-actions/setup-android@v3
  24. - name: Decode keystore
  25. uses: timheuer/base64-to-file@v1
  26. id: android_keystore
  27. with:
  28. fileName: "release.jks"
  29. encodedString: ${{ secrets.KEYSTORE_FILE }}
  30. - name: Prepare Gradle environment
  31. run: |
  32. echo "apply from: 'ci_signing.gradle'" >> mastodon/build.gradle
  33. echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
  34. - name: Build and deploy to Google Play
  35. run: bundle exec fastlane deploy
  36. env:
  37. KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
  38. KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
  39. SUPPLY_JSON_KEY_DATA: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
  40. SUPPLY_VALIDATE_ONLY: true
  41. SUPPLY_SKIP_UPLOAD_METADATA: true
  42. SUPPLY_SKIP_UPLOAD_CHANGELOGS: true
  43. - name: Build release apk
  44. run: ./gradlew assembleRelease
  45. env:
  46. KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
  47. KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
  48. - name: Upload release apk
  49. uses: actions/upload-artifact@v4
  50. with:
  51. name: mastodon-release.apk
  52. path: mastodon/build/outputs/apk/release/mastodon-release.apk
  53. - name: Build githubRelease apk
  54. run: ./gradlew assembleGithubRelease
  55. env:
  56. KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
  57. KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
  58. - name: Upload githubRelease apk
  59. uses: actions/upload-artifact@v4
  60. with:
  61. name: mastodon-githubRelease.apk
  62. path: mastodon/build/outputs/apk/githubRelease/mastodon-githubRelease.apk
  63. - name: Upload mappings
  64. uses: actions/upload-artifact@v4
  65. with:
  66. name: mappings
  67. path: mastodon/build/outputs/mapping/*/mapping.txt