Skip to content

Commit 31e19a0

Browse files
milldrclaude
andauthored
fix: use semver-style tag for library docs release (#846)
Co-authored-by: Claude Haiku 4.5 <[email protected]>
1 parent 87d9d00 commit 31e19a0

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

.github/actions/build-website/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,21 @@ runs:
5959
run: |
6060
make init
6161
62-
# Download pre-built library docs from GitHub Release
63-
# The library-docs-generate.yml workflow must have run at least once
62+
# Download pre-built library docs from the latest GitHub Release
63+
# The generate-library.yml workflow must have run at least once
6464
- name: "Download Pre-built Library Docs"
6565
shell: bash
6666
env:
6767
GH_TOKEN: ${{ inputs.repo_access_token }}
6868
run: |
69-
echo "Downloading pre-built library docs from GitHub Release..."
70-
gh release download library-docs-latest \
69+
echo "Finding latest library-docs release..."
70+
LATEST_TAG=$(gh release list --repo ${{ github.repository }} --limit 50 | grep "library-docs-" | head -1 | awk '{print $1}')
71+
if [ -z "$LATEST_TAG" ]; then
72+
echo "Error: No library-docs release found. Run the 'Generate Library' workflow first."
73+
exit 1
74+
fi
75+
echo "Downloading from release: ${LATEST_TAG}"
76+
gh release download "${LATEST_TAG}" \
7177
--repo ${{ github.repository }} \
7278
--pattern "library-docs.tar.gz" \
7379
--dir /tmp

.github/workflows/generate-library.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,28 @@ jobs:
216216
docs/modules/library \
217217
docs/github-actions/library
218218
219-
- name: Delete Existing Release
219+
- name: Create Release
220220
env:
221221
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
222222
run: |
223-
gh release delete library-docs-latest --yes || true
224-
git push origin :refs/tags/library-docs-latest || true
223+
VERSION="0.0.$(date -u +'%Y%m%d%H%M%S')"
224+
gh release create "library-docs-${VERSION}" \
225+
--title "Library Docs ${VERSION}" \
226+
--notes "Pre-built library documentation for fast preview builds. Generated $(date -u +'%Y-%m-%d %H:%M:%S UTC')." \
227+
--latest \
228+
library-docs.tar.gz
225229
226-
- name: Create Release
230+
- name: Cleanup Old Releases
227231
env:
228232
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229233
run: |
230-
gh release create library-docs-latest \
231-
--title "Library Docs (Latest)" \
232-
--notes "Pre-built library documentation for fast preview builds. Generated $(date -u +'%Y-%m-%d %H:%M:%S UTC')." \
233-
--prerelease \
234-
library-docs.tar.gz
234+
echo "Cleaning up old library-docs releases (keeping last 5)..."
235+
gh release list --repo ${{ github.repository }} --limit 100 \
236+
| grep "library-docs-" \
237+
| tail -n +6 \
238+
| awk '{print $1}' \
239+
| while read tag; do
240+
echo "Deleting release: ${tag}"
241+
gh release delete "${tag}" --yes --cleanup-tag || true
242+
done
243+
echo "Cleanup complete"

0 commit comments

Comments
 (0)