diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..4706511 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,43 @@ +categories: + - title: "New features" + labels: + - "new functionality" + - "enhancement" + - title: "API Changes" + labels: + - "Breaking change" + - "API change" + - title: "Data Model Changes" + labels: + - "data model change" + - title: "Bug Fixes" + labels: + - "bug" + - "fix" + - title: "Refactoring and Optimization" + labels: + - "optimization" + - "refactoring" + - title: "Maintenance" + labels: + - "build" + - "documentation" + - "installation" + - "maintenance" +change-template: "- $TITLE (#$NUMBER) @$AUTHOR" +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +template: | + + ## Summary + + ... + + ## Contributors + + $CONTRIBUTORS + + ## What has changed since $PREVIOUS_TAG + + Pull-requests containing changes of multiple nature are repeated. + + $CHANGES diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..e0cfac8 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,59 @@ +name: Build Python Package + +on: + push: + workflow_dispatch: + release: + types: + - published + +jobs: + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: hynek/build-and-inspect-python-package@v2 + with: + path: . + + distlong: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: astral-sh/setup-uv@v6 + + - name: Build SDist and wheel + run: uvx --from build pyproject-build + + - uses: actions/upload-artifact@v4 + with: + name: Packages-distlong-${{ github.job }} + path: dist/* + + - name: Check metadata + run: uvx twine check ./dist/* + + publishtrusted: + needs: [ dist ] + 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/attest-build-provenance@v2 + with: + subject-path: "./dist/*" + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 7b2239a..f429d46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,23 +47,12 @@ dependencies = [ ] [project.optional-dependencies] -pyvisgen = [ - "pyvisgen" -] +pyvisgen = ["pyvisgen"] + [dependency-groups] -tests = [ - "h5py", - "pytest >= 7.0", - "pytest-cov", - "tomli", -] -dev = [ - "pre-commit", - "ipython", - "jupyter", - {include-group = "tests"}, -] +tests = ["h5py", "pytest >= 7.0", "pytest-cov", "tomli"] +dev = ["pre-commit", "ipython", "jupyter", { include-group = "tests" }] [project.urls] repository = "https://github.com/radionets-project/pyvisgrid"