Skip to content
Merged
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/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Upload Python Package

on:
workflow_dispatch:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Upload Python Package' step
Uses Step
uses 'astral-sh/setup-uv' with ref 'v4', not a pinned commit hash
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
set -eux
uv sync
- name: Build package
shell: bash
run: |
set -eux
uv build
- name: Check package (Dry Run)
if: ${{github.event_name != 'release'}}
shell: bash
run: |
set -eux
uv pip install twine
uv run twine check dist/*
echo "Dry run completed. Package would be published in a release."
# - name: Publish to PyPI
# if: ${{github.event_name == 'release'}}
# shell: bash
# env:
# UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# run: |
# set -eux
# uv publish
- name: Publish to TestPyPI
if: ${{github.event_name == 'workflow_dispatch'}}
shell: bash
env:
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
set -eux
uv publish --publish-url https://test.pypi.org/legacy/ --token $UV_PUBLISH_TOKEN
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools >= 64", "setuptools_scm >= 8", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ommx-quantum-benchmarks"
name = "ommx_quantum_benchmarks"
dynamic = ["version"]
description = "Quantum Benchmark dataset in OMMX format"
readme = "README.md"
Expand All @@ -19,6 +19,9 @@ dependencies = [
[tool.setuptools]
packages = ["ommx_quantum_benchmarks"]

[tool.setuptools_scm]
version_file = "ommx_quantum_benchmarks/_version.py"

[dependency-groups]
dev = [
"pytest>=8.4.1",
Expand Down