3939 - name : Run release-it
4040 id : release
4141 run : |
42- # Run release-it with conventional commits
42+ # Run release-it to bump version, update changelog, commit, and tag
4343 if yarn release-it --ci; then
4444 echo "released=true" >> "$GITHUB_OUTPUT"
4545 # Get version from package.json (updated by release-it)
@@ -51,13 +51,25 @@ jobs:
5151 echo "released=false" >> "$GITHUB_OUTPUT"
5252 fi
5353
54+ - name : Create GitHub release
55+ if : steps.release.outputs.released == 'true'
56+ run : |
57+ gh release create "${{ steps.release.outputs.tag }}" \
58+ bin/worktree-switcher \
59+ --title "${{ steps.release.outputs.tag }}" \
60+ --generate-notes
61+
5462 update-homebrew :
5563 needs : release
5664 if : needs.release.outputs.released == 'true'
5765 runs-on : ubuntu-latest
5866 steps :
5967 - uses : actions/checkout@v4
6068
69+ - name : Get job context
70+ id : context
71+ uses : qoomon/actions--context@v4
72+
6173 - name : Authenticate as GitHub App
6274 id : auth
6375 uses : ./.github/actions/github-app-auth
@@ -121,16 +133,31 @@ jobs:
121133 sed -i 's/^ //' Formula/worktree-switcher.rb
122134
123135 - name : Create PR to update formula with auto-merge
136+ env :
137+ RELEASE_URL : https://github.com/${{ github.repository }}/releases/tag/${{ steps.release.outputs.tag }}
138+ JOB_URL : ${{ steps.context.outputs.job_html_url }}
139+ VERSION : ${{ steps.release.outputs.version }}
140+ TAG : ${{ steps.release.outputs.tag }}
124141 run : |
125142 cd homebrew-devsetup
126- BRANCH="bump-worktree-switcher-${{ steps.release.outputs.version } }"
143+ BRANCH="bump-worktree-switcher-${VERSION }"
127144 git checkout -b "$BRANCH"
128145 git add Formula/worktree-switcher.rb
129- git commit -m "chore: update worktree-switcher to ${{ steps.release.outputs.version } }"
146+ git commit -m "chore: update worktree-switcher to ${VERSION }"
130147 git push -u origin "$BRANCH"
148+
149+ # Create PR body file
150+ cat > /tmp/pr-body.md << 'BODY_EOF'
151+ Automated formula update from git-wt release
152+ BODY_EOF
153+ echo "" >> /tmp/pr-body.md
154+ echo "**Release:** ${RELEASE_URL}" >> /tmp/pr-body.md
155+ echo "**Workflow:** ${JOB_URL}" >> /tmp/pr-body.md
156+
131157 PR_URL=$(gh pr create \
132- --title "chore: update worktree-switcher to ${{ steps.release.outputs.version } }" \
133- --body "Automated formula update from git-wt release ${{ steps.release.outputs.tag }}" \
158+ --title "chore: update worktree-switcher to ${VERSION }" \
159+ --body-file /tmp/pr-body.md \
134160 --base main)
135161 # Enable auto-merge with squash
136162 gh pr merge "$PR_URL" --auto --squash
163+
0 commit comments