99jobs :
1010 build :
1111 name : Build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
12+ environment : release
1213 strategy :
1314 fail-fast : false
1415 matrix :
@@ -20,19 +21,17 @@ jobs:
2021 platform : linux
2122 - os : windows
2223 ls : dir
23- interpreter : 3.7 3.8 3. 9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
24+ interpreter : 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
2425 - os : windows
2526 ls : dir
2627 target : aarch64
27- interpreter : 3.11 3.12
28+ interpreter : 3.11 3.12 3.13
2829 - os : macos
2930 target : aarch64
30- interpreter : 3.7 3.8 3. 9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
31+ interpreter : 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
3132 - os : ubuntu
3233 platform : linux
3334 target : aarch64
34- # mimalloc not supported on manylinux2014 cross-compile container
35- extra-build-args : --no-default-features
3635 # musllinux
3736 - os : ubuntu
3837 platform : linux
@@ -45,15 +44,11 @@ jobs:
4544 - os : ubuntu
4645 platform : linux
4746 target : ppc64le
48- interpreter : 3.7 3.8 3.9 3.10 3.11 3.12
49- # mimalloc not supported on manylinux2014 cross-compile container
50- extra-build-args : --no-default-features
47+ interpreter : 3.9 3.10 3.11 3.12 3.13
5148 - os : ubuntu
5249 platform : linux
5350 target : s390x
54- interpreter : 3.7 3.8 3.9 3.10 3.11 3.12
55- # mimalloc not supported on manylinux2014 cross-compile container
56- extra-build-args : --no-default-features
51+ interpreter : 3.9 3.10 3.11 3.12 3.13
5752
5853 runs-on : ${{ matrix.os }}-latest
5954 steps :
@@ -71,19 +66,20 @@ jobs:
7166 target : ${{ matrix.target }}
7267 manylinux : ${{ matrix.manylinux || 'auto' }}
7368 container : ${{ matrix.container }}
74- args : --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3. 9 3.10 3.11 3.12 pypy3.7 pypy3.8 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
69+ args : --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
7570 rust-toolchain : stable
7671 docker-options : -e CI
7772
7873 - run : ${{ matrix.ls || 'ls -lh' }} dist/
7974
80- - uses : actions/upload-artifact@v3
75+ - uses : actions/upload-artifact@v4
8176 with :
82- name : dist
77+ name : dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }}
8378 path : dist
8479
8580 build_sdist :
8681 runs-on : ubuntu-latest
82+ environment : release
8783 steps :
8884 - uses : actions/checkout@v3
8985 - name : Build sdist
@@ -92,33 +88,53 @@ jobs:
9288 command : sdist
9389 args : --out dist
9490 - name : Upload sdist
95- uses : actions/upload-artifact@v3
91+ uses : actions/upload-artifact@v4
9692 with :
97- name : dist
93+ name : dist-sdist
94+ path : dist
95+
96+ build_no_ext :
97+ runs-on : ubuntu-latest
98+ environment : release
99+ steps :
100+ - uses : actions/checkout@v3
101+ - name : Install and configure Poetry
102+ run : pipx install poetry
103+ - name : Hotswap build backend for Poetry
104+ # Maturin doesn't support building no-extension wheels, so we swap to Poetry for that
105+ run : |
106+ sed -i -e '/^\[build-system\]/,/^\[/{s/^requires = .*/requires = ["poetry-core>=2.0.0,<3.0.0"]/; s/^build-backend = .*/build-backend = "poetry.core.masonry.api"/}' pyproject.toml
107+ - name : Install dependencies
108+ run : poetry install --only main --only test --only typing --only build
109+ - name : Run poetry build
110+ run : poetry build -f wheel
111+ - name : Upload no-ext wheel
112+ uses : actions/upload-artifact@v4
113+ with :
114+ name : dist-any
98115 path : dist
99116
100117
101118 Release :
102- needs : [ build, build_sdist ]
103- if : success() && startsWith(github.ref, 'refs/tags/')
119+ needs : [ build, build_sdist, build_no_ext ]
120+ if : success()
104121 runs-on : ubuntu-latest
105-
122+ permissions :
123+ id-token : write
124+ contents : write
125+ environment :
126+ name : pypi
127+ url : https://pypi.org/project/pendulum/
106128 steps :
107129 - name : Checkout code
108130 uses : actions/checkout@v2
109131
110132 - name : Download artifacts
111- uses : actions/download-artifact@v3
133+ uses : actions/download-artifact@v4
112134 with :
113- name : dist
135+ pattern : dist*
114136 path : dist
115-
116- - name : Install Poetry
117- run : |
118- curl -fsS https://install.python-poetry.org | python - -y
119-
120- - name : Update PATH
121- run : echo "$HOME/.local/bin" >> $GITHUB_PATH
137+ merge-multiple : true
122138
123139 - name : Check distributions
124140 run : |
@@ -128,18 +144,15 @@ jobs:
128144 id : check-version
129145 run : |
130146 [[ "${GITHUB_REF#refs/tags/}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
131- || echo ::set-output name= prerelease:: true
147+ || echo prerelease= true >> $GITHUB_OUTPUT
132148
133149 - name : Create Release
134150 uses : ncipollo/release-action@v1
135151 with :
136152 artifacts : " dist/*"
137- token : ${{ secrets.GITHUB_TOKEN }}
138153 draft : false
139154 prerelease : steps.check-version.outputs.prerelease == 'true'
155+ body : " See CHANGELOG.md for details"
140156
141- - name : Publish to PyPI
142- env :
143- POETRY_PYPI_TOKEN_PYPI : ${{ secrets.PYPI_TOKEN }}
144- run : |
145- poetry publish
157+ - name : Publish package distributions to PyPI
158+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments