Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]
workflow_dispatch: # Manual trigger
workflow_run:
workflows: ["Release (Manual)", "Release Please"]
workflows: ["Publish"]
types: [completed]

permissions:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish

on:
push:
tags: ["v*"]
workflow_call:
inputs:
tag:
required: true
type: string

permissions:
contents: write
id-token: write
attestations: write

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
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build
run: uv build

- uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Create GitHub Release
if: github.event_name == 'push'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Create GitHub Release
run: |
if [[ "$TAG" == *-* ]]; then
gh release create "$TAG" --generate-notes --prerelease
else
gh release create "$TAG" --generate-notes
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
43 changes: 0 additions & 43 deletions .github/workflows/publish.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/release-please.yml

This file was deleted.

20 changes: 5 additions & 15 deletions .github/workflows/release.yml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ 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
Expand All @@ -35,17 +25,17 @@ jobs:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ steps.app-token.outputs.token }}
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:
needs: [release-please]
needs: release-please
if: needs.release-please.outputs.release_created
permissions:
id-token: write
uses: ./.github/workflows/publish.yml
contents: write
attestations: write
uses: ./.github/workflows/publish.yaml
with:
tag: ${{ needs.release-please.outputs.tag_name }}