Skip to content

Commit c9dcf92

Browse files
authored
Merge pull request #36 from Jij-Inc/release
Release
2 parents 7fbb9a6 + 67f521a commit c9dcf92

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Upload Python Package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
deploy:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.10"]
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v4
24+
with:
25+
enable-cache: true
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies
31+
shell: bash
32+
run: |
33+
set -eux
34+
uv sync
35+
- name: Build package
36+
shell: bash
37+
run: |
38+
set -eux
39+
uv build
40+
- name: Check package (Dry Run)
41+
if: ${{github.event_name != 'release'}}
42+
shell: bash
43+
run: |
44+
set -eux
45+
uv pip install twine
46+
uv run twine check dist/*
47+
echo "Dry run completed. Package would be published in a release."
48+
# - name: Publish to PyPI
49+
# if: ${{github.event_name == 'release'}}
50+
# shell: bash
51+
# env:
52+
# UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
53+
# run: |
54+
# set -eux
55+
# uv publish
56+
- name: Publish to TestPyPI
57+
if: ${{github.event_name == 'workflow_dispatch'}}
58+
shell: bash
59+
env:
60+
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
61+
run: |
62+
set -eux
63+
uv publish --publish-url https://test.pypi.org/legacy/ --token $UV_PUBLISH_TOKEN

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools >= 64", "setuptools_scm >= 8", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "ommx-quantum-benchmarks"
6+
name = "ommx_quantum_benchmarks"
77
dynamic = ["version"]
88
description = "Quantum Benchmark dataset in OMMX format"
99
readme = "README.md"
@@ -19,6 +19,9 @@ dependencies = [
1919
[tool.setuptools]
2020
packages = ["ommx_quantum_benchmarks"]
2121

22+
[tool.setuptools_scm]
23+
version_file = "ommx_quantum_benchmarks/_version.py"
24+
2225
[dependency-groups]
2326
dev = [
2427
"pytest>=8.4.1",

0 commit comments

Comments
 (0)