Skip to content

Commit

Permalink
Attempt 2 at trusted publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
clint-lawrence committed Aug 5, 2024
1 parent 0af537a commit 6e1d438
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/upload_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,44 @@ jobs:
name: Run Workflow Tests
uses: ./.github/workflows/test.yml

build-n-publish:
name: Build and Publish to PyPi
build:
name: Build
runs-on: ubuntu-latest
needs: [run-workflow-tests]
environment: release
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build
run: >-
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

upload:
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build
environment:
name: release
url: https://pypi.org/p/fixate
permissions:
id-token: write

steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
python-version: "3.8"
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build --user
- name: Build the package
run: |
python -m build --sdist --wheel --outdir dist/ .
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 6e1d438

Please sign in to comment.