Skip to content
Merged
Changes from all commits
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
35 changes: 25 additions & 10 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to publish (e.g. v7.0.20260422)"
required: true
type: string

permissions:
contents: read
Expand All @@ -18,6 +24,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.1
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}

- name: Install uv
uses: astral-sh/setup-uv@cdfb2ee6dde255817c739680168ad81e184c4bfb # v4.0.0
Expand Down Expand Up @@ -52,7 +60,7 @@ jobs:
uv run --isolated --no-project --with dist/*.tar.gz python -c "import app; print('Source dist install successful')"

- name: Upload dist artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4.6.2
with:
name: dist
path: dist/
Expand All @@ -67,7 +75,7 @@ jobs:

steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist
path: dist/
Expand All @@ -76,27 +84,34 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1

release:
name: Create GitHub Release
name: Update GitHub Release
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write # required to create a release
contents: write # required to create/edit a release

steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.1
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}

- name: Download dist artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist
path: dist/

- name: Create GitHub Release
- name: Create or update GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
run: |
gh release create "${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--generate-notes \
dist/*
if gh release view "$TAG" > /dev/null 2>&1; then
gh release upload "$TAG" dist/* --clobber
else
gh release create "$TAG" \
--title "$TAG" \
--generate-notes \
dist/*
fi
Loading