test hook sensor service #14
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 Apks | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- '.github/**' | |
- '.idea/**' | |
- '!.github/workflows/**' | |
jobs: | |
build: | |
name: Build Portal | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Java 21 | |
uses: gmitch215/setup-java@6d2c5e1f82f180ae79f799f0ed6e3e5efb4e664d | |
with: | |
distribution: jetbrains | |
java-version: 21 | |
- name: Cache Gradle Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
!~/.gradle/caches/build-cache-* | |
key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }} | |
restore-keys: gradle-deps | |
- name: Cache Gradle Build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches/build-cache-* | |
~/.gradle/buildOutputCleanup/cache.properties | |
key: gradle-builds-core-${{ github.sha }} | |
restore-keys: gradle-builds | |
- name: Build with Gradle | |
run: | | |
echo ${{ secrets.SIGN_KEYSTORE_BASE64 }} | base64 -d > keystore.jks | |
chmod +x ./gradlew | |
./gradlew :app:assembleRelease --build-cache --parallel --warning-mode all --stacktrace | |
echo "APK_FILE_ALL=$(find app/build/outputs/apk/app/release -name '*.apk')" >> $GITHUB_ENV | |
echo "APK_FILE_ARM64=$(find app/build/outputs/apk/arm64/release -name '*.apk')" >> $GITHUB_ENV | |
echo "APK_FILE_X86_64=$(find app/build/outputs/apk/x64/release -name '*.apk')" >> $GITHUB_ENV | |
env: | |
KEYSTORE_PATH: "../keystore.jks" | |
KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.SIGN_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }} | |
- name: Set Portal Version | |
run: | | |
version_name_all=$(basename -s .apk "${{ env.APK_FILE_ALL }}") | |
version_name_arm64=$(basename -s .apk "${{ env.APK_FILE_ARM64 }}") | |
version_name_x86_64=$(basename -s .apk "${{ env.APK_FILE_X86_64 }}") | |
echo "PORTAL_VERSION_ALL=$version_name_all" >> $GITHUB_ENV | |
echo "PORTAL_VERSION_ARM64=$version_name_arm64" >> $GITHUB_ENV | |
echo "PORTAL_VERSION_x86_64=$version_name_x86_64" >> $GITHUB_ENV | |
- name: Show Artifacts SHA256 | |
run: | | |
echo "### Build Success :rocket:" >> $GITHUB_STEP_SUMMARY | |
echo "|ABI|SHA256|" >> $GITHUB_STEP_SUMMARY | |
echo "|:--------:|:----------|" >> $GITHUB_STEP_SUMMARY | |
all=($(sha256sum "${{ env.APK_FILE_ALL }}")) | |
echo "|all|$all" >> $GITHUB_STEP_SUMMARY | |
arm64=($(sha256sum "${{ env.APK_FILE_ARM64 }}")) | |
echo "|arm64|$arm64" >> $GITHUB_STEP_SUMMARY | |
x86_64=($(sha256sum "${{ env.APK_FILE_X86_64 }}")) | |
echo "|x86_64|$x86_64" >> $GITHUB_STEP_SUMMARY | |
- name: Upload ALL APK RELEASE | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ env.PORTAL_VERSION_ALL }}" | |
path: "${{ env.APK_FILE_ALL }}" | |
- name: Upload ARM64 APK RELEASE | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ env.PORTAL_VERSION_ARM64 }}" | |
path: "${{ env.APK_FILE_ARM64 }}" | |
- name: Upload X86_64 APK RELEASE | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ env.PORTAL_VERSION_x86_64 }}" | |
path: "${{ env.APK_FILE_X86_64 }}" |