Skip to content

Commit 40b7adb

Browse files
authored
fix: re-release to fix missing source distribution (#51)
1 parent 1b832c4 commit 40b7adb

File tree

1 file changed

+38
-17
lines changed

1 file changed

+38
-17
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
- "3.11"
4040
- "3.12"
4141
- "3.13"
42-
4342
os:
4443
- ubuntu-latest
4544
- macOS-latest
45+
- windows-latest
4646
extension:
4747
- "skip_cython"
4848
- "use_cython"
@@ -53,14 +53,13 @@ jobs:
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: ${{ matrix.python-version }}
56-
allow-prereleases: true
5756
- uses: snok/[email protected]
5857
- name: Install Dependencies
5958
run: |
6059
if [ "${{ matrix.extension }}" = "skip_cython" ]; then
6160
SKIP_CYTHON=1 poetry install --only=main,dev
6261
else
63-
poetry install --only=main,dev
62+
REQUIRE_CYTHON=1 poetry install --only=main,dev
6463
fi
6564
shell: bash
6665
- name: Test with Pytest
@@ -114,33 +113,52 @@ jobs:
114113
shell: alpine.sh --root {0}
115114

116115
release:
117-
runs-on: ubuntu-latest
118-
environment: release
119-
outputs:
120-
newest_release_tag: ${{ steps.release_tag.outputs.newest_release_tag }}
121-
if: github.ref == 'refs/heads/main'
122116
needs:
123117
- test
124118
- test32bit
125119
- lint
126120
- commitlint
127121

122+
runs-on: ubuntu-latest
123+
environment: release
124+
concurrency: release
125+
permissions:
126+
id-token: write
127+
contents: write
128+
outputs:
129+
released: ${{ steps.release.outputs.released }}
130+
newest_release_tag: ${{ steps.release_tag.outputs.newest_release_tag }}
131+
128132
steps:
129133
- uses: actions/checkout@v4
130134
with:
131135
fetch-depth: 0
136+
ref: ${{ github.head_ref || github.ref_name }}
132137

133-
# Run semantic release:
134-
# - Update CHANGELOG.md
135-
# - Update version in code
136-
# - Create git tag
137-
# - Create GitHub release
138-
# - Publish to PyPI
139-
- name: Python Semantic Release
138+
# Do a dry run of PSR
139+
- name: Test release
140140
uses: python-semantic-release/[email protected]
141+
if: github.ref_name != 'main'
142+
with:
143+
root_options: --noop
144+
145+
# On main branch: actual PSR + upload to PyPI & GitHub
146+
- name: Release
147+
uses: python-semantic-release/[email protected]
148+
id: release
149+
if: github.ref_name == 'main'
150+
with:
151+
github_token: ${{ secrets.GITHUB_TOKEN }}
152+
153+
- name: Publish package distributions to PyPI
154+
uses: pypa/gh-action-pypi-publish@release/v1
155+
if: steps.release.outputs.released == 'true'
156+
157+
- name: Publish package distributions to GitHub Releases
158+
uses: python-semantic-release/upload-to-gh-release@main
159+
if: steps.release.outputs.released == 'true'
141160
with:
142161
github_token: ${{ secrets.GITHUB_TOKEN }}
143-
pypi_token: ${{ secrets.PYPI_TOKEN }}
144162

145163
- name: Install python-semantic-release
146164
run: python3 -m pip install python-semantic-release==7.34.6
@@ -153,13 +171,15 @@ jobs:
153171
154172
build_wheels:
155173
needs: [release]
174+
if: needs.release.outputs.released == 'true'
156175

157176
name: Build wheels on ${{ matrix.os }}
158177
runs-on: ${{ matrix.os }}
159178
strategy:
160179
matrix:
161180
os:
162181
- ubuntu-24.04-arm
182+
- macos-13
163183
- macos-latest
164184
- ubuntu-latest
165185
- windows-latest
@@ -169,6 +189,7 @@ jobs:
169189
musl: "musllinux"
170190
- os: macos-latest
171191
musl: "musllinux"
192+
172193
steps:
173194
- uses: actions/checkout@v4
174195
with:
@@ -209,8 +230,8 @@ jobs:
209230
with:
210231
# unpacks default artifact into dist/
211232
# if `name: artifact` is omitted, the action will create extra parent dir
212-
pattern: wheels-*
213233
path: dist
234+
pattern: wheels-*
214235
merge-multiple: true
215236

216237
- uses: pypa/[email protected]

0 commit comments

Comments
 (0)