11# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab:
22
3- name : Create a release and deploy to PyPi whenever a protected tag (v0.0.0) is created
3+ name : Create a release and deploy to PyPi
44
55on :
66 push :
77 tags :
88 - v*.*.*
9+ - v*.*.*.dev*
10+ - v*.*.*.post*
911
1012jobs :
11- build :
12- name : Build package
13- uses : ./.github/workflows/build-merged-pull-requests.yml
13+ test :
14+ uses : ./.github/workflows/test.yml
1415 secrets : inherit
1516
17+ build :
18+ name : Build wheel
19+ needs : test
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v4
23+ - uses : actions/setup-python@v5
24+ with :
25+ python-version : " 3.13"
26+ cache : " pip"
27+ - run : python -m pip install build
28+ - run : python -m build .
29+ - uses : actions/upload-artifact@v4
30+ with :
31+ name : package
32+ path : dist/*.*
33+
1634 merge-into-stable :
1735 name : Update stable branch to point to this release
1836 runs-on : ubuntu-latest
1937 needs : [build]
2038 if : " !contains(github.ref, 'dev')"
2139 permissions : write-all
2240 steps :
23- - name : Clone repository, check-out stable
24- uses : actions/checkout@v4.1.1
41+ - uses : actions/checkout@v4
2542 with :
2643 fetch-depth : 0
2744 ref : stable
@@ -32,21 +49,22 @@ jobs:
3249 git push
3350
3451 deploy :
35- name : Upload built package to PyPi
52+ name : Upload built wheel and source package to PyPi
3653 runs-on : ubuntu-latest
3754 needs : [build]
55+ environment :
56+ name : pypi
57+ url : https://pypi.org/p/cartogram
58+ permissions :
59+ id-token : write
3860 steps :
39- - name : Download built artifacts
40- uses : actions/download-artifact@v3
61+ - uses : actions/download-artifact@v4
4162 with :
4263 name : package
4364 path : dist/
44- - name : Upload package to PyPi
45- uses : pypa/gh-action-pypi-publish@release/v1.9
65+ - uses : pypa/gh-action-pypi-publish@release/v1
4666 with :
47- user : __token__
48- password : ${{ secrets.PYPI_API_TOKEN }}
49- skip_existing : true
67+ skip-existing : true
5068
5169 release :
5270 name : Create a new release
@@ -56,13 +74,11 @@ jobs:
5674 permissions :
5775 contents : write
5876 steps :
59- - name : Download built artifacts
60- uses : actions/download-artifact@v3
77+ - uses : actions/download-artifact@v4
6178 with :
6279 name : package
6380 path : dist/
64- - name : Create release and upload package
65- uses : softprops/action-gh-release@v2
81+ - uses : softprops/action-gh-release@v2
6682 with :
6783 files : dist/*
6884
@@ -74,13 +90,11 @@ jobs:
7490 permissions :
7591 contents : write
7692 steps :
77- - name : Download built artifacts
78- uses : actions/download-artifact@v3
93+ - uses : actions/download-artifact@v4
7994 with :
8095 name : package
8196 path : dist/
82- - name : Create release and upload package
83- uses : softprops/action-gh-release@v2
97+ - uses : softprops/action-gh-release@v2
8498 with :
8599 files : dist/*
86100 prerelease : true
0 commit comments