-
Notifications
You must be signed in to change notification settings - Fork 0
226 lines (178 loc) · 6.96 KB
/
Copy pathrelease.yml
File metadata and controls
226 lines (178 loc) · 6.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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Release
permissions:
contents: read
pull-requests: write
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux x86_64
# - target: x86_64-unknown-linux-gnu
# os: ubuntu-latest
# binary_name: vnt
# asset_name: mcptools-Linux-x86_64
# macOS x86_64 (Intel)
- target: x86_64-apple-darwin
os: macos-15
binary_name: mcptools
asset_name: mcptools-Darwin-x86_64
# macOS aarch64 (Apple Silicon)
- target: aarch64-apple-darwin
os: macos-15
binary_name: mcptools
asset_name: mcptools-Darwin-arm64
# Windows x86_64
# - target: x86_64-pc-windows-msvc
# os: windows-2025
# binary_name: vnt.exe
# asset_name: mcptools-Windows-x86_64.exe
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry and index
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-cargo-
- name: Cache target directory
uses: actions/cache@v4
with:
path: target/
key: ${{ runner.os }}-${{ matrix.target }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-target-
- name: Build binary
run: cargo build --release --target ${{ matrix.target }}
- name: Strip binary
run: strip target/${{ matrix.target }}/release/${{ matrix.binary_name }}
- name: Create asset
run: cp target/${{ matrix.target }}/release/${{ matrix.binary_name }} ${{ matrix.asset_name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
if-no-files-found: error
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -name "mcptools-*" -type f -exec cp {} release-assets/ \;
ls -la release-assets/
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "## Changes" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Get previous tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [[ -n "$PREVIOUS_TAG" ]]; then
echo "Changes since $PREVIOUS_TAG:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> $GITHUB_OUTPUT
else
echo "Initial release" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
git log --pretty=format:"- %s (%h)" >> $GITHUB_OUTPUT
fi
echo "" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
body: |
# mcptools ${{ steps.version.outputs.version }}
> **⚠️ Platform Compatibility Notice**
>
> This tool currently **only compiles on macOS**. Pre-built binaries are provided for both Intel and Apple Silicon Macs.
> Support for other platforms may be added in future releases.
## Installation
### Method 1: Install via Cargo (Recommended for macOS users with Rust)
```bash
cargo install --git https://github.com/cloudbridgeuy/mcptools
```
### Method 2: Download Pre-built Binaries
Download the pre-built binary for your Mac architecture from the assets below:
**For Intel Macs (x86_64):**
```bash
# Download and install
curl -L "https://github.com/cloudbridgeuy/mcptools/releases/download/${{ steps.version.outputs.version }}/mcptools-Darwin-x86_64" -o mcptools
chmod +x mcptools
sudo mv mcptools /usr/local/bin/
# Verify installation
mcptools --version
```
**For Apple Silicon Macs (ARM64):**
```bash
# Download and install
curl -L "https://github.com/cloudbridgeuy/mcptools/releases/download/${{ steps.version.outputs.version }}/mcptools-Darwin-arm64" -o mcptools
chmod +x mcptools
sudo mv mcptools /usr/local/bin/
# Verify installation
mcptools --version
```
**Automatic detection (one-liner):**
```bash
curl -L "https://github.com/cloudbridgeuy/mcptools/releases/download/${{ steps.version.outputs.version }}/mcptools-Darwin-$(uname -m | sed 's/x86_64/x86_64/;s/arm64/arm64/')" -o mcptools && chmod +x mcptools && sudo mv mcptools /usr/local/bin/
```
### Method 3: Download with GitHub CLI
If you have the GitHub CLI installed:
```bash
# For Intel Macs
gh release download ${{ steps.version.outputs.version }} -R cloudbridgeuy/mcptools -p "mcptools-Darwin-x86_64"
# For Apple Silicon Macs
gh release download ${{ steps.version.outputs.version }} -R cloudbridgeuy/mcptools -p "mcptools-Darwin-arm64"
# Make executable and move to PATH
chmod +x mcptools-Darwin-*
sudo mv mcptools-Darwin-* /usr/local/bin/mcptools
# Verify installation
mcptools --version
```
## Platform Support
- ✅ macOS Intel (x86_64)
- ✅ macOS Apple Silicon (ARM64)
- ❌ Linux (not currently supported)
- ❌ Windows (not currently supported)
${{ steps.changelog.outputs.changelog }}
files: release-assets/*
draft: false
prerelease: false
generate_release_notes: false