Some checks failed
Release / Build & Release (push) Has been cancelled
Comprehensive release containing structural, UX, and behavioral upgrades since v0.1.0: 1. Namespace Transition: Renamed core executable and project namespaces from 'smart-monitor' to 'smart-shutdown'. 2. Objective Vocabulary Refactoring: Normalized output strings and logging descriptors system-wide to a strict, professional tone. 3. Advanced Status Query: 'status' subcommand now retrieves the parsed configuration, log locations/sizes, and tails the last 10 lines of the local log file. 4. Runtime Configuration Setter: Introduced 'config set' subcommand to modify the configuration file with strict type validations. 5. Auto-System Deployment: Remapped 'install' to clone the executable into system domains and register global PATH variables. 6. Cleaner Removal: 'uninstall' purges binary clones and clears environmental variables, leaving zero traces. 7. Documentation Rewrite: Generated an objective README file featuring copy-paste ready Markdown blocks.
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # 当推送标签形如 v1.0.0 时触发自动构建
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & Release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.21'
|
|
cache: true
|
|
|
|
- name: Download Dependencies
|
|
run: go mod download
|
|
|
|
- name: Compile Cross-Platform Binaries
|
|
run: |
|
|
mkdir -p build_output
|
|
|
|
echo "Building Windows amd64..."
|
|
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o build_output/smart-shutdown_windows_amd64.exe ./cmd/smart-shutdown
|
|
|
|
echo "Building Windows arm64..."
|
|
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o build_output/smart-shutdown_windows_arm64.exe ./cmd/smart-shutdown
|
|
|
|
echo "Building Linux amd64..."
|
|
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o build_output/smart-shutdown_linux_amd64 ./cmd/smart-shutdown
|
|
|
|
echo "Building Linux arm64..."
|
|
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o build_output/smart-shutdown_linux_arm64 ./cmd/smart-shutdown
|
|
|
|
- name: Publish GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: build_output/*
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|