-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Update to trusted publisher workflow
- Loading branch information
Showing
1 changed file
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
name: Publish to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
types: [published] | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/subscript | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: pip install --upgrade setuptools wheel twine | ||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
- name: Upload deploy | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_SECRET }} | ||
run: python -m twine upload dist/* | ||
python-version: 3.11 | ||
|
||
- name: Install build dependencies | ||
run: | | ||
pip install -U pip | ||
pip install build | ||
- name: Build distributions | ||
run: python -m build | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |