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/