mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](de0fac2e45...df4cb1c069)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: 6.0.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
89 lines
2.7 KiB
YAML
89 lines
2.7 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
|
|
|
|
\`\`\`bash
|
|
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@${VERSION}
|
|
specify init my-project
|
|
\`\`\`
|
|
|
|
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 }}
|