Skip to content

Commit

Permalink
use pypa/gh-action-pypi-publish for release (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Dec 21, 2023
1 parent 3428cd8 commit 20f3ae1
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: get dist artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -224,30 +224,23 @@ jobs:
- run: twine check dist/*

release:
needs: [build, check]
needs: [check, build, inspect-pypi-assets]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
environment: release

steps:
- uses: actions/checkout@v3
permissions:
id-token: write

- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: pip install -U twine
steps:
- uses: actions/checkout@v4

- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist

- run: twine check dist/*
- run: ls -lh dist

- name: upload to pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 20f3ae1

Please # to comment.