ci: build release APK, add short SHA to artifact file name #3
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 Debug APK | |
run: ./gradlew assembleDebug | |
- name: Upload Debug APK | |
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: Build Release APK | |
run: ./gradlew assembleRelease | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-testkey.apk | |
path: app/build/outputs/apk/debug/app-debug.apk |