diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml new file mode 100644 index 0000000000..7a608dda24 --- /dev/null +++ b/.github/workflows/python-wheels.yml @@ -0,0 +1,65 @@ +name: Build and publish python wheels + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + - ci/python-ci + tags: + - '*' + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # macos-13 is an intel runner, macos-14 is apple silicon + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.17.0 + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/py-v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + # TODO: Using a test endpoint + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000000..89d73fa155 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,24 @@ +# Automatic changelog and version bumping with release-please for python projects +name: Release-please 🐍 + +on: + workflow_dispatch: {} + push: + branches: + - main + - ci/python-ci + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + name: Create release PR + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + #path: "quantinuum-hugr-py" + token: ${{ secrets.GITHUB_TOKEN }} + target-branch: ${{ github.event.ref }} diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 436bb2f4dc..25a08b1d9c 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -1,4 +1,5 @@ -name: Release-plz +# Automatic changelog, version bumping, and semver-checks with release-plz for rust projects +name: Release-plz 🦀 permissions: pull-requests: write diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000000..eee402d933 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + "quantinuum-hugr-py": "0.1.0a1" +} diff --git a/pyproject.toml b/pyproject.toml index af4a5ed9b1..02f5b32b25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ description = "Namespace for the python packages in the HUGR repository. See the individual packages for more information." name = "hugr-project" version = "0.0.0" -authors = [] +authors = ["TKET development team "] readme = "README.md" packages = [] diff --git a/quantinuum-hugr-py/pyproject.toml b/quantinuum-hugr-py/pyproject.toml index 0db399359e..bddcab46b9 100644 --- a/quantinuum-hugr-py/pyproject.toml +++ b/quantinuum-hugr-py/pyproject.toml @@ -1,11 +1,23 @@ [tool.poetry] +classifiers = [ + "Environment :: Console", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", +] name = "quantinuum_hugr" -version = "0.0.0" +version = "0.1.0a1" description = "Quantinuum's common representation for quantum programs" -classifiers = [] # TODO -keywords = [] # TODO -authors = [] # TODO -maintainers = [] # TODO +#keywords = [] +authors = ["TKET development team "] +maintainers = ["Agustín Borgna "] license = "Apache-2.0" readme = "README.md" homepage = "https://github.com/CQCL/hugr" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000000..3cc6e6bc0d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "include-component-in-tag": true, + "packages": { + "quantinuum-hugr-py": { + "release-type": "python", + "package-name": "quantinuum_hugr" + } + }, + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styling", + "hidden": true + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": true + }, + { + "type": "refactor", + "section": "Code Refactoring", + "hidden": true + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ] +} diff --git a/release-plz.toml b/release-plz.toml index b2c9315330..ac46ebca4f 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -1,3 +1,5 @@ +# Automatic changelog generation for rust projects + [workspace] changelog_config = "cliff.toml" # use a custom git-cliff configuration # disable the changelog for all packages