Skip to content

Commit a017d0b

Browse files
committed
Apply suggestions from code reviews
1 parent 047065f commit a017d0b

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

.github/workflows/pypi.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
push:
44
branches:
55
- main
6-
- auto-release
76
pull_request:
87
branches: [main]
98
release:
@@ -16,14 +15,24 @@ concurrency:
1615
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1716
cancel-in-progress: true
1817

18+
permissions: {}
19+
1920
jobs:
2021
check_changes:
2122
runs-on: ubuntu-latest
2223
outputs:
23-
should_run: ${{ steps.filter.outputs.any_changed }}
24+
should_run: |
25+
echo "${{ github.event_name == 'release' ||
26+
(
27+
github.ref == 'refs/heads/main' ||
28+
github.event_name == 'pull_request'
29+
) && steps.filter.outputs.any_changed == 'true'
30+
}}"
2431
steps:
2532
- uses: actions/checkout@v4
26-
- uses: dorny/paths-filter@v2
33+
with:
34+
persist-credentials: false
35+
- uses: dorny/paths-filter@v3
2736
id: filter
2837
with:
2938
filters: |
@@ -39,12 +48,9 @@ jobs:
3948
make_sdist:
4049
name: Make SDist
4150
needs: check_changes
42-
# Run if it's a release, auto-release branch, or if relevant files changed on main
51+
# Run if it's a release or if relevant files changed on main
4352
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')
53+
needs.check_changes.outputs.should_run == 'true'
4854
runs-on: ubuntu-latest
4955
permissions:
5056
# write id-token and attestations are required to attest build provenance
@@ -75,12 +81,9 @@ jobs:
7581
run_checks:
7682
name: Build & inspect our package.
7783
needs: check_changes
78-
# Run if it's a release, auto-release branch, or if relevant files changed on main
84+
# Run if it's a release or if relevant files changed on main
7985
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')
86+
needs.check_changes.outputs.should_run == 'true'
8487
# Note: the resulting builds are not actually published.
8588
# This is purely for additional testing and diagnostic purposes.
8689
runs-on: ubuntu-latest
@@ -95,12 +98,9 @@ jobs:
9598
build_wheels:
9699
name: Build wheels for ${{ matrix.platform }}
97100
needs: check_changes
98-
# Run if it's a release, auto-release branch, or if relevant files changed on main
101+
# Run if it's a release or if relevant files changed on main
99102
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')
103+
needs.check_changes.outputs.should_run == 'true'
104104
runs-on: ${{ matrix.platform }}
105105
permissions:
106106
# write id-token and attestations are required to attest build provenance
@@ -136,12 +136,9 @@ jobs:
136136
build_universal_wheel:
137137
name: Build universal wheel for Pyodide
138138
needs: check_changes
139-
# Run if it's a release, auto-release branch, or if relevant files changed on main
139+
# Run if it's a release or if relevant files changed on main
140140
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')
141+
needs.check_changes.outputs.should_run == 'true'
145142
runs-on: ubuntu-latest
146143
permissions:
147144
# write id-token and attestations are required to attest build provenance
@@ -181,10 +178,7 @@ jobs:
181178
name: Check dist
182179
needs: [check_changes, make_sdist, build_wheels]
183180
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')
181+
needs.check_changes.outputs.should_run == 'true'
188182
runs-on: ubuntu-22.04
189183
steps:
190184
- uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)