From fffc5a9a9554a2e5bacb3a1a7852b00deafaa829 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Thu, 17 Mar 2022 21:24:36 +0800 Subject: [PATCH] Update wireguard-go.yml --- .github/workflows/wireguard-go.yml | 43 ++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wireguard-go.yml b/.github/workflows/wireguard-go.yml index b394bb4..6ba4d88 100644 --- a/.github/workflows/wireguard-go.yml +++ b/.github/workflows/wireguard-go.yml @@ -3,30 +3,45 @@ name: Build Wireguard-go on: workflow_dispatch: +permissions: + contents: write + jobs: - releases-matrix: - name: Release Go Binary + goreleaser: runs-on: ubuntu-latest strategy: matrix: # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64 goos: [linux] goarch: [amd64, arm64] - - steps: - - uses: actions/checkout@v2 - - name: Setting up Go + + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Fetch all tags + run: git fetch --force --tags + - + name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - project_path: "./cmd/test-binary" - binary_name: "test-binary" - - - name: Building wireguard-go + go-version: 1.18 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'gorelea + run: | - mkdir -p /opt/release/ git clone https://git.zx2c4.com/wireguard-go cd wireguard-go go build -o wirguard-go /opt/release/