chore: release main (#33) #50
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: ReleasePR | |
permissions: | |
pull-requests: write | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
# if: github.event.head_commit.committer.name != 'GitHub' | |
# needs: ci | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Release Please | |
id: release | |
uses: googleapis/release-please-action@v4 | |
env: | |
ACTIONS_STEP_DEBUG: true | |
with: | |
token: ${{ secrets.RP_SECRET }} | |
config-file: .release-config.json | |
manifest-file: .release-manifest.json | |
- name: Parse release-please head branch | |
if: ${{ steps.release.outputs.prs_created }} | |
run: | | |
BRANCH=$(echo '${{ steps.release.outputs.pr }}' | jq -r '.headBranchName') | |
echo "BRANCH=$BRANCH" >> $GITHUB_ENV | |
- name: Update Cargo.toml | |
if: ${{ steps.release.outputs.prs_created }} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git fetch | |
git checkout $BRANCH | |
echo "Updating root Cargo.toml" | |
sed -i -e "s/rust-mcp-macros = { version = \"[^\"]*\",/rust-mcp-macros = { version = \"$(grep '^version = ' crates/rust-mcp-macros/Cargo.toml | cut -d' ' -f3 | tr -d '\"')\",/" \ | |
-e "s/rust-mcp-transport = { version = \"[^\"]*\",/rust-mcp-transport = { version = \"$(grep '^version = ' crates/rust-mcp-transport/Cargo.toml | cut -d' ' -f3 | tr -d '\"')\",/" \ | |
Cargo.toml | |
git add ./Cargo.toml | |
if ! git diff --cached --quiet; then | |
git commit -m "chore: update Cargo.toml for release" | |
git push | |
fi |