Skip to content

Commit fd6f226

Browse files
committed
update release action
1 parent aa21e20 commit fd6f226

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed
Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Publish Python 🐍 distributions 📦 to PyPI
22

3-
on:
3+
on:
44
release:
55
types: [published]
66

@@ -9,35 +9,44 @@ jobs:
99
name: Build and publish Python 🐍 distributions 📦 to PyPI
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: get latest release with tag
13-
id: latestrelease
14-
run: |
15-
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/dcnieho/I2MC_Python/releases/latest | jq '.tag_name' | sed 's/\"//g')"
16-
- name: confirm release tag
17-
run: |
18-
echo ${{ steps.latestrelease.outputs.releasetag }}
19-
- name: tagcheckout
20-
uses: actions/checkout@v3
21-
with:
22-
ref: ${{ steps.latestrelease.outputs.releasetag }}
23-
- name: Set up Python 3.10
24-
uses: actions/setup-python@v4
12+
- name: Clone repo
13+
uses: actions/checkout@v5
14+
15+
- name: Setup python
16+
uses: actions/setup-python@v6
2517
with:
26-
python-version: '3.10'
18+
python-version: "3.11.x"
19+
2720
- name: Install pypa/build
2821
run: >-
2922
python -m
3023
pip install
3124
build
3225
--user
33-
- name: Build a binary wheel and a source tarball
26+
27+
- name: Build a wheel and a source tarball
3428
run: >-
3529
python -m
3630
build
3731
--sdist
3832
--wheel
3933
--outdir dist/
34+
35+
- name: "Upload wheel as workflow artifact"
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: wheel
39+
path: ./dist/*.whl
40+
41+
- name: Upload wheel as release artifact
42+
uses: softprops/action-gh-release@v2
43+
env:
44+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
45+
with:
46+
files: "./dist/*.whl"
47+
4048
- name: Publish distribution 📦 to PyPI
41-
uses: pypa/[email protected]
49+
if: github.event_name == 'release' && github.event.action == 'published'
50+
uses: pypa/[email protected]
4251
with:
4352
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)