Skip to content

Commit

Permalink
Updated trusted publisher on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuntz committed Nov 2, 2024
1 parent 578b901 commit 53d1f9a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ jobs:
fail-fast: false

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

- name: Set up Python 3.11
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --editable .
python -m pip install --editable .
build_sdist:
name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
Expand All @@ -46,12 +46,12 @@ jobs:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -67,6 +67,7 @@ jobs:
python -m coveralls --service=github
- name: Build sdist
if: matrix.os == 'ubuntu-latest'
run: |
python -m build
Expand All @@ -78,27 +79,27 @@ jobs:
upload_to_pypi:
needs: [build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/download-artifact@v4
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
path: dist/

- name: Publish to Test PyPI
- name: Publish test to Test.PyPI
# only if working on master
if: github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_token }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true
# verbose: true

- name: Publish to PyPI
- name: Publish release to PyPI
# only if tagged
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}

0 comments on commit 53d1f9a

Please sign in to comment.