Skip to content

Commit 083f574

Browse files
authored
Support publishing to PyPI using the trusted publisher mechanism (#1134)
1 parent 168f839 commit 083f574

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

.github/workflows/pypi-release.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88
group: pypi-release
99

1010
jobs:
11-
release:
11+
build:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
@@ -19,7 +19,27 @@ jobs:
1919
run: curl -sSL https://install.python-poetry.org | python3 -
2020
- name: Validate Release Version
2121
run: poetry version -s | grep -E "$(echo "$GITHUB_REF_NAME" | tr -d 'v')"
22-
- name: Publish to PyPI
23-
env:
24-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
25-
run: poetry publish --build
22+
- name: Build Basilisp distributions
23+
run: poetry build
24+
- name: Upload build artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
path: dist/
28+
if-no-files-found: error
29+
30+
release:
31+
runs-on: ubuntu-latest
32+
environment:
33+
name: release
34+
needs:
35+
- build
36+
permissions:
37+
id-token: write
38+
steps:
39+
- name: Download build artifact
40+
uses: actions/download-artifact@v4
41+
with:
42+
path: dist/
43+
merge-multiple: true
44+
- name: Publish package distributions to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1.12.2

0 commit comments

Comments
 (0)