feat: 添加对Darwin和FreeBSD的GPU及操作系统名称获取功能

This commit is contained in:
Akizon77
2025-06-29 20:24:05 +08:00
parent 8cd60d448a
commit e1f52b9b77
9 changed files with 230 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
name: Build and Attach Binaries to Release
name: Release Binaries
on:
release:
@@ -13,8 +13,15 @@ jobs:
strategy:
matrix:
goos: [windows, linux]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm
goos: [windows, linux, darwin, freebsd]
goarch: [amd64, arm64, 386, arm]
steps:
- name: Checkout code
@@ -35,6 +42,9 @@ jobs:
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
elif [ "${{ matrix.goos }}" = "darwin" ]; then
# macOS binaries typically do not have a file extension
true
fi
go build -trimpath -ldflags="-s -w -X github.com/komari-monitor/komari-agent/update.CurrentVersion=${VERSION}" -o $BINARY_NAME
@@ -45,6 +55,8 @@ jobs:
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
elif [ "${{ matrix.goos }}" = "darwin" ]; then
true
fi
gh release upload ${{ github.event.release.tag_name }} $BINARY_NAME --repo ${{ github.repository }}
shell: bash