Skip to content

Commit b608dcb

Browse files
committed
fix: update release workflow to use modern GitHub CLI and fix permissions
1 parent 0b5df9b commit b608dcb

File tree

2 files changed

+268
-54
lines changed

2 files changed

+268
-54
lines changed

.github/workflows/release.yml

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
tags:
1313
- 'v*.*.*' # Matches tags like v1.0.0, v2.1.3, etc.
1414

15+
# Set permissions for release creation and asset uploads
16+
permissions:
17+
contents: write # Required for creating releases and uploading assets
18+
packages: write # Required for publishing packages
19+
1520
# Define environment variables for the release process
1621
env:
1722
CARGO_TERM_COLOR: always
@@ -24,7 +29,6 @@ jobs:
2429
name: Create Release
2530
runs-on: ubuntu-latest
2631
outputs:
27-
upload_url: ${{ steps.create_release.outputs.upload_url }}
2832
release_version: ${{ env.RELEASE_VERSION }}
2933

3034
steps:
@@ -40,50 +44,54 @@ jobs:
4044
echo "Release version: ${GITHUB_REF#refs/tags/v}"
4145
4246
# Step 3: Create the GitHub release
43-
# This creates a draft release that will be published after artifacts are uploaded
47+
# Create a release note for later use by the upload action
4448
- name: Create Release
4549
id: create_release
46-
uses: actions/create-release@v1
50+
run: |
51+
# Create release using GitHub CLI
52+
cat > release_notes.md << 'EOF'
53+
## MCP Rust Examples Release ${{ env.RELEASE_VERSION }}
54+
55+
This release contains compiled binaries for the MCP Rust Examples tutorial project.
56+
57+
### Features
58+
- 20 comprehensive Rust examples demonstrating MCP (Model Context Protocol) usage
59+
- Cross-platform binaries for Linux, macOS, and Windows
60+
- Educational code with extensive documentation and comments
61+
62+
### Installation
63+
1. Download the appropriate binary for your platform
64+
2. Extract the archive
65+
3. Run the desired example binary
66+
67+
### Examples Included
68+
- Hello World and Calculator examples
69+
- Text processing and HTTP client examples
70+
- Database integration and streaming examples
71+
- Authentication and notification services
72+
- Data pipelines and search services
73+
- Blockchain integration and ML model server
74+
- Microservice gateway and enterprise server
75+
76+
### Usage
77+
Each example can be run independently:
78+
```bash
79+
./example_01_hello_world
80+
./example_02_calculator
81+
# ... and so on
82+
```
83+
84+
For more information, see the [README.md](README.md) in the repository.
85+
EOF
86+
87+
# Create release
88+
gh release create ${{ github.ref_name }} \
89+
--title "Release ${{ env.RELEASE_VERSION }}" \
90+
--notes-file release_notes.md \
91+
--draft=false \
92+
--prerelease=false
4793
env:
4894
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
with:
50-
tag_name: ${{ github.ref }}
51-
release_name: Release ${{ env.RELEASE_VERSION }}
52-
body: |
53-
## MCP Rust Examples Release ${{ env.RELEASE_VERSION }}
54-
55-
This release contains compiled binaries for the MCP Rust Examples tutorial project.
56-
57-
### Features
58-
- 20 comprehensive Rust examples demonstrating MCP (Model Context Protocol) usage
59-
- Cross-platform binaries for Linux, macOS, and Windows
60-
- Educational code with extensive documentation and comments
61-
62-
### Installation
63-
1. Download the appropriate binary for your platform
64-
2. Extract the archive
65-
3. Run the desired example binary
66-
67-
### Examples Included
68-
- Hello World and Calculator examples
69-
- Text processing and HTTP client examples
70-
- Database integration and streaming examples
71-
- Authentication and notification services
72-
- Data pipelines and search services
73-
- Blockchain integration and ML model server
74-
- Microservice gateway and enterprise server
75-
76-
### Usage
77-
Each example can be run independently:
78-
```bash
79-
./example_01_hello_world
80-
./example_02_calculator
81-
# ... and so on
82-
```
83-
84-
For more information, see the [README.md](README.md) in the repository.
85-
draft: false
86-
prerelease: false
8795

8896
# Job 2: Build binaries for multiple platforms
8997
build:
@@ -203,14 +211,13 @@ jobs:
203211

204212
# Step 8: Upload the archive as a release asset
205213
- name: Upload Release Asset
206-
uses: actions/upload-release-asset@v1
214+
run: |
215+
# Upload asset using GitHub CLI
216+
gh release upload ${{ github.ref_name }} \
217+
./${{ matrix.archive_name }}.${{ matrix.archive_extension }} \
218+
--clobber
207219
env:
208220
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
209-
with:
210-
upload_url: ${{ needs.create-release.outputs.upload_url }}
211-
asset_path: ./${{ matrix.archive_name }}.${{ matrix.archive_extension }}
212-
asset_name: ${{ matrix.archive_name }}.${{ matrix.archive_extension }}
213-
asset_content_type: ${{ matrix.archive_extension == 'zip' && 'application/zip' || 'application/gzip' }}
214221

215222
# Job 3: Publish to crates.io
216223
publish-crate:
@@ -288,11 +295,10 @@ jobs:
288295
289296
# Step 4: Upload checksums file
290297
- name: Upload checksums
291-
uses: actions/upload-release-asset@v1
298+
run: |
299+
# Upload checksums using GitHub CLI
300+
gh release upload ${{ github.ref_name }} \
301+
./checksums.txt \
302+
--clobber
292303
env:
293-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
294-
with:
295-
upload_url: ${{ needs.create-release.outputs.upload_url }}
296-
asset_path: ./checksums.txt
297-
asset_name: checksums.txt
298-
asset_content_type: text/plain
304+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

doc-output.log

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
 Updating crates.io index
2+
 Downloading crates ...
3+
 Downloaded nu-ansi-term v0.46.0
4+
 Downloaded foreign-types v0.3.2
5+
 Downloaded slab v0.4.9
6+
 Downloaded utf8_iter v1.0.4
7+
 Downloaded version_check v0.9.5
8+
 Downloaded yoke-derive v0.8.0
9+
 Downloaded uuid v1.17.0
10+
 Downloaded rustls v0.23.27
11+
 Downloaded sqlx-postgres v0.8.6
12+
 Downloaded sqlx-core v0.8.6
13+
 Downloaded ring v0.17.14
14+
 Downloaded syn v2.0.101
15+
 Downloaded typenum v1.18.0
16+
 Downloaded httparse v1.10.1
17+
 Downloaded vcpkg v0.2.15
18+
 Downloaded reqwest v0.11.27
19+
 Downloaded zeroize v1.8.1
20+
 Downloaded url v2.5.4
21+
 Downloaded sqlx v0.8.6
22+
 Downloaded idna v1.0.3
23+
 Downloaded hyper v0.14.32
24+
 Downloaded mio v1.0.4
25+
 Downloaded icu_locale_core v2.0.0
26+
 Downloaded icu_collections v2.0.0
27+
 Downloaded rand v0.8.5
28+
 Downloaded zerovec v0.11.2
29+
 Downloaded h2 v0.3.26
30+
 Downloaded futures-intrusive v0.5.0
31+
 Downloaded webpki-roots v1.0.0
32+
 Downloaded tokio v1.45.1
33+
 Downloaded serde v1.0.219
34+
 Downloaded icu_properties_data v2.0.1
35+
 Downloaded zerocopy v0.8.25
36+
 Downloaded flume v0.11.1
37+
 Downloaded openssl-sys v0.9.109
38+
 Downloaded base64 v0.21.7
39+
 Downloaded tracing-subscriber v0.3.19
40+
 Downloaded encoding_rs v0.8.35
41+
 Downloaded unicode-normalization v0.1.24
42+
 Downloaded tokio-util v0.7.15
43+
 Downloaded regex-syntax v0.8.5
44+
 Downloaded num-bigint-dig v0.8.4
45+
 Downloaded indexmap v2.9.0
46+
 Downloaded der v0.7.10
47+
 Downloaded chrono v0.4.41
48+
 Downloaded bytes v1.10.1
49+
 Downloaded zerofrom-derive v0.1.6
50+
 Downloaded zerofrom v0.1.6
51+
 Downloaded tracing v0.1.41
52+
 Downloaded regex v1.11.1
53+
 Downloaded libc v0.2.172
54+
 Downloaded futures-util v0.3.31
55+
 Downloaded cc v1.2.25
56+
 Downloaded base64 v0.22.1
57+
 Downloaded aho-corasick v1.1.3
58+
 Downloaded sqlx-mysql v0.8.6
59+
 Downloaded regex-automata v0.4.9
60+
 Downloaded openssl v0.10.73
61+
 Downloaded memchr v2.7.4
62+
 Downloaded libm v0.2.15
63+
 Downloaded icu_normalizer_data v2.0.0
64+
 Downloaded http v0.2.12
65+
 Downloaded hkdf v0.12.4
66+
 Downloaded generic-array v0.14.7
67+
 Downloaded form_urlencoded v1.2.1
68+
 Downloaded crypto-common v0.1.6
69+
 Downloaded concurrent-queue v2.5.0
70+
 Downloaded serde_json v1.0.140
71+
 Downloaded regex-syntax v0.6.29
72+
 Downloaded icu_provider v2.0.0
73+
 Downloaded iana-time-zone v0.1.63
74+
 Downloaded httpdate v1.0.3
75+
 Downloaded hmac v0.12.1
76+
 Downloaded getrandom v0.3.3
77+
 Downloaded hashbrown v0.15.3
78+
 Downloaded futures-task v0.3.31
79+
 Downloaded futures-sink v0.3.31
80+
 Downloaded futures-io v0.3.31
81+
 Downloaded futures-channel v0.3.31
82+
 Downloaded foreign-types-shared v0.1.1
83+
 Downloaded fnv v1.0.7
84+
 Downloaded equivalent v1.0.2
85+
 Downloaded either v1.15.0
86+
 Downloaded digest v0.10.7
87+
 Downloaded cfg-if v1.0.0
88+
 Downloaded byteorder v1.5.0
89+
 Downloaded block-buffer v0.10.4
90+
 Downloaded bitflags v2.9.1
91+
 Downloaded sqlx-sqlite v0.8.6
92+
 Downloaded rustls-webpki v0.103.3
93+
 Downloaded rsa v0.9.8
94+
 Downloaded openssl-macros v0.1.1
95+
 Downloaded num-integer v0.1.46
96+
 Downloaded matchers v0.1.0
97+
 Downloaded lock_api v0.4.13
98+
 Downloaded lazy_static v1.5.0
99+
 Downloaded itoa v1.0.15
100+
 Downloaded icu_properties v2.0.1
101+
 Downloaded home v0.5.11
102+
 Downloaded hex v0.4.3
103+
 Downloaded heck v0.5.0
104+
 Downloaded hashlink v0.10.0
105+
 Downloaded futures-macro v0.3.31
106+
 Downloaded regex-automata v0.1.10
107+
 Downloaded unicode-properties v0.1.3
108+
 Downloaded unicode-ident v1.0.18
109+
 Downloaded tracing-attributes v0.1.28
110+
 Downloaded tokio-native-tls v0.3.1
111+
 Downloaded tinystr v0.8.1
112+
 Downloaded thiserror-impl v2.0.12
113+
 Downloaded synstructure v0.13.2
114+
 Downloaded yoke v0.8.0
115+
 Downloaded writeable v0.6.1
116+
 Downloaded whoami v1.6.0
117+
 Downloaded webpki-roots v0.26.11
118+
 Downloaded want v0.3.1
119+
 Downloaded untrusted v0.9.0
120+
 Downloaded tower-service v0.3.3
121+
 Downloaded tokio-stream v0.1.17
122+
 Downloaded tokio-macros v2.5.0
123+
 Downloaded thiserror-impl v1.0.69
124+
 Downloaded thiserror v2.0.12
125+
 Downloaded thiserror v1.0.69
126+
 Downloaded subtle v2.6.1
127+
 Downloaded sqlx-macros-core v0.8.6
128+
 Downloaded sqlx-macros v0.8.6
129+
 Downloaded smallvec v1.15.0
130+
 Downloaded sha2 v0.10.9
131+
 Downloaded sha1 v0.10.6
132+
 Downloaded serde_urlencoded v0.7.1
133+
 Downloaded serde_derive v1.0.219
134+
 Downloaded quote v1.0.40
135+
 Downloaded pin-utils v0.1.0
136+
 Downloaded unicode-bidi v0.3.18
137+
 Downloaded try-lock v0.2.5
138+
 Downloaded tracing-core v0.1.33
139+
 Downloaded thread_local v1.1.8
140+
 Downloaded sync_wrapper v0.1.2
141+
 Downloaded stringprep v0.1.5
142+
 Downloaded spki v0.7.3
143+
 Downloaded spin v0.9.8
144+
 Downloaded socket2 v0.5.10
145+
 Downloaded signal-hook-registry v1.4.5
146+
 Downloaded shlex v1.3.0
147+
 Downloaded rand_core v0.6.4
148+
 Downloaded rand_chacha v0.3.1
149+
 Downloaded ppv-lite86 v0.2.21
150+
 Downloaded potential_utf v0.1.2
151+
 Downloaded pkg-config v0.3.32
152+
 Downloaded pkcs8 v0.10.2
153+
 Downloaded pkcs1 v0.7.5
154+
 Downloaded percent-encoding v2.3.1
155+
 Downloaded parking_lot_core v0.9.11
156+
 Downloaded zerotrie v0.2.2
157+
 Downloaded libsqlite3-sys v0.30.1
158+
 Downloaded zerovec-derive v0.11.1
159+
 Downloaded overload v0.1.1
160+
 Downloaded tracing-log v0.2.0
161+
 Downloaded tinyvec_macros v0.1.1
162+
 Downloaded tinyvec v1.9.0
163+
 Downloaded stable_deref_trait v1.2.0
164+
 Downloaded sharded-slab v0.1.7
165+
 Downloaded scopeguard v1.2.0
166+
 Downloaded ryu v1.0.20
167+
 Downloaded rustls-pki-types v1.12.0
168+
 Downloaded proc-macro2 v1.0.95
169+
 Downloaded parking_lot v0.12.4
170+
 Downloaded idna_adapter v1.2.1
171+
 Downloaded icu_normalizer v2.0.0
172+
 Downloaded getrandom v0.2.16
173+
 Downloaded futures-core v0.3.31
174+
 Downloaded event-listener v5.4.0
175+
 Downloaded displaydoc v0.2.5
176+
 Downloaded crossbeam-utils v0.8.21
177+
 Downloaded crossbeam-queue v0.3.12
178+
 Downloaded crc v3.3.0
179+
 Downloaded const-oid v0.9.6
180+
 Downloaded autocfg v1.4.0
181+
 Downloaded anyhow v1.0.98
182+
 Downloaded allocator-api2 v0.2.21
183+
 Downloaded signature v2.2.0
184+
 Downloaded rustls-pemfile v1.0.4
185+
 Downloaded pin-project-lite v0.2.16
186+
 Downloaded pem-rfc7468 v0.7.0
187+
 Downloaded parking v2.2.1
188+
 Downloaded openssl-probe v0.1.6
189+
 Downloaded once_cell v1.21.3
190+
 Downloaded num-traits v0.2.19
191+
 Downloaded num-iter v0.1.45
192+
 Downloaded native-tls v0.2.14
193+
 Downloaded mime v0.3.17
194+
 Downloaded md-5 v0.10.6
195+
 Downloaded log v0.4.27
196+
 Downloaded litemap v0.8.0
197+
 Downloaded ipnet v2.11.0
198+
 Downloaded hyper-tls v0.5.0
199+
 Downloaded http-body v0.4.6
200+
 Downloaded futures-executor v0.3.31
201+
 Downloaded futures v0.3.31
202+
 Downloaded foldhash v0.1.5
203+
 Downloaded dotenvy v0.15.7
204+
 Downloaded crc-catalog v2.4.0
205+
 Downloaded base64ct v1.7.3
206+
 Downloaded atoi v2.0.0
207+
 Downloaded cpufeatures v0.2.17
208+
 Blocking waiting for file lock on build directory

0 commit comments

Comments
 (0)