modified: .github/workflows/python-publish.yml
Update flow
This commit is contained in:
1 parent
8c4bc91f6e
commit
b659268117
1 file changed
+9
-30
@@ -9,16 +9,17 @@
|
|||||||
name: Upload Python Package
|
name: Upload Python Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [published]
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-build:
|
build-release:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# NOTE: put your own distribution build steps here.
|
# NOTE: put your own distribution build steps here.
|
||||||
python -m pip install build
|
python -m pip install build
|
||||||
python -m build
|
python -m build --wheel
|
||||||
|
|
||||||
- name: Upload distributions
|
- name: Upload distributions
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -39,32 +40,10 @@ jobs:
|
|||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
pypi-publish:
|
pypi-publish:
|
||||||
runs-on: ubuntu-latest
|
name: Upload
|
||||||
needs:
|
environment: pypi
|
||||||
- release-build
|
|
||||||
permissions:
|
permissions:
|
||||||
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
# Dedicated environments with protections for publishing are strongly recommended.
|
|
||||||
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
||||||
environment:
|
|
||||||
name: pypi
|
|
||||||
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
||||||
# url: https://pypi.org/p/YOURPROJECT
|
|
||||||
#
|
|
||||||
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
||||||
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
||||||
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Retrieve release distributions
|
- name: Publish package distributions to PyPI
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release-dists
|
|
||||||
path: dist/
|
|
||||||
|
|
||||||
- name: Publish release distributions to PyPI
|
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
|
||||||
packages-dir: dist/
|
|
||||||
Reference in new issue
Block a user