chore: add GitHub Actions release workflow, MIT license, and update gitignore
Some checks failed
Release / Build & Release (push) Has been cancelled
Some checks failed
Release / Build & Release (push) Has been cancelled
This commit is contained in:
53
.github/workflows/release.yml
vendored
Normal file
53
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
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-monitor_windows_amd64.exe ./cmd/smart-monitor
|
||||
|
||||
echo "Building Windows arm64..."
|
||||
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o build_output/smart-monitor_windows_arm64.exe ./cmd/smart-monitor
|
||||
|
||||
echo "Building Linux amd64..."
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o build_output/smart-monitor_linux_amd64 ./cmd/smart-monitor
|
||||
|
||||
echo "Building Linux arm64..."
|
||||
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o build_output/smart-monitor_linux_arm64 ./cmd/smart-monitor
|
||||
|
||||
- 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 }}
|
||||
27
.gitignore
vendored
Normal file
27
.gitignore
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output directory for cross-platform builds
|
||||
/bin/
|
||||
/build/
|
||||
smart-monitor
|
||||
smart-monitor.exe
|
||||
|
||||
# Output of the go coverage tool
|
||||
*.out
|
||||
|
||||
# IDE configs
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
# Local logs or configuration testing directories
|
||||
logs/
|
||||
*.log
|
||||
config.json
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 UnbalancedCat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Binary file not shown.
Reference in New Issue
Block a user