Skip to content

Commit

Permalink
Merge pull request #244 from agilescientific/trusted-publishers-pypi
Browse files Browse the repository at this point in the history
Update github action for trusted publisher to pypi
  • Loading branch information
kwinkunks authored Jan 27, 2025
2 parents 4cd1812 + 4b61624 commit 2ef36ea
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,31 @@ on:
types: [ published ]

jobs:
deploy:

build_wheel:
name: Build wheel
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

deploy:
needs: [build_wheel]
name: Publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
name: Packages
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 2ef36ea

Please sign in to comment.