Files
komari-agent/.github/workflows/release.yml
Akizon77 e34367de69 Refactor monitoring package: remove platform-specific files and consolidate OS detection and process counting logic
- Deleted os_windows.go and process_windows.go, replacing them with platform-agnostic implementations in unit directory.
- Removed Linux-specific process counting logic from process_linux.go and integrated it into unit.
- Consolidated uptime and OS name retrieval into unit files for better organization.
- Updated update mechanism to use global variables for current version and repository.
- Introduced command-line flags for configuration, including disabling auto-update and web SSH.
- Implemented WebSocket connection handling and terminal interaction for both Unix and Windows systems.
- Added basic info upload functionality to server package, enhancing monitoring capabilities.
2025-05-16 19:56:22 +08:00

51 lines
1.3 KiB
YAML

name: Build and Attach Binaries to Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-attach:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [windows, linux]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
VERSION: ${{ github.event.release.tag_name }}
run: |
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
go build -trimpath -ldflags="-s -w -X update.CurrentVersion=${VERSION}" -o $BINARY_NAME
- name: Upload binary to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
gh release upload ${{ github.event.release.tag_name }} $BINARY_NAME --repo ${{ github.repository }}
shell: bash