2024-03-14 15:14:30 +08:00
|
|
|
name: Release
|
2024-01-21 02:42:14 +08:00
|
|
|
on:
|
|
|
|
release:
|
2024-02-27 02:49:19 +08:00
|
|
|
types: [published]
|
2024-01-21 02:42:14 +08:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
releases-matrix:
|
|
|
|
name: Release Go Binary
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-02-27 02:49:19 +08:00
|
|
|
goos: [linux]
|
|
|
|
goarch: ["386", amd64, arm64]
|
2024-04-02 11:54:24 +08:00
|
|
|
|
2024-01-21 02:42:14 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-04-02 11:54:24 +08:00
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: "1.22"
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
GOOS: ${{ matrix.goos }}
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
2024-05-08 14:44:00 +08:00
|
|
|
CGO_ENABLED: 0
|
2024-04-02 11:54:24 +08:00
|
|
|
run: |
|
|
|
|
mkdir -p build
|
|
|
|
go build -o build/OpenGFW-${GOOS}-${GOARCH} -ldflags "-s -w" .
|
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: softprops/action-gh-release@v2
|
2024-01-21 02:42:14 +08:00
|
|
|
with:
|
2024-04-02 11:54:24 +08:00
|
|
|
files: build/*
|