mirror of
https://github.com/github/spec-kit
synced 2026-06-21 13:51:39 +00:00
f61c0cea7d
- Use actions/setup-python (pinned v6, Python 3.13) instead of uv python install for deterministic builds - Use python instead of python3 for setup-python compatibility - Remove unsupported --trusted-publishing always flag from uv publish (OIDC is auto-detected with id-token: write) - Update README install to lead with PyPI, source as fallback - Update installation guide: replace PyPI disclaimer with official package note, add PyPI as primary install method - Release notes: pin to exact version, clarify PyPI timing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
99 lines
3.1 KiB
YAML
99 lines
3.1 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
echo "tag=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Building release for $VERSION"
|
|
|
|
- name: Check if release already exists
|
|
id: check_release
|
|
run: |
|
|
VERSION="${{ steps.version.outputs.tag }}"
|
|
if gh release view "$VERSION" >/dev/null 2>&1; then
|
|
echo "exists=true" >> $GITHUB_OUTPUT
|
|
echo "Release $VERSION already exists, skipping..."
|
|
else
|
|
echo "exists=false" >> $GITHUB_OUTPUT
|
|
echo "Release $VERSION does not exist, proceeding..."
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Generate release notes
|
|
if: steps.check_release.outputs.exists == 'false'
|
|
run: |
|
|
VERSION="${{ steps.version.outputs.tag }}"
|
|
VERSION_NO_V=${VERSION#v}
|
|
|
|
# Find previous tag
|
|
PREVIOUS_TAG=$(git tag -l 'v*' --sort=-version:refname | grep -v "^${VERSION}$" | head -n 1)
|
|
if [ -z "$PREVIOUS_TAG" ]; then
|
|
PREVIOUS_TAG=""
|
|
fi
|
|
|
|
# Get commits since previous tag
|
|
if [ -z "$PREVIOUS_TAG" ]; then
|
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
|
if [ "$COMMIT_COUNT" -gt 20 ]; then
|
|
COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges HEAD~20..HEAD)
|
|
else
|
|
COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges)
|
|
fi
|
|
else
|
|
COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges "$PREVIOUS_TAG"..HEAD)
|
|
fi
|
|
|
|
cat > release_notes.md << NOTES_EOF
|
|
## Install
|
|
|
|
From [PyPI](https://pypi.org/project/specify-cli/):
|
|
|
|
\`\`\`bash
|
|
uv tool install specify-cli==${VERSION_NO_V}
|
|
specify init my-project
|
|
\`\`\`
|
|
|
|
Or install from source:
|
|
|
|
\`\`\`bash
|
|
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@${VERSION}
|
|
\`\`\`
|
|
|
|
> **Note:** The PyPI package is published after this GitHub release. If the version is not yet available on PyPI, use the source install above.
|
|
|
|
NOTES_EOF
|
|
|
|
echo "## What's Changed" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "$COMMITS" >> release_notes.md
|
|
|
|
- name: Create GitHub Release
|
|
if: steps.check_release.outputs.exists == 'false'
|
|
run: |
|
|
VERSION="${{ steps.version.outputs.tag }}"
|
|
VERSION_NO_V=${VERSION#v}
|
|
gh release create "$VERSION" \
|
|
--title "Spec Kit - $VERSION_NO_V" \
|
|
--notes-file release_notes.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|