build #61
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* | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install SDK | |
uses: malinskiy/action-android/install-sdk@release/0.1.4 | |
- name: Install NDK | |
run: | | |
sdkmanager --install "ndk;$(grep ndkVersion app/gradle.properties | cut -d= -f2)" | |
- name: Build | |
run: | | |
./gradlew build | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install SDK | |
uses: malinskiy/action-android/install-sdk@release/0.1.4 | |
- name: Install NDK | |
run: | | |
sdkmanager --install "ndk;$(grep ndkVersion app/gradle.properties | cut -d= -f2)" | |
- name: Check version | |
run: | | |
./gradlew checkVersion | |
- name: Build APK | |
env: | |
SIGNING_STORE_FILE: roc-droid.jks | |
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
run: | | |
echo "${{ secrets.SIGNING_STORE_BASE64 }}" | base64 -di > app/${{ env.SIGNING_STORE_FILE }} | |
./gradlew assembleRelease | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: app/build/outputs/apk/release/roc-droid-*.apk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |