Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 6e64cab

Browse files
authored
Merge pull request #327 from TriliumNext/JYC333-patch-1
Create nightly release action
2 parents 9c8cf0b + a50e5cc commit 6e64cab

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Nightly Release
2+
on:
3+
# This can be used to automatically publish nightlies at UTC nighttime
4+
schedule:
5+
- cron: '0 2 * * *' # run at 2 AM UTC
6+
# This can be used to allow manually triggering nightlies from the web interface
7+
workflow_dispatch:
8+
9+
jobs:
10+
nightly-electron:
11+
name: Deploy nightly
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
arch: [x64, arm64]
16+
os:
17+
- name: macos
18+
image: macos-latest
19+
extension: dmg
20+
- name: linux
21+
image: ubuntu-latest
22+
extension: deb
23+
- name: windows
24+
image: windows-latest
25+
extension: exe
26+
runs-on: ${{ matrix.os.image }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up node & dependencies
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
- name: Set up Python for appdmg to be installed
34+
if: ${{ matrix.os.name == 'macos' }}
35+
run: brew install python-setuptools
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Update build info
39+
run: npm run update-build-info
40+
- name: Run electron-forge
41+
run: npm run make-electron -- --arch=${{ matrix.arch }}
42+
- name: Prepare artifacts (Unix)
43+
if: runner.os != 'windows'
44+
run: |
45+
mkdir -p upload
46+
file=$(find out/make -name '*.zip' -print -quit)
47+
cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip"
48+
file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit)
49+
cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}"
50+
- name: Prepare artifacts (Windows)
51+
if: runner.os == 'windows'
52+
run: |
53+
mkdir upload
54+
$file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1
55+
Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip"
56+
$file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1
57+
Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}"
58+
- name: Publish artifacts
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}
62+
path: upload/*.zip
63+
overwrite: true
64+
- name: Publish installer artifacts
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}
68+
path: upload/*.${{ matrix.os.extension }}
69+
overwrite: true
70+
71+
- name: Deploy release
72+
uses: WebFreak001/[email protected]
73+
with:
74+
# upload_url: # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
75+
# release_id: # same as above (id can just be taken out the upload_url, it's used to find old releases)
76+
asset_path: upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip # path to archive to upload
77+
asset_name: TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-nightly.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
78+
asset_content_type: application/zip # required by GitHub API
79+
- name: Deploy installer release
80+
uses: WebFreak001/[email protected]
81+
with:
82+
# upload_url: # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
83+
# release_id: # same as above (id can just be taken out the upload_url, it's used to find old releases)
84+
asset_path: upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }} # path to archive to upload
85+
asset_name: TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-nightly.${{ matrix.os.extension }} # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
86+
asset_content_type: application/zip # required by GitHub API
87+
nightly-server:
88+
name: Deploy server nightly
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Set up node & dependencies
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version: 20
96+
cache: "npm"
97+
- name: Install dependencies
98+
run: npm ci
99+
- name: Run Linux server build (x86_64)
100+
run: |
101+
npm run update-build-info
102+
./bin/build-server.sh
103+
- name: Prepare artifacts
104+
if: runner.os != 'windows'
105+
run: |
106+
mkdir -p upload
107+
file=$(find dist -name '*.tar.xz' -print -quit)
108+
cp "$file" "upload/TriliumNextNotes-linux-x64-${{ github.ref_name }}.tar.xz"
109+
- uses: actions/upload-artifact@v4
110+
with:
111+
name: TriliumNextNotes linux server x64
112+
path: upload/TriliumNextNotes-linux-x64-${{ github.ref_name }}.tar.xz
113+
overwrite: true
114+
115+
- name: Deploy release
116+
uses: WebFreak001/[email protected]
117+
with:
118+
# upload_url: # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
119+
# release_id: # same as above (id can just be taken out the upload_url, it's used to find old releases)
120+
asset_path: upload/TriliumNextNotes-linux-x64-${{ github.ref_name }}.tar.xz # path to archive to upload
121+
asset_name: TriliumNextNotes-linux-x64-nightly.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
122+
asset_content_type: application/zip # required by GitHub API

0 commit comments

Comments
 (0)