-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e81f7ba
commit 3acb451
Showing
1 changed file
with
54 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,15 +1,60 @@ | ||
name: PyPi | ||
name: Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Many color libraries just need this to be set to any value, but at least | ||
# one distinguishes color depth, where "3" -> "256-bit color". | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
build: | ||
dist: | ||
name: Distribution build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
- uses: actions/checkout@v4 | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
plugins: "poetry-dynamic-versioning[plugin]" | ||
fetch-depth: 0 | ||
|
||
- uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
publish: | ||
needs: [dist] | ||
name: Publish to PyPI | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
contents: read | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Generate artifact attestation for sdist and wheel | ||
uses: actions/[email protected] | ||
with: | ||
subject-path: "dist/*" | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
# with: | ||
# Remember to tell (test-)pypi about this repo before publishing | ||
# Remove this line to publish to PyPI | ||
# repository-url: https://test.pypi.org/legacy/ |