@@ -136,77 +136,22 @@ jobs:
136136 git add packages/mcp/CHANGELOG.md packages/mcp/package.json
137137 git commit -m "Release @sourcebot/mcp v$VERSION"
138138
139- - name : Push to temporary branch
140- id : push_temp_branch
141- env :
142- GH_TOKEN : ${{ steps.generate_token.outputs.token }}
143- run : |
144- TEMP_BRANCH="release-mcp-v$VERSION"
145- git push origin HEAD:refs/heads/$TEMP_BRANCH
146- echo "Pushed commit to temporary branch: $TEMP_BRANCH"
147- echo "temp_branch=$TEMP_BRANCH" >> $GITHUB_OUTPUT
148-
149139 - name : Install dependencies
150140 run : yarn install --frozen-lockfile
151141
152142 - name : Build MCP package
153143 run : yarn workspace @sourcebot/mcp build
154144
155145 - name : Publish to npm
146+ env :
147+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
156148 run : |
157149 cd packages/mcp
158150 npm publish --provenance --access public
159151
160- - name : Checkout temporary branch
161- env :
162- TEMP_BRANCH : ${{ steps.push_temp_branch.outputs.temp_branch }}
163- run : |
164- git checkout "$TEMP_BRANCH"
165-
166- - name : Fast-forward main to temporary branch
167- env :
168- GH_TOKEN : ${{ steps.generate_token.outputs.token }}
169- TEMP_BRANCH : ${{ steps.push_temp_branch.outputs.temp_branch }}
170- run : |
171- # Fetch main branch
172- git fetch origin main:main
173- git checkout main
174-
175- # Check if fast-forward is possible
176- if ! git merge-base --is-ancestor main "$TEMP_BRANCH"; then
177- echo "❌ ERROR: Cannot fast-forward main branch to release commit"
178- echo ""
179- echo "This means new commits were pushed to main after the release process started."
180- echo ""
181- echo "Recent commits on main that caused the conflict:"
182- git log --oneline $TEMP_BRANCH..main | head -5
183- exit 1
184- fi
185-
186- # Fast-forward main to release commit
187- git merge --ff-only "$TEMP_BRANCH"
188-
189- echo "✓ Successfully fast-forwarded main to release commit"
190-
191152 - name : Push main
192153 env :
193154 GH_TOKEN : ${{ steps.generate_token.outputs.token }}
194155 run : |
195156 git push origin main
196- echo "Pushed main branch"
197-
198- - name : Delete temporary branch
199- if : always()
200- env :
201- GH_TOKEN : ${{ steps.generate_token.outputs.token }}
202- TEMP_BRANCH : ${{ steps.push_temp_branch.outputs.temp_branch }}
203- run : |
204- if [ -n "$TEMP_BRANCH" ]; then
205- # Check if branch exists before attempting to delete
206- if git ls-remote --heads origin "$TEMP_BRANCH" | grep -q "$TEMP_BRANCH"; then
207- git push origin --delete "$TEMP_BRANCH"
208- echo "✓ Deleted temporary branch: $TEMP_BRANCH"
209- else
210- echo "ℹ Temporary branch $TEMP_BRANCH does not exist (may have been already deleted)"
211- fi
212- fi
157+ echo "✓ Pushed release commit to main"
0 commit comments