-
Notifications
You must be signed in to change notification settings - Fork 3
202 lines (177 loc) · 6.63 KB
/
Copy pathrelease.yml
File metadata and controls
202 lines (177 loc) · 6.63 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Release
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Release (${{ matrix.target }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
contents: read
actions: write # For uploading artifacts
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cli_artifact: mcp-execution-cli
server_artifact: mcp-execution
asset_suffix: linux-amd64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
cli_artifact: mcp-execution-cli
server_artifact: mcp-execution
asset_suffix: linux-arm64
- os: macos-latest
target: x86_64-apple-darwin
cli_artifact: mcp-execution-cli
server_artifact: mcp-execution
asset_suffix: macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
cli_artifact: mcp-execution-cli
server_artifact: mcp-execution
asset_suffix: macos-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
cli_artifact: mcp-execution-cli.exe
server_artifact: mcp-execution.exe
asset_suffix: windows-amd64
- os: windows-latest
target: aarch64-pc-windows-msvc
cli_artifact: mcp-execution-cli.exe
server_artifact: mcp-execution.exe
asset_suffix: windows-arm64
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
# Install cross-compilation tools for ARM Linux
- name: Install cross-compilation tools (ARM Linux)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "release-${{ matrix.target }}"
- name: Build release (CLI)
run: cargo build --release --target ${{ matrix.target }} --package mcp-execution-cli
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Build release (MCP Server)
run: cargo build --release --target ${{ matrix.target }} --package mcp-execution-server
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Strip binaries (Unix)
if: matrix.os != 'windows-latest'
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.cli_artifact }}
aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.server_artifact }}
else
strip target/${{ matrix.target }}/release/${{ matrix.cli_artifact }}
strip target/${{ matrix.target }}/release/${{ matrix.server_artifact }}
fi
- name: Package binaries (Unix)
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../mcp-execution-cli-${{ matrix.asset_suffix }}.tar.gz ${{ matrix.cli_artifact }}
tar czf ../../../mcp-execution-${{ matrix.asset_suffix }}.tar.gz ${{ matrix.server_artifact }}
- name: Package binaries (Windows)
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
7z a ../../../mcp-execution-cli-${{ matrix.asset_suffix }}.zip ${{ matrix.cli_artifact }}
7z a ../../../mcp-execution-${{ matrix.asset_suffix }}.zip ${{ matrix.server_artifact }}
- name: Upload CLI artifact
uses: actions/upload-artifact@v7
with:
name: mcp-execution-cli-${{ matrix.asset_suffix }}
path: |
mcp-execution-cli-${{ matrix.asset_suffix }}.tar.gz
mcp-execution-cli-${{ matrix.asset_suffix }}.zip
retention-days: 7
- name: Upload MCP Server artifact
uses: actions/upload-artifact@v7
with:
name: mcp-execution-${{ matrix.asset_suffix }}
path: |
mcp-execution-${{ matrix.asset_suffix }}.tar.gz
mcp-execution-${{ matrix.asset_suffix }}.zip
retention-days: 7
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Generate changelog
id: changelog
run: |
echo "## Changes in this Release" > CHANGELOG.md
echo "" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s (%h)" >> CHANGELOG.md || echo "- Initial release" >> CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v3
with:
files: artifacts/**/*
body_path: CHANGELOG.md
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-crates:
name: Publish to crates.io
needs: release
runs-on: ubuntu-latest
permissions:
id-token: write # Required for trusted publishing (OIDC)
contents: read
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "release"
- name: Verify packages build
run: |
cargo build --release -p mcp-execution-core
cargo build --release -p mcp-execution-introspector
cargo build --release -p mcp-execution-codegen
cargo build --release -p mcp-execution-files
cargo build --release -p mcp-execution-skill
cargo build --release -p mcp-execution-server
cargo build --release -p mcp-execution-cli
- name: Run tests
run: cargo test --workspace
# Trusted Publishing (OIDC) - no manual token needed after initial setup
- name: Authenticate with crates.io
uses: rust-lang/crates-io-auth-action@v1
id: crates-io-auth
- name: Publish crates
uses: katyo/publish-crates@v2
with:
registry-token: ${{ steps.crates-io-auth.outputs.token }}
ignore-unpublished-changes: true
publish-delay: 5000