Skip to content

Nightly

Nightly #21

Workflow file for this run

name: Nightly
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
SKIP_RELEASE: "yes"
SIGNING_KEYSTORE_FILE: ./secrets/signing_key.jks
BUILD_APK_FILE: ./app/build/outputs/apk/release/app-release.apk
OUTPUT_DIR: ./dist
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle
- name: 🚧 Do prerequisites
run: npm ci
- name: 🔢 Get version
id: app_version
run: echo "version=$(npm run --silent version:print-nightly)" >> $GITHUB_OUTPUT
- name: 🔎 Check for release
run: echo "SKIP_RELEASE=$(npm run --silent git:tag-exists-yn -- $TAG_NAME)" >> $GITHUB_ENV
env:
TAG_NAME: v${{ steps.app_version.outputs.version }}
- name: 🔨 Generate certificate
if: env.SKIP_RELEASE == 'no'
run: |
mkdir -p $(dirname $SIGNING_KEYSTORE_FILE)
echo $SIGNING_KEYSTORE_FILE_CONTENT | base64 -di > $SIGNING_KEYSTORE_FILE
env:
SIGNING_KEYSTORE_FILE_CONTENT: ${{ secrets.SIGNING_KEYSTORE_FILE }}
- name: 🔨 Build apk
if: env.SKIP_RELEASE == 'no'
run: |
npm run prebuild
chmod +x ./gradlew
./gradlew build
env:
APP_VERSION_NAME: ${{ steps.app_version.outputs.version }}
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
- name: 📝 Rename apk
if: env.SKIP_RELEASE == 'no'
run: |
mkdir -p $OUTPUT_DIR
mv $BUILD_APK_FILE $OUTPUT_DIR/symphony-nightly-v$APP_VERSION_NAME.apk
env:
APP_VERSION_NAME: ${{ steps.app_version.outputs.version }}
- name: 🚀 Upload apk
if: env.SKIP_RELEASE == 'no'
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.app_version.outputs.version }}
artifacts: ${{ env.OUTPUT_DIR }}/*
generateReleaseNotes: false
draft: false
prerelease: true
artifactErrorsFailBuild: true
- name: 🔖 Was Release skipped?
if: env.SKIP_RELEASE == 'yes'
run: echo "Skipping since tag $TAG_NAME already exists"
env:
TAG_NAME: v${{ steps.app_version.outputs.version }}