Skip to content

Commit

Permalink
Update GitActions to OIDC.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMandich committed Jun 24, 2024
1 parent 83728de commit 8a665c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 38 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/python-public-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,17 @@ on:
types: [prereleased]

jobs:
deploy:

pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest

# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# retrieve your distributions here
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy
29 changes: 10 additions & 19 deletions .github/workflows/python-public-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@ on:
types: [released]

jobs:
deploy:

pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest

# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python3 -m twine upload dist/*
# retrieve your distributions here
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 8a665c8

Please sign in to comment.