From 4b56b33fd7ad3975b7146b59247b24b84bab825e Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 21 Mar 2026 19:37:50 +0100 Subject: [PATCH 1/2] ci: replace manual publish with release-please workflow Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yaml | 72 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ------------- 2 files changed, 72 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d9387fb --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,72 @@ +name: Release + +on: + push: + branches: [main] + workflow_dispatch: + inputs: + branch: + description: Branch to create the release from + required: true + default: main + prerelease: + description: Create a pre-release + type: boolean + default: false + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + name: Release Please + runs-on: ubuntu-24.04 + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: .release-please-config.json + manifest-file: .release-please-manifest.json + token: ${{ steps.app-token.outputs.token }} + target-branch: ${{ inputs.branch || github.ref_name }} + 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e55abf2..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release (Manual) - -on: - workflow_dispatch: - inputs: - tag: - description: 'Tag to release (e.g., v0.0.13)' - required: true - -jobs: - release: - runs-on: ubuntu-latest - permissions: - id-token: write # for trusted publishing - - steps: - - uses: actions/checkout@v6 - with: - ref: ${{ inputs.tag }} - - - name: Install uv - uses: astral-sh/setup-uv@v7 - - - name: Build package - run: uv build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 From de2f60ff5ee42c75702727d2624c6754b6be346a Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 21 Mar 2026 19:40:33 +0100 Subject: [PATCH 2/2] ci: rename release.yaml back to release.yml Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/{release.yaml => release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{release.yaml => release.yml} (100%) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release.yaml rename to .github/workflows/release.yml