Workflow file for this run
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: Generated APK AAB (Upload - Create Artifact To Github Action) | |
on: | |
push: | |
tags: | |
- 'v*' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Install Rust | |
# Or @nightly if you want | |
uses: dtolnay/rust-toolchain@stable | |
# Arguments to pass in | |
with: | |
# Make Rust compile to our target (defined in the matrix) | |
targets: aarch64-linux-android | |
- uses: nttld/setup-ndk@v1 | |
name: set up ndk | |
with: | |
ndk-version: r27b | |
- name: setup and build | |
shell: bash | |
run: | | |
cd lib-src/uog | |
cargo install cargo-ndk; | |
cargo install cross --git https://github.com/cross-rs/cross; | |
cross build --target aarch64-linux-android --release --lib; | |
cd ../.. | |
mkdir -p `pwd`/app/src/main/jniLibs/arm64-v8a | |
cp `pwd`/lib-src/uog/target/aarch64-linux-android/release/libuog.so `pwd`/app/src/main/jniLibs/arm64-v8a/libuog.so | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '17' | |
cache: 'gradle' | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: ln so | |
shell: bash | |
run: | | |
ls -ahl app/src/main/jniLibs/arm64-v8a | |
# Create APK Release | |
- name: Build apk release project (APK) | |
run: ./gradlew assembleRelease | |
- name: Build archive | |
if: startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
run: | | |
# Replace with the name of your binary | |
binary_name="uog-android" | |
dirname="$binary_name-${{ env.VERSION }}" | |
mkdir "$dirname" | |
mv "app/build/outputs/apk/release/app-release-unsigned.apk" "$dirname.apk" | |
echo "ASSET=$dirname.apk" >> $GITHUB_ENV | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app APK | |
if: startsWith(github.ref, 'refs/tags/') | |
# ID used to access action output | |
id: sign_app | |
with: | |
releaseDirectory: ./ | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
# override default build-tools version (33.0.0) -- optional | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{steps.sign_app.outputs.signedReleaseFile}} |