-
Notifications
You must be signed in to change notification settings - Fork 34
52 lines (46 loc) · 1.49 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
name: Nightly Build
on:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day
workflow_dispatch: # Allows manual trigger
jobs:
format:
uses: ./.github/workflows/ruff-format.yml
lint:
uses: ./.github/workflows/ruff-lint.yml
test:
uses: ./.github/workflows/test.yml
tag:
name: Run Tests and Create Nightly Tag
runs-on: ubuntu-latest
needs: [format, lint, test]
steps:
- uses: actions/checkout@v4
- name: Create nightly tag
uses: actions/github-script@v7
with:
script: |
// Delete existing nightly tag if it exists
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/nightly'
});
} catch (e) {
// Tag might not exist yet
}
try {
// Create new tags
const sha = context.sha;
// Create/update nightly tag
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/nightly',
sha: sha
});
console.log(`Created tags: nightly`);
} catch (e) {
core.setFailed(e.message);
}