-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.11 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# 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
fetch-tags: true
- 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:
permissions:
contents: write
runs-on: ubuntu-22.04
if: ${{ needs.check.outputs.nightly != 'true' }}
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/*