mirror of
https://github.com/acepanel/helper.git
synced 2026-02-04 05:31:49 +08:00
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goarch: [ amd64, arm64 ]
|
|
fail-fast: true
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
cache: true
|
|
go-version: 'stable'
|
|
- name: Install dependencies
|
|
run: go mod tidy
|
|
- name: Build ${{ matrix.goarch }}
|
|
env:
|
|
CGO_ENABLED: 0
|
|
GOOS: linux
|
|
GOARCH: ${{ matrix.goarch }}
|
|
run: |
|
|
LDFLAGS="-s -w --extldflags '-static'"
|
|
go build -trimpath -buildvcs=false -ldflags "${LDFLAGS}" -o helper-${{ matrix.goarch }} ./cmd/helper
|
|
- name: Compress ${{ matrix.goarch }}
|
|
run: |
|
|
upx --best --lzma helper-${{ matrix.goarch }}
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: helper-${{ matrix.goarch }}
|
|
path: |
|
|
helper-${{ matrix.goarch }}
|