improve contextualize prompt: add PR summary comment and manual chang… #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: [main] | |
| jobs: | |
| release: | |
| if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'sync/skills-') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Determine bump type | |
| id: bump | |
| run: | | |
| LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}' | |
| if echo "$LABELS" | grep -q 'bump:major'; then | |
| echo "type=major" >> $GITHUB_OUTPUT | |
| elif echo "$LABELS" | grep -q 'bump:minor'; then | |
| echo "type=minor" >> $GITHUB_OUTPUT | |
| else | |
| echo "type=patch" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Bump version | |
| id: version | |
| run: | | |
| CURRENT=$(jq -r '.version' .claude-plugin/plugin.json) | |
| MAJOR=$(echo $CURRENT | cut -d. -f1) | |
| MINOR=$(echo $CURRENT | cut -d. -f2) | |
| PATCH=$(echo $CURRENT | cut -d. -f3) | |
| BUMP_TYPE="${{ steps.bump.outputs.type }}" | |
| if [ "$BUMP_TYPE" = "major" ]; then | |
| NEW_VERSION="$((MAJOR+1)).0.0" | |
| elif [ "$BUMP_TYPE" = "minor" ]; then | |
| NEW_VERSION="${MAJOR}.$((MINOR+1)).0" | |
| else | |
| NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH+1))" | |
| fi | |
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| jq --arg v "$NEW_VERSION" '.version = $v' .claude-plugin/plugin.json > tmp.json && mv tmp.json .claude-plugin/plugin.json | |
| - name: Commit and tag | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git rm -r --ignore-unmatch test-marketplace | |
| git add .claude-plugin/plugin.json | |
| git commit -m "release: bump version to v${{ steps.version.outputs.new_version }}" | |
| git tag "v${{ steps.version.outputs.new_version }}" | |
| git push origin main | |
| git push origin "v${{ steps.version.outputs.new_version }}" | |
| - name: Create GitHub release | |
| run: | | |
| gh release create "v${{ steps.version.outputs.new_version }}" \ | |
| --title "Release v${{ steps.version.outputs.new_version }}" \ | |
| --generate-notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} |