Skip to content

Deploy Nightly

Deploy Nightly #138

Workflow file for this run

# yaml-language-server: https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
name: Deploy Nightly
on:
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-22.04
outputs:
nightly: ${{ steps.nightly.outputs.nightly }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: nightly
name: Check if current branch is nightly
run: (git tag --points-at HEAD | grep -wq "nightly" && echo "nightly=true") || echo "nightly=false" >> $GITHUB_OUTPUT
nightly:
needs: [check]
if: ${{ needs.check.outputs.nightly == 'false' }}
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Set up zipalign and apksigner
run: sudo apt install -y zipalign apksigner
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Set up Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
run: task build
- name: Publish
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete nightly --yes || true
git push origin :nightly || true
gh release create --prerelease --title "Nightly $(date +'%Y-%m-%d')" --notes "" --target $GITHUB_SHA nightly dist/artifacts/*