ci: build signed apk #5
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: Build APK | ||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '21' | ||
- name: Get short commit SHA | ||
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
- name: Grant execution permission to Gradle Wrapper | ||
run: chmod +x gradlew | ||
- name: Build APK (testkey) | ||
run: ./gradlew build | ||
- name: Upload Debug APK (testkey) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-debug-testkey.apk | ||
path: app/build/outputs/apk/debug/app-debug.apk | ||
- name: Upload Release APK (testkey) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-testkey.apk | ||
path: app/build/outputs/apk/release/app-release.apk | ||
- name: Export key | ||
env: | ||
KEY_BASE64: ${{ secret.KEY_BASE64 }} | ||
Check failure on line 46 in .github/workflows/build.yml GitHub Actions / Build APKInvalid workflow file
|
||
run: echo $KEY_BASE64 | base64 --decode - > app/signature.jks | ||
- name: Build APK | ||
env: | ||
KEYSTORE_PASSWORD: ${{ secret.KEYSTORE_PASSWORD }} | ||
KEY_PASSWORD: ${{ secret.KEY_PASSWORD }} | ||
KEY_ALIAS: ${{ secret.KEY_ALIAS }} | ||
run: ./gradlew build | ||
- name: Upload Debug APK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-debug-signed.apk | ||
path: app/build/outputs/apk/debug/app-debug.apk | ||
- name: Upload Release APK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-signed.apk | ||
path: app/build/outputs/apk/debug/app-debug.apk |