Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and Publish to PyPI

on:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to also limit it to only pushes to the publish branch?

push:
tags:
- "20*"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a glob pattern and not a regex, should we use "20??.*.*" instead to ensure we don't match on non-calver patterns?


permissions:
contents: read

jobs:
build:
name: Build distribution (uv)
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python (via uv)
run: uv python install 3.12

- name: Build package
run: uv build

- name: Verify distributions
run: |
ls -lah dist/

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*

publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest

environment:
name: pypi

permissions:
id-token: write
contents: read

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ ssvc_doctools="ssvc.doctools:main"
"Project" = "https://github.com/CERTCC/SSVC"
"Bug Tracker" = "https://github.com/CERTCC/SSVC/issues"

[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
where = ["src"] # list of folders that contain the packages (["."] by default)
include = ["ssvc*"] # package names should match these glob patterns (["*"] by default)
exclude = ["test*"] # exclude packages matching these glob patterns (empty by default)
#namespaces = false # to disable scanning PEP 420 namespaces (true by default)
Expand Down
Loading