-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (117 loc) · 4.54 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (117 loc) · 4.54 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
name: Release
on:
release:
types: [created]
jobs:
build:
name: Build release binaries
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Build all targets in devcontainer
uses: devcontainers/ci@v0.3
with:
push: never
runCmd: |
set -e
# Install cross-compilation toolchain for linux-arm64
sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu
# Build linux-x64 (native)
cargo build --release --target x86_64-unknown-linux-gnu -p devcontainer-mcp
# Build linux-arm64 (cross-compile with correct linker)
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
cargo build --release --target aarch64-unknown-linux-gnu -p devcontainer-mcp
# Package as tarballs
tar czf devcontainer-mcp-linux-x64.tar.gz -C target/x86_64-unknown-linux-gnu/release devcontainer-mcp
tar czf devcontainer-mcp-linux-arm64.tar.gz -C target/aarch64-unknown-linux-gnu/release devcontainer-mcp
- name: Upload linux-x64
uses: softprops/action-gh-release@v3
with:
files: devcontainer-mcp-linux-x64.tar.gz
- name: Upload linux-arm64
uses: softprops/action-gh-release@v3
with:
files: devcontainer-mcp-linux-arm64.tar.gz
build-macos:
name: Build ${{ matrix.artifact }}
runs-on: macos-latest
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-apple-darwin
artifact: devcontainer-mcp-darwin-x64
- target: aarch64-apple-darwin
artifact: devcontainer-mcp-darwin-arm64
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }} -p devcontainer-mcp
- name: Package binary
run: |
tar czf ${{ matrix.artifact }}.tar.gz -C target/${{ matrix.target }}/release devcontainer-mcp
- name: Upload release asset
uses: softprops/action-gh-release@v3
with:
files: ${{ matrix.artifact }}.tar.gz
upload-install-script:
name: Upload install scripts
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Upload install.sh and install.ps1
uses: softprops/action-gh-release@v3
with:
files: |
install.sh
install.ps1
publish-mcp-registry:
name: Publish to MCP Registry
runs-on: ubuntu-latest
needs: [build, build-macos]
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Install mcp-publisher
run: |
curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" \
| tar xz mcp-publisher
- name: Authenticate to MCP Registry (OIDC)
run: ./mcp-publisher login github-oidc
- name: Patch server.json with version, URLs, and SHA-256 hashes
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
BASE="https://github.com/aniongithub/devcontainer-mcp/releases/download/${TAG}"
# Set top-level version
jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
# Download each platform artifact, compute SHA-256, patch identifier + hash
PLATFORMS=("linux-x64" "linux-arm64" "darwin-x64" "darwin-arm64")
for platform in "${PLATFORMS[@]}"; do
FILE="devcontainer-mcp-${platform}.tar.gz"
curl -fsSL --retry 5 --retry-delay 3 -o "$FILE" "${BASE}/${FILE}"
SHA="$(sha256sum "$FILE" | awk '{print $1}')"
URL="${BASE}/${FILE}"
jq --arg platform "$platform" --arg url "$URL" --arg sha "$SHA" \
'(.packages[] | select(.identifier | contains($platform))) |= (.identifier = $url | .fileSha256 = $sha)' \
server.json > server.tmp && mv server.tmp server.json
done
- name: Publish to MCP Registry
run: ./mcp-publisher publish