3
3
push :
4
4
branches :
5
5
- main
6
- - auto-release
7
6
pull_request :
8
7
branches : [main]
9
8
release :
@@ -16,14 +15,18 @@ concurrency:
16
15
group : ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
17
16
cancel-in-progress : true
18
17
18
+ permissions : {}
19
+
19
20
jobs :
20
21
check_changes :
21
22
runs-on : ubuntu-latest
22
23
outputs :
23
- should_run : ${{ steps.filter .outputs.any_changed }}
24
+ should_run : ${{ steps.set_should_run .outputs.should_run }}
24
25
steps :
25
26
- uses : actions/checkout@v4
26
- - uses : dorny/paths-filter@v2
27
+ with :
28
+ persist-credentials : false
29
+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
27
30
id : filter
28
31
with :
29
32
filters : |
@@ -34,17 +37,27 @@ jobs:
34
37
- 'pytensor/_version.py'
35
38
- 'pytensor/scan_perform.pyx'
36
39
- 'pytensor/scan_perform_ext.py'
40
+ - name : Set should_run output
41
+ id : set_should_run
42
+ run : |
43
+ if [[ "${{ github.event_name == 'release' ||
44
+ (
45
+ github.ref == 'refs/heads/main' ||
46
+ github.event_name == 'pull_request'
47
+ ) && steps.filter.outputs.any_changed == 'true'
48
+ }}" == "true" ]]; then
49
+ echo "should_run=true" >> $GITHUB_OUTPUT
50
+ else
51
+ echo "should_run=false" >> $GITHUB_OUTPUT
52
+ fi
37
53
38
54
# The job to build precompiled pypi wheels.
39
55
make_sdist :
40
56
name : Make SDist
41
57
needs : check_changes
42
- # Run if it's a release, auto-release branch, or if relevant files changed on main
58
+ # Run if it's a release or if relevant files changed on main
43
59
if : |
44
- github.event_name == 'release' ||
45
- github.ref == 'refs/heads/auto-release' ||
46
- (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
47
- (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
60
+ needs.check_changes.outputs.should_run == 'true'
48
61
runs-on : ubuntu-latest
49
62
permissions :
50
63
# write id-token and attestations are required to attest build provenance
75
88
run_checks :
76
89
name : Build & inspect our package.
77
90
needs : check_changes
78
- # Run if it's a release, auto-release branch, or if relevant files changed on main
91
+ # Run if it's a release or if relevant files changed on main
79
92
if : |
80
- github.event_name == 'release' ||
81
- github.ref == 'refs/heads/auto-release' ||
82
- (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
83
- (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
93
+ needs.check_changes.outputs.should_run == 'true'
84
94
# Note: the resulting builds are not actually published.
85
95
# This is purely for additional testing and diagnostic purposes.
86
96
runs-on : ubuntu-latest
@@ -95,12 +105,9 @@ jobs:
95
105
build_wheels :
96
106
name : Build wheels for ${{ matrix.platform }}
97
107
needs : check_changes
98
- # Run if it's a release, auto-release branch, or if relevant files changed on main
108
+ # Run if it's a release or if relevant files changed on main
99
109
if : |
100
- github.event_name == 'release' ||
101
- github.ref == 'refs/heads/auto-release' ||
102
- (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
103
- (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
110
+ needs.check_changes.outputs.should_run == 'true'
104
111
runs-on : ${{ matrix.platform }}
105
112
permissions :
106
113
# write id-token and attestations are required to attest build provenance
@@ -136,12 +143,9 @@ jobs:
136
143
build_universal_wheel :
137
144
name : Build universal wheel for Pyodide
138
145
needs : check_changes
139
- # Run if it's a release, auto-release branch, or if relevant files changed on main
146
+ # Run if it's a release or if relevant files changed on main
140
147
if : |
141
- github.event_name == 'release' ||
142
- github.ref == 'refs/heads/auto-release' ||
143
- (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
144
- (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
148
+ needs.check_changes.outputs.should_run == 'true'
145
149
runs-on : ubuntu-latest
146
150
permissions :
147
151
# write id-token and attestations are required to attest build provenance
@@ -180,11 +184,6 @@ jobs:
180
184
check_dist :
181
185
name : Check dist
182
186
needs : [check_changes, make_sdist, build_wheels]
183
- if : |
184
- github.event_name == 'release' ||
185
- github.ref == 'refs/heads/auto-release' ||
186
- (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
187
- (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
188
187
runs-on : ubuntu-22.04
189
188
steps :
190
189
- uses : actions/download-artifact@v4
0 commit comments