From af14adf313889d0e6ca7606d22cec6dd2bdd1cdf Mon Sep 17 00:00:00 2001 From: Toby Date: Mon, 1 Apr 2024 20:54:24 -0700 Subject: [PATCH] ci: rework release workflow --- .github/workflows/release.yaml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b775d32..0da1054 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,13 +15,25 @@ jobs: matrix: goos: [linux] goarch: ["386", amd64, arm64] + steps: - uses: actions/checkout@v4 - - uses: wangyoucao577/go-release-action@v1 + + - name: Setup Go + uses: actions/setup-go@v5 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - goversion: "https://go.dev/dl/go1.22.0.linux-amd64.tar.gz" - binary_name: "OpenGFW" - extra_files: LICENSE README.md README.zh.md + go-version: "1.22" + + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + CGO_ENABLED: 0 + run: | + mkdir -p build + go build -o build/OpenGFW-${GOOS}-${GOARCH} -ldflags "-s -w" . + + - name: Upload + uses: softprops/action-gh-release@v2 + with: + files: build/*