Skip to content

Commit b938c1e

Browse files
ci: split semantic release and pypi release
Semantic release creates and push a commit and tag that isn't visible to following workloads. Splitting them enables pypi build to see the tag.
1 parent 7592ffb commit b938c1e

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
lines changed

.github/workflows/build-wheels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ jobs:
4545

4646
steps:
4747
- uses: actions/checkout@v4
48+
with:
49+
fetch-tags: true # tags are used to determine wheel version
50+
4851
- uses: actions/setup-python@v5
4952
with:
5053
python-version: ${{ inputs.python-version }}
54+
5155
# Required to use MSVC with Ninja
5256
- uses: ilammy/msvc-dev-cmd@v1.13.0
5357

.github/workflows/release.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,7 @@ name: Release
33
on: workflow_dispatch
44

55
jobs:
6-
semantic-release:
7-
runs-on: ubuntu-latest
8-
environment:
9-
name: pypi
10-
url: https://pypi.org/p/trame-slicer
11-
permissions:
12-
id-token: write # IMPORTANT: mandatory for trusted publishing
13-
contents: write # IMPORTANT: mandatory for making GitHub Releases
14-
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
21-
- name: Python Semantic Release
22-
id: release
23-
uses: python-semantic-release/python-semantic-release@master
24-
with:
25-
github_token: ${{ secrets.GITHUB_TOKEN }}
26-
changelog: true
27-
build: false # build is too complex to be handled by semantic release
28-
296
release-build:
30-
needs: [semantic-release]
317
strategy:
328
fail-fast: true
339
matrix:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Semantic Release
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
semantic-release:
7+
runs-on: ubuntu-latest
8+
environment:
9+
name: pypi
10+
url: https://pypi.org/p/trame-slicer
11+
permissions:
12+
id-token: write # IMPORTANT: mandatory for trusted publishing
13+
contents: write # IMPORTANT: mandatory for making GitHub Releases
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Python Semantic Release
22+
id: release
23+
uses: python-semantic-release/python-semantic-release@master
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
changelog: true
27+
build: false # build is too complex to be handled by semantic release

0 commit comments

Comments
 (0)