mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-04 21:53:08 +08:00
Adds GitHub Actions workflows for CI, maintenance, and releases with multi-platform testing matrix.
60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
name: Reusable Release Workflow
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: 'Version tag (e.g., v1.0.0)'
|
|
required: true
|
|
type: string
|
|
generate-notes:
|
|
description: 'Auto-generate release notes'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Validate version tag
|
|
run: |
|
|
if ! [[ "${{ inputs.tag }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Invalid version tag format. Expected vX.Y.Z"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Generate changelog
|
|
id: changelog
|
|
run: |
|
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
if [ -z "$PREV_TAG" ]; then
|
|
COMMITS=$(git log --pretty=format:"- %s" HEAD)
|
|
else
|
|
COMMITS=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD)
|
|
fi
|
|
# Use unique delimiter to prevent truncation if commit messages contain EOF
|
|
DELIMITER="COMMITS_END_$(date +%s)"
|
|
echo "commits<<${DELIMITER}" >> $GITHUB_OUTPUT
|
|
echo "$COMMITS" >> $GITHUB_OUTPUT
|
|
echo "${DELIMITER}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ inputs.tag }}
|
|
body: |
|
|
## Changes
|
|
${{ steps.changelog.outputs.commits }}
|
|
generate_release_notes: ${{ inputs.generate-notes }}
|