-
-
Notifications
You must be signed in to change notification settings - Fork 408
116 lines (104 loc) · 3.2 KB
/
Copy pathnightly.yml
File metadata and controls
116 lines (104 loc) · 3.2 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: 🌙 Nightly builds
run-name: |
${{ github.event_name == 'schedule' && '⏰ Scheduled nightly build' || '' }}
${{ github.event_name == 'workflow_dispatch' && '👷 Triggered nightly build' || '' }}
# Create nightly builds at the end of every day
on:
schedule:
- cron: '0 0 * * *'
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:
inputs:
forceRun:
type: boolean
description: Force build and publish nightly packages to GitHub
default: false
required: false
jobs:
# Check if latest commit is less than 1 day old
check:
name: 🔀 Check latest commit
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_latest_commit.outputs.code_changes_since_yesterday }}
steps:
- uses: actions/checkout@v6
id: checkout
- name: ⬇ Check if latest commit is less than 1 day old
id: check_latest_commit
continue-on-error: true
run: |
if [[ -n "$(git rev-list --after="24 hours" ${{ steps.checkout.outputs.commit }})" ]]; then
echo "code_changes_since_yesterday=true" >> $GITHUB_OUTPUT
else
echo "code_changes_since_yesterday=false" >> $GITHUB_OUTPUT
fi
# Build Debian Bullseye Artifacts
linux:
name: 🐧 Debian Bullseye
if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }}
needs: [check]
uses: ./.github/workflows/debian.yml
secrets: inherit
with:
codename: 'bullseye'
publish: true
nightly: true
# Build macOS Artifacts
macos:
name: 🍏 macOS
if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }}
needs: [check]
uses: ./.github/workflows/macos.yml
secrets: inherit
with:
publish: true
nightly: true
# Build Windows Artifacts
windows:
name: 🪟 Windows
if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }}
needs: [check]
uses: ./.github/workflows/windows.yml
secrets: inherit
with:
publish: true
nightly: true
# Publish to GitHub
nightly:
name: 🚀 Publish to GitHub
if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }}
needs: [check, linux, macos, windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: 💾 Download artifacts
uses: actions/download-artifact@v8
with:
pattern: artifact-*
merge-multiple: true
- name: 📑 Read nightly template
uses: markpatterson27/markdown-to-output@v1
id: nightly_template
with:
filepath: ./.github/nightly.md
- name: 📦 Upload Nightly builds
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly build $$'
prerelease: true
body: ${{ steps.nightly_template.outputs.body }}
files: |
*.deb
*.tar.gz
*.exe
*.zip
*.dmg
- name: 🧹 Cleanup
uses: geekyeggo/delete-artifact@v6
with:
name: artifact-*
failOnError: false