diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b3c6943 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + tag: + description: 'Release tag to publish (e.g. v0.0.15)' + required: true + type: string + workflow_call: + inputs: + tag: + required: true + type: string + +jobs: + publish: + name: Build & publish to PyPI + runs-on: ubuntu-24.04 + timeout-minutes: 10 + environment: + name: pypi + url: https://pypi.org/project/xarray_plotly + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ inputs.tag }} + fetch-depth: 0 + + - uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Build + run: uv build + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9387fb..c1b7665 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,31 +42,10 @@ jobs: prerelease: ${{ inputs.prerelease }} publish: - name: Build & publish to PyPI needs: [release-please] if: needs.release-please.outputs.release_created - runs-on: ubuntu-24.04 - timeout-minutes: 10 - environment: - name: pypi - url: https://pypi.org/project/xarray_plotly permissions: id-token: write - steps: - - uses: actions/checkout@v6 - with: - ref: ${{ needs.release-please.outputs.tag_name }} - fetch-depth: 0 - - - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - - name: Build - run: uv build - - - uses: pypa/gh-action-pypi-publish@release/v1 + uses: ./.github/workflows/publish.yml + with: + tag: ${{ needs.release-please.outputs.tag_name }}