@@ -2,27 +2,59 @@ name: Daily Release Check
2
2
3
3
on :
4
4
schedule :
5
- - cron : ' 0 0 * * *' # Run at midnight UTC daily
6
- workflow_dispatch : # Allow manual triggers
5
+ # Run every day at 9:00 UTC
6
+ - cron : ' 0 9 * * *'
7
+ # Allow manual trigger for testing
8
+ workflow_dispatch :
7
9
8
10
jobs :
9
- check-releases :
11
+ prepare :
10
12
runs-on : ubuntu-latest
13
+ outputs :
14
+ matrix : ${{ steps.set-matrix.outputs.matrix }}
15
+ last_release : ${{ steps.last-release.outputs.hash }}
11
16
steps :
12
17
- uses : actions/checkout@v4
13
18
with :
14
- fetch-depth : 0 # Need full history for git log
15
-
16
- - name : Set up Python
17
- uses : actions/setup-python@v4
19
+ fetch-depth : 0
20
+
21
+ - name : Find package directories
22
+ id : set-matrix
23
+ run : |
24
+ DIRS=$(git ls-tree -r HEAD --name-only | grep -E "package.json|pyproject.toml" | xargs dirname | grep -v "^.$" | jq -R -s -c 'split("\n")[:-1]')
25
+ echo "matrix=${DIRS}" >> $GITHUB_OUTPUT
26
+
27
+ - name : Get last release hash
28
+ id : last-release
29
+ run : |
30
+ HASH=$(git rev-list --tags --max-count=1 || echo "HEAD~1")
31
+ echo "hash=${HASH}" >> $GITHUB_OUTPUT
32
+
33
+ check-release :
34
+ needs : prepare
35
+ runs-on : ubuntu-latest
36
+ strategy :
37
+ matrix :
38
+ directory : ${{ fromJson(needs.prepare.outputs.matrix) }}
39
+ fail-fast : false
40
+
41
+ steps :
42
+ - uses : actions/checkout@v4
18
43
with :
19
- python-version : ' 3.11'
20
-
21
- - name : Install dependencies
44
+ fetch-depth : 0
45
+
46
+ - uses : astral-sh/setup-uv@v5
47
+
48
+ - name : Setup Node.js
49
+ if : endsWith(matrix.directory, 'package.json')
50
+ uses : actions/setup-node@v4
51
+ with :
52
+ node-version : ' 18'
53
+
54
+ - name : Setup Python
55
+ if : endsWith(matrix.directory, 'pyproject.toml')
56
+ run : uv python install
57
+
58
+ - name : Check release
22
59
run : |
23
- python -m pip install semver PyGithub rich toml click
24
-
25
- - name : Run release check
26
- env :
27
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
- run : python scripts/weekly-release.py --dry-run
60
+ uv run --script scripts/release.py --dry-run "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}"
0 commit comments