From 30d5bca24c49a791aa726fc7ec3f95214e6330fa Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Tue, 18 Aug 2026 13:55:17 +0100 Subject: [PATCH] Publish to pypi --- .copier-answers.yml | 2 +- .github/workflows/_pypi.yml | 16 ++++++++++++++++ .github/workflows/ci.yml | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/_pypi.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index 0d60b06..e3cd7df 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -14,7 +14,7 @@ docs_type: sphinx git_platform: github.com github_org: DiamondLightSource package_name: daq_queuing_service -pypi: false +pypi: true repo_name: daq-queuing-service strict_typing: true type_checker: pyright diff --git a/.github/workflows/_pypi.yml b/.github/workflows/_pypi.yml new file mode 100644 index 0000000..6f82f6b --- /dev/null +++ b/.github/workflows/_pypi.yml @@ -0,0 +1,16 @@ +on: + workflow_call: +jobs: + upload: + runs-on: ubuntu-latest + environment: release + steps: + - name: Download dist artifact + uses: actions/download-artifact@v7 + with: + name: dist + path: dist + - name: Publish to PyPI using trusted publishing + uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a50bfe5..249735b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,13 @@ jobs: dist: uses: ./.github/workflows/_dist.yml + pypi: + needs: [dist, test] + if: github.ref_type == 'tag' + uses: ./.github/workflows/_pypi.yml + permissions: + id-token: write + release: needs: [dist, test, docs] if: github.ref_type == 'tag'