@@ -2,33 +2,38 @@ name: Publish Python Package
2
2
3
3
on : push
4
4
jobs :
5
- # build:
6
- # name: Build distribution 📦
7
- # runs-on: ubuntu-latest
8
-
9
- # steps:
10
- # - uses: actions/checkout@v4
11
- # - name: Set up Python
12
- # uses: actions/setup-python@v4
13
- # with:
14
- # python-version: "3.9"
15
-
16
- publish-to-pypi :
17
- name : >-
18
- Publish Python 🐍 distribution 📦 to PyPI
5
+ build :
6
+ name : Build distribution 📦
19
7
if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
20
- # needs:
21
- # - build
22
8
runs-on : ubuntu-latest
23
- environment :
24
- name : pypi
25
- url : https://pypi.org/p/derive_action_signing # Replace <package-name> with your PyPI project name
26
9
permissions :
27
10
contents : write # IMPORTANT: mandatory for trusted publishing
28
11
29
12
steps :
30
- - name : Publish PyPi package
31
- uses : code-specialist/pypi-poetry-publish@v1
13
+ - uses : actions/checkout@v4
14
+ - name : Set up Python
15
+ uses : actions/setup-python@v4
32
16
with :
33
- ACCESS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
- PUBLISH_REGISTRY_PASSWORD : ${{ secrets.PYPI_TOKEN }}
17
+ python-version : " 3.9"
18
+
19
+ - name : Install Poetry
20
+ run : |
21
+ curl -sSL https://install.python-poetry.org | python3 -
22
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
23
+
24
+ - name : Configure Poetry
25
+ run : |
26
+ poetry config pypi-token.pypi $PYPI_TOKEN
27
+ env :
28
+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
29
+
30
+ - name : Install project dependencies
31
+ run : poetry install
32
+
33
+ - name : Publish to PyPI
34
+ run : poetry build
35
+ env :
36
+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
37
+
38
+ - name : Publish to PyPI
39
+ run : poetry publish
0 commit comments