Skip to content

0.2.0

0.2.0 #9

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: publish-binaries
on:
release:
types:
- released
jobs:
build:
if: github.repository == 'apache/skywalking-mcp'
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.25
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
VERSION: ${{ github.event.release.tag_name }}
GIT_COMMIT: ${{ github.sha }}
run: |
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
go build \
-ldflags "-X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X main.date=${BUILD_DATE}" \
-o bin/swmcp \
cmd/skywalking-mcp/main.go
- name: Create archive
env:
VERSION: ${{ github.event.release.tag_name }}
run: |
tar -czf swmcp-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C bin swmcp
- name: Upload release asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.event.release.tag_name }}
run: gh release upload "${VERSION}" swmcp-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz