Browse Source

build: move nightly build schedule to separate workflow (#10000)

This allows users to easily disable nightly builds in their forks,
simply by disabling the
build-nightly action.

### Testing

I tested it in my fork, and it works.
Ross Smith II 9 months ago
parent
commit
7f3c8dbff1
2 changed files with 19 additions and 3 deletions
  1. 18 0
      .github/workflows/build-nightly.yaml
  2. 1 3
      .github/workflows/build-syncthing.yaml

+ 18 - 0
.github/workflows/build-nightly.yaml

@@ -0,0 +1,18 @@
+name: Build Syncthing (Nightly)
+
+on:
+  schedule:
+    # Run nightly build at 05:00 UTC
+    - cron: '00 05 * * *'
+  workflow_dispatch:
+
+permissions:
+  contents: write
+  packages: write
+
+jobs:
+  build-syncthing:
+    uses: ./.github/workflows/build-syncthing.yaml
+    # if we only want nightlies to run for specific users:
+    # if: contains(fromJSON('["syncthing", "calmh"]'), github.repository_owner)
+    secrets: inherit

+ 1 - 3
.github/workflows/build-syncthing.yaml

@@ -3,9 +3,7 @@ name: Build Syncthing
 on:
   pull_request:
   push:
-  schedule:
-    # Run nightly build at 05:00 UTC
-    - cron: '00 05 * * *'
+  workflow_call:
   workflow_dispatch:
 
 env: