mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-22 15:37:02 +00:00
84 lines
2.9 KiB
YAML
84 lines
2.9 KiB
YAML
name: Create android Play Store APK
|
|
on:
|
|
push:
|
|
branches: [master, release/*, test/git-actions]
|
|
tags:
|
|
- v*
|
|
workflow_dispatch:
|
|
inputs: {}
|
|
|
|
jobs:
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 21
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
# - name: Build with Gradle
|
|
# run: ./gradlew build
|
|
- name: Setup android-sdk
|
|
uses: android-actions/setup-android@v3
|
|
with:
|
|
accept-android-sdk-licenses: true
|
|
log-accepted-android-sdk-licenses: true #make accepting the android sdk license verbose
|
|
|
|
- name: Get npm cache directory
|
|
id: npm-cache-dir
|
|
run: |
|
|
echo "::set-output name=dir::$(npm config get cache)"
|
|
- uses: actions/cache@v4
|
|
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
|
|
with:
|
|
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- name: Install npm Packages
|
|
# if: steps.npm-cache.outputs.cache-hit != 'true'
|
|
run: npm i
|
|
|
|
- name: Decode Keystore
|
|
env:
|
|
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.DROID_KEYSTORE_PASSWORD }}
|
|
RELEASE_KEYSTORE_ALIAS: ${{ secrets.DROID_KEYSTORE_ALIAS }}
|
|
RELEASE_KEY_PASSWORD: ${{ secrets.DROID_KEY_PASSWORD }}
|
|
run: |
|
|
echo "${{ secrets.DROID_KEYSTORE_BASE_64 }}" | base64 --decode > keystore.jks
|
|
|
|
- name: Build
|
|
run: npm run dist:android:prod
|
|
env:
|
|
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.DROID_KEYSTORE_PASSWORD }}
|
|
RELEASE_KEYSTORE_ALIAS: ${{ secrets.DROID_KEYSTORE_ALIAS }}
|
|
RELEASE_KEY_PASSWORD: ${{ secrets.DROID_KEY_PASSWORD }}
|
|
|
|
- name: DEBUG
|
|
run: |
|
|
ls -la android/app/build/outputs
|
|
ls -la android/app/build/outputs/apk
|
|
ls -la android/app/build/outputs/apk/play
|
|
ls -la android/app/build/outputs/apk/play/release
|
|
|
|
- name: Sign APK
|
|
run: |
|
|
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
|
|
-keystore keystore.jks \
|
|
-storepass ${{ secrets.DROID_KEYSTORE_PASSWORD }} \
|
|
-keypass ${{ secrets.DROID_KEY_PASSWORD }} \
|
|
android/app/build/outputs/apk/play/release/app-play-release-unsigned.apk \
|
|
${{ secrets.DROID_KEYSTORE_ALIAS }}
|
|
|
|
- name: 'Upload Artifact'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: sup-android-release
|
|
path: android/app/build/outputs/*/*
|