Skip to content

Commit

Permalink
Publish Python builds using OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhelba committed Apr 16, 2024
1 parent b7ea10b commit dd89e4b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Tags are needed to compute the current version number
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install tox
- name: Install Python build
run: |
pip install --upgrade pip
pip install tox
- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: "true"
pip install build
- name: Build the Python distribution
run: |
tox -e release
python -m build
- name: Publish the Python distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
14 changes: 0 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ deps =
commands =
mypy {posargs}

[testenv:release]
package = skip
passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_NON_INTERACTIVE
deps =
build
twine
commands =
pyproject-build --sdist --wheel --outdir {envtmpdir}
twine check {envtmpdir}/*
twine upload --skip-existing {envtmpdir}/*

[flake8]
max-line-length = 100
show-source = True
Expand Down

0 comments on commit dd89e4b

Please sign in to comment.