-
Notifications
You must be signed in to change notification settings - Fork 28
60 lines (50 loc) · 1.96 KB
/
release-pr.yml
File metadata and controls
60 lines (50 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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@v5
- name: Release Please
id: release
uses: googleapis/release-please-action@v5
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 '\"')\",/" \
-e "s/rust-mcp-extra = { version = \"[^\"]*\",/rust-mcp-extra = { version = \"$(grep '^version = ' crates/rust-mcp-extra/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