Skip to content

Commit 6e1d438

Browse files
Attempt 2 at trusted publisher
1 parent 0af537a commit 6e1d438

1 file changed

Lines changed: 32 additions & 14 deletions

File tree

.github/workflows/upload_pypi.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,44 @@ jobs:
1414
name: Run Workflow Tests
1515
uses: ./.github/workflows/test.yml
1616

17-
build-n-publish:
18-
name: Build and Publish to PyPi
17+
build:
18+
name: Build
1919
runs-on: ubuntu-latest
2020
needs: [run-workflow-tests]
21-
environment: release
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.8"
27+
- name: Install pypa/build
28+
run: >-
29+
python3 -m pip install build --user
30+
- name: Build a binary wheel and a source tarball
31+
run: python3 -m build
32+
- name: Store the distribution packages
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
38+
upload:
39+
name: Upload release to PyPI
40+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
41+
runs-on: ubuntu-latest
42+
needs:
43+
- build
44+
environment:
45+
name: release
46+
url: https://pypi.org/p/fixate
2247
permissions:
2348
id-token: write
2449

2550
steps:
26-
- uses: actions/checkout@v3
27-
- name: Setup Python
28-
uses: actions/setup-python@v4
51+
- name: Download all the dists
52+
uses: actions/download-artifact@v4
2953
with:
30-
python-version: "3.8"
31-
- name: Install build
32-
run: |
33-
python -m pip install --upgrade pip
34-
python -m pip install build --user
35-
- name: Build the package
36-
run: |
37-
python -m build --sdist --wheel --outdir dist/ .
54+
name: python-package-distributions
55+
path: dist/
3856
- name: Publish distribution to PyPI
3957
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)