Skip to content

Commit b4c2954

Browse files
alexhancockbug-ops
authored andcommitted
feat: set up release-plz integration for publishing to crates.io (modelcontextprotocol#297)
1 parent 0610027 commit b4c2954

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/release-plz.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
14+
# Release unpublished packages.
15+
release-plz-release:
16+
name: Release-plz release
17+
runs-on: ubuntu-latest
18+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
19+
permissions:
20+
contents: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Install Rust toolchain
27+
uses: dtolnay/rust-toolchain@stable
28+
- name: Run release-plz
29+
uses: release-plz/[email protected]
30+
with:
31+
command: release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35+
36+
# Create a PR with the new versions and changelog, preparing the next release.
37+
release-plz-pr:
38+
name: Release-plz PR
39+
runs-on: ubuntu-latest
40+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
concurrency:
45+
group: release-plz-${{ github.ref }}
46+
cancel-in-progress: false
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
- name: Install Rust toolchain
53+
uses: dtolnay/rust-toolchain@stable
54+
- name: Run release-plz
55+
uses: release-plz/[email protected]
56+
with:
57+
command: release-pr
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)