1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 18:27:43 +00:00
FairEmail/.github/workflows/android.yml

84 lines
3.1 KiB
YAML
Raw Normal View History

2023-10-30 18:53:37 +00:00
name: Android CI
2023-11-05 12:00:15 +00:00
run-name: ${{github.workflow}} - ${{vars.TAG}} - ${{github.sha}}
2023-10-30 18:53:37 +00:00
on:
workflow_dispatch:
inputs:
2023-11-05 12:00:15 +00:00
password:
description: 'Password'
required: true
2024-05-17 19:08:45 +00:00
branch:
description: 'Branch'
required: true
default: 'master'
2024-06-26 05:39:45 +00:00
permissions:
id-token: write
contents: read
attestations: write
2023-10-30 18:53:37 +00:00
jobs:
build:
runs-on: ubuntu-latest
2024-01-26 14:08:42 +00:00
#https://github.com/actions/checkout
#https://github.com/actions/setup-java
2023-10-30 18:53:37 +00:00
steps:
2024-01-26 14:08:42 +00:00
- uses: actions/checkout@v4
2024-05-17 19:08:45 +00:00
with:
ref: ${{ github.event.inputs.branch }}
2023-10-30 18:53:37 +00:00
- name: set up JDK 17
2024-01-26 14:08:42 +00:00
uses: actions/setup-java@v4
2023-10-30 18:53:37 +00:00
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
#https://github.com/actions/runner/issues/643
- name: Mask password
run: |
INP_PASSWORD=$(jq -r '.inputs.password' $GITHUB_EVENT_PATH)
echo ::add-mask::$INP_PASSWORD
echo PASSWORD="$INP_PASSWORD" >> $GITHUB_ENV
#https://stefma.medium.com/how-to-store-a-android-keystore-safely-on-github-actions-f0cef9413784
#gpg -c --armor --s2k-mode 3 --s2k-digest-algo SHA256 --s2k-count 10000000 --cipher-algo AES-256 <file>
- name: Decrypt secrets
run: |
echo "${{ secrets.KEYSTORE }}" > keystore.asc
gpg -d --passphrase "${PASSWORD}" --batch keystore.asc > Android.keystore
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > keystore.properties.asc
gpg -d --passphrase "${PASSWORD}" --batch keystore.properties.asc > keystore.properties
echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc
gpg -d --passphrase "${PASSWORD}" --batch local.properties.asc > local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
2023-11-02 09:43:27 +00:00
- name: Check with Lint
run: ./gradlew lintGithubRelease
2023-10-30 18:53:37 +00:00
- name: Build with Gradle
run: ./gradlew assembleGithubRelease assembleLargeRelease assemblePlayRelease uploadBugsnagGithub-releaseMapping uploadBugsnagLarge-releaseMapping uploadBugsnagPlay-releaseMapping
2024-06-26 05:39:45 +00:00
#https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'app/build/outputs/apk/**/release/*.apk'
2023-11-01 21:31:05 +00:00
- name: Upload to BitBucket
run: |
2024-05-17 19:08:45 +00:00
./gradlew upload -Ptarget=play-preview-${{ github.event.inputs.branch }}
./gradlew upload -Ptarget=github-snapshot-${{ github.event.inputs.branch }}
./gradlew upload -Ptarget=large-snapshot-${{ github.event.inputs.branch }}
2023-10-31 12:16:03 +00:00
#https://github.com/actions/upload-artifact
2024-01-26 14:08:42 +00:00
- uses: actions/upload-artifact@v4
2023-10-31 12:16:03 +00:00
with:
name: Mapping files
path: app/build/outputs/mapping/**/mapping.txt
2024-01-26 14:10:52 +00:00
- uses: actions/upload-artifact@v4
2024-01-26 14:08:42 +00:00
with:
name: Native debug symbols
path: app/build/outputs/native-debug-symbols/**/native-debug-symbols.zip
- uses: actions/upload-artifact@v4
2023-10-31 12:16:03 +00:00
with:
name: APK files
path: app/build/outputs/apk/**/release/*.apk