3636 runs-on : ${{ matrix.runner }}
3737
3838 steps :
39- - name : Checkout
40- uses : actions/checkout@v4
39+ - uses : actions/checkout@v4
4140
4241 - name : Determine version
4342 id : version
@@ -50,82 +49,26 @@ jobs:
5049 VERSION="${TAG#v}"
5150 echo "tag=$TAG" >> $GITHUB_OUTPUT
5251 echo "version=$VERSION" >> $GITHUB_OUTPUT
53- echo "Building MCPB bundle for $TAG (version $VERSION)"
5452
55- - name : Download release binary
53+ - name : Download binary from GoReleaser
5654 env :
5755 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5856 run : |
5957 TAG="${{ steps.version.outputs.tag }}"
6058 ARCHIVE="github-mcp-server_${{ matrix.goreleaser_os }}_${{ matrix.goreleaser_arch }}.tar.gz"
6159
62- echo "Downloading $ARCHIVE from release $TAG..."
6360 gh release download "$TAG" --pattern "$ARCHIVE" --dir /tmp
64-
65- # Extract the binary
66- mkdir -p /tmp/extracted
67- tar -xzf "/tmp/$ARCHIVE" -C /tmp/extracted
68-
69- echo "Extracted contents:"
70- ls -la /tmp/extracted
61+ mkdir -p bin
62+ tar -xzf "/tmp/$ARCHIVE" -C /tmp
63+ cp /tmp/github-mcp-server bin/
64+ chmod +x bin/github-mcp-server
7165
7266 - name : Update manifest version
7367 run : |
7468 VERSION="${{ steps.version.outputs.version }}"
7569 jq --arg v "$VERSION" '.version = $v' manifest.json > manifest.tmp.json
7670 mv manifest.tmp.json manifest.json
77- echo "Updated manifest.json:"
78- cat manifest.json
79-
80- - name : Create MCPB bundle
81- run : |
82- VERSION="${{ steps.version.outputs.version }}"
83- BUNDLE_NAME="nimblebraininc-github-${VERSION}-${{ matrix.os }}-${{ matrix.arch }}.mcpb"
84- BUNDLE_DIR="/tmp/mcpb-bundle"
85-
86- # Create bundle structure
87- mkdir -p "$BUNDLE_DIR/bin"
88-
89- # Copy manifest
90- cp manifest.json "$BUNDLE_DIR/"
91-
92- # Copy binary (it's in the root of the extracted archive)
93- cp /tmp/extracted/github-mcp-server "$BUNDLE_DIR/bin/"
94- chmod +x "$BUNDLE_DIR/bin/github-mcp-server"
95-
96- echo "Bundle contents:"
97- ls -la "$BUNDLE_DIR"
98- ls -la "$BUNDLE_DIR/bin"
99-
100- # Create the bundle (tar.gz)
101- cd "$BUNDLE_DIR"
102- tar -czvf "/tmp/$BUNDLE_NAME" .
103-
104- echo "Created bundle: /tmp/$BUNDLE_NAME"
105- ls -la "/tmp/$BUNDLE_NAME"
106-
107- # Calculate SHA256
108- if command -v sha256sum &> /dev/null; then
109- SHA256=$(sha256sum "/tmp/$BUNDLE_NAME" | cut -d' ' -f1)
110- else
111- SHA256=$(shasum -a 256 "/tmp/$BUNDLE_NAME" | cut -d' ' -f1)
112- fi
113- echo "SHA256: $SHA256"
114- echo "$SHA256" > "/tmp/${BUNDLE_NAME}.sha256"
115-
116- # Store for upload step
117- echo "bundle_name=$BUNDLE_NAME" >> $GITHUB_ENV
118- echo "bundle_path=/tmp/$BUNDLE_NAME" >> $GITHUB_ENV
119- echo "sha256_path=/tmp/${BUNDLE_NAME}.sha256" >> $GITHUB_ENV
120-
121- - name : Upload bundle to release
122- env :
123- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
124- run : |
125- TAG="${{ steps.version.outputs.tag }}"
126-
127- echo "Uploading ${{ env.bundle_name }} to release $TAG..."
128- gh release upload "$TAG" "${{ env.bundle_path }}" --clobber
129- gh release upload "$TAG" "${{ env.sha256_path }}" --clobber
13071
131- echo "Uploaded successfully!"
72+ - uses : NimbleBrainInc/mcpb-pack@v2
73+ with :
74+ output : " {name}-{version}-${{ matrix.os }}-${{ matrix.arch }}.mcpb"
0 commit comments