Skip to content

Commit e3c46aa

Browse files
committed
Switched to trusted publishing
Closes #548.
1 parent 9484d92 commit e3c46aa

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: Publish packages to PyPI
22

33
on:
4-
create:
5-
tags: "*"
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
8+
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
9+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
610

711
jobs:
8-
publish:
12+
build:
913
runs-on: ubuntu-latest
10-
if: startsWith(github.ref, 'refs/tags/')
14+
environment: release
1115
steps:
1216
- uses: actions/checkout@v3
1317
- name: Set up Python
@@ -18,7 +22,20 @@ jobs:
1822
run: pip install flit
1923
- name: Create packages
2024
run: flit build --setup-py
25+
- name: Store package artifacts
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: dist
29+
path: dist
30+
31+
publish:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment: release
35+
permissions:
36+
id-token: write
37+
steps:
38+
- name: Retrieve package artifacts
39+
uses: actions/download-artifact@v3
2140
- name: Upload packages
2241
uses: pypa/gh-action-pypi-publish@release/v1
23-
with:
24-
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)