mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-07-03 03:56:29 +00:00
ci: call docs update workflow from release (#933)
- replace the docs update tag-push trigger with manual and reusable workflow entrypoints - call the docs update reusable workflow after publishing a release - keep manual docs updates available by selecting the latest semver tag Refs: pi-session 019f2352-565c-7f60-b96b-f2546fb1690f
This commit is contained in:
committed by
GitHub
parent
a5e9cbfd5f
commit
a1a7345c8e
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -111,3 +111,14 @@ jobs:
|
|||||||
|
|
||||||
echo "Publishing draft release $TAG"
|
echo "Publishing draft release $TAG"
|
||||||
gh release edit "$TAG" --draft=false
|
gh release edit "$TAG" --draft=false
|
||||||
|
|
||||||
|
update-docs:
|
||||||
|
name: Update docs
|
||||||
|
needs:
|
||||||
|
- release
|
||||||
|
uses: ./.github/workflows/update-docs.yml
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
with:
|
||||||
|
tag: v${{ inputs.version }}
|
||||||
|
|||||||
26
.github/workflows/update-docs.yml
vendored
26
.github/workflows/update-docs.yml
vendored
@@ -1,13 +1,18 @@
|
|||||||
name: "Update docs"
|
name: "Update docs"
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_call:
|
||||||
tags:
|
inputs:
|
||||||
- "v*.*.*"
|
tag:
|
||||||
|
description: "Release tag to update docs for (e.g., v8.2.0)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-docs:
|
update-docs:
|
||||||
|
continue-on-error: ${{ github.event_name == 'workflow_call' }}
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -15,14 +20,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: Get tag info
|
- name: Get tag info
|
||||||
id: tag-info
|
id: tag-info
|
||||||
run: |
|
run: |
|
||||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
if [ -n "$INPUT_TAG" ]; then
|
||||||
|
TAG_NAME="$INPUT_TAG"
|
||||||
|
else
|
||||||
|
TAG_NAME=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "::error::Tag must match vMAJOR.MINOR.PATCH (e.g., v8.2.0)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
COMMIT_SHA=$(git rev-list -n 1 "$TAG_NAME")
|
COMMIT_SHA=$(git rev-list -n 1 "$TAG_NAME")
|
||||||
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
|
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
|
||||||
echo "sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT"
|
echo "sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT"
|
||||||
|
env:
|
||||||
|
INPUT_TAG: ${{ inputs.tag }}
|
||||||
- name: Update references in docs
|
- name: Update references in docs
|
||||||
run: |
|
run: |
|
||||||
OLD_REF=$(grep -oh 'astral-sh/setup-uv@[a-f0-9]\{40\} # v[0-9][^ ]*' README.md docs/*.md | head -1)
|
OLD_REF=$(grep -oh 'astral-sh/setup-uv@[a-f0-9]\{40\} # v[0-9][^ ]*' README.md docs/*.md | head -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user