-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually, not twine, need to use the action properly
- Loading branch information
1 parent
e9c5465
commit 01d37d9
Showing
1 changed file
with
31 additions
and
9 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,4 +1,4 @@ | ||
name: Publish Python Package | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
|
||
on: | ||
push: | ||
|
@@ -16,24 +16,46 @@ jobs: | |
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
python-version: "3.10" | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build setuptools-scm | ||
pip install twine | ||
- name: Build source distribution (sdist only) | ||
run: python -m build --sdist | ||
|
||
# We publish using the "Trusted Publisher" system on PyPi | ||
- name: Publish to PyPI via OIDC | ||
uses: pypa/[email protected] | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi-deployment | ||
url: https://pypi.org/p/cosmos-synthesizer | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
user: __token__ | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |