Skip to content

Build your personal knowledge base with Trilium Notes

ci(nightly): publish to the nightly release only from main

Elian Doran59a8fadae4ea
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 1ed5c3b298..8336bac1ac 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -18,6 +18,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+# Assets are published to the public "nightly" release only for runs on the main
+# branch (scheduled or manually dispatched). Runs on any other ref — PRs, branch
+# dispatches, renovate pushes — keep their outputs as workflow artifacts instead.
+# The main ref is intentionally a literal: the schedule event payload is minimal,
+# so deriving the default branch from it is not reliable.
+
env:
GITHUB_RELEASE_ID: 179589950
@@ -94,7 +100,7 @@ jobs:
- name: Publish release
uses: softprops/[email protected]
- if: ${{ github.event_name != 'pull_request' }}
+ if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
with:
make_latest: false
prerelease: true
@@ -106,7 +112,7 @@ jobs:
- name: Publish artifacts
uses: actions/upload-artifact@v7
- if: ${{ github.event_name == 'pull_request' }}
+ if: ${{ github.event_name == 'pull_request' || github.ref != 'refs/heads/main' }}
with:
name: TriliumNotes ${{ matrix.os.name }} ${{ matrix.arch }}
path: apps/desktop/upload
@@ -135,6 +141,7 @@ jobs:
- name: Publish release
uses: softprops/[email protected]
+ if: ${{ github.ref == 'refs/heads/main' }}
with:
make_latest: false
prerelease: true
@@ -143,6 +150,13 @@ jobs:
tag_name: nightly
name: Mobile Nightly
+ - name: Publish artifacts
+ uses: actions/upload-artifact@v7
+ if: ${{ github.ref != 'refs/heads/main' }}
+ with:
+ name: TriliumNotes mobile nightly
+ path: apps/mobile/android/app/build/outputs/apk/release/*.apk
+
nightly-server:
if: ${{ github.repository == vars.REPO_MAIN }}
name: Deploy server nightly
@@ -167,7 +181,7 @@ jobs:
- name: Publish release
uses: softprops/[email protected]
- if: ${{ github.event_name != 'pull_request' }}
+ if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
with:
make_latest: false
prerelease: true
@@ -176,3 +190,10 @@ jobs:
files: upload/*.*
tag_name: nightly
name: Nightly Build
+
+ - name: Publish artifacts
+ uses: actions/upload-artifact@v7
+ if: ${{ github.event_name == 'pull_request' || github.ref != 'refs/heads/main' }}
+ with:
+ name: TriliumNotes server linux ${{ matrix.arch }}
+ path: upload