Skip to content

Commit 44ae03e

Browse files
authored
Use trusted published for PyPI, update FastAPI (#40)
1 parent 26ff78d commit 44ae03e

3 files changed

Lines changed: 62 additions & 51 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- "*"
77

88
jobs:
9-
build_and_publish:
10-
name: Build and publish
9+
build:
10+
name: Test and build
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout 🔁
@@ -30,10 +30,28 @@ jobs:
3030
- name: Run tests 🌈
3131
run: poetry run invoke test
3232

33+
- name: Build the package 📦
34+
run: poetry build
35+
36+
- name: Publish build artifact ⬆️
37+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1
38+
with:
39+
name: package-dist
40+
path: dist
41+
publish:
42+
name: Publish
43+
needs: build
44+
runs-on: ubuntu-latest
45+
environment: PyPI
46+
permissions:
47+
# this permission is mandatory for trusted publishing
48+
id-token: write
49+
steps:
50+
- name: Download build artifact ⬇️
51+
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe #v4.1.2
52+
with:
53+
name: package-dist
54+
path: dist
55+
3356
- name: Publish package to PyPI 🙌
34-
run: |
35-
set -e
36-
poetry config http-basic.pypi "__token__" "${PYPI_TOKEN}"
37-
poetry publish --build
38-
env:
39-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
57+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf #v1.8.11

0 commit comments

Comments
 (0)