Update pr.yaml #178
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 | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- "v*.*.*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: 'aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android' | |
# See https://github.com/Bromeon/godot-rust/blob/master/.github/workflows/full-ci.yml | |
- name: "Find highest Android NDK version" | |
run: | | |
echo $ANDROID_SDK_ROOT | |
HIGHEST_NDK_VERSION=$(ls $ANDROID_SDK_ROOT/ndk | tail -n1) | |
echo "Highest Android NDK: $HIGHEST_NDK_VERSION" | |
EXPECTED_NDK_VERSION=26.1.10909125 | |
echo "Expected Android NDK: $EXPECTED_NDK_VERSION" | |
echo "ANDROID_NDK_VERSION=$EXPECTED_NDK_VERSION" >> $GITHUB_ENV | |
- name: Build ruslin-data-uniffi | |
working-directory: ./ruslin-data-uniffi | |
run: | | |
./release.sh arm64-v8a | |
./release.sh armeabi-v7a | |
./release.sh x86_64 | |
./release.sh x86 | |
- name: Decode Keystore | |
env: | |
ENCODED_STRING: ${{ secrets.SIGNING_KEY }} | |
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
run: | | |
TMP_KEYSTORE_FILE_PATH="${GITHUB_WORKSPACE}"/upload-keystore.jks | |
echo $ENCODED_STRING | base64 --decode > "${TMP_KEYSTORE_FILE_PATH}" | |
echo "storePassword=${SIGNING_STORE_PASSWORD}" >> "${GITHUB_WORKSPACE}"/keystore.properties | |
echo "keyPassword=${SIGNING_KEY_PASSWORD}" >> "${GITHUB_WORKSPACE}"/keystore.properties | |
echo "keyAlias=${SIGNING_KEY_ALIAS}" >> "${GITHUB_WORKSPACE}"/keystore.properties | |
echo "storeFile=${TMP_KEYSTORE_FILE_PATH}" >> "${GITHUB_WORKSPACE}"/keystore.properties | |
- name: Unable to strip the following libraries ? | |
run: | | |
./gradlew :app:stripReleaseDebugSymbols | |
./gradlew :app:stripReleaseDebugSymbols | |
- name: Build signed APKs | |
run: ./gradlew :app:assembleRelease | |
- name: Build signed Android App Bundle | |
run: ./gradlew :app:bundleRelease | |
- name: Prepare artifacts | |
run: bash ./scripts/prepare_artifacts.sh | |
- name: Upload signed APKs & Android App Bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Signed APKs | |
path: | | |
app/build/outputs/apk/release/*.apk | |
app/build/outputs/bundle/release/*.aab | |
app/build/outputs/native-debug-symbols/release/*.zip | |
app/build/outputs/mapping/release/*.zip | |
- uses: ncipollo/release-action@v1 | |
name: Create nightly release and upload artifacts | |
if: github.ref == 'refs/heads/main' | |
with: | |
name: nightly | |
commit: main | |
tag: nightly | |
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/bundle/release/*.aab,app/build/outputs/native-debug-symbols/release/*.zip,app/build/outputs/mapping/release/*.zip" | |
body: This is the nightly version of the app (autogenerated). | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
allowUpdates: true | |
removeArtifacts: true | |
replacesArtifacts: true | |
- name: Prepare release | |
if: startsWith(github.ref, 'refs/tags/') | |
run: node ./scripts/prepare_release.js | |
- uses: ncipollo/release-action@v1 | |
name: Create release and upload artifacts | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/bundle/release/*.aab,app/build/outputs/native-debug-symbols/release/*.zip,app/build/outputs/mapping/release/*.zip" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
allowUpdates: true | |
removeArtifacts: true | |
replacesArtifacts: true | |
prerelease: contains('refs/tags/*alpha*', github.ref) || contains('refs/tags/*beta*', github.ref) || contains('refs/tags/*rc*', github.ref) |