From aa649fdc3d1444f1572dde96cdb053be7f056dc3 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 13:59:42 +0100 Subject: [PATCH 1/3] Build and attach {amd,arm}64 binaries to releases --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f66816ef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: "Build and attach binary to release" +on: + release: + types: ["created"] +permissions: + contents: write # to upload the binaries to the release +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: ["amd64", "arm64"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + - run: mkdir build + - run: go build ./cmd/syncv3 -o build/syncv3_linux_${{ matrix.arch }} + env: + GOARCH: ${{ matrix.arch }} + - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 + with: + files: build/syncv3_linux_${{ matrix.arch }} + fail_on_unmatched_files: true \ No newline at end of file From 733ebed06835e38339f81af656933810ff86615b Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 14:09:49 +0100 Subject: [PATCH 2/3] -o goes before packages --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f66816ef..f2928510 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: with: go-version: "1.20" - run: mkdir build - - run: go build ./cmd/syncv3 -o build/syncv3_linux_${{ matrix.arch }} + - run: go build -o build/syncv3_linux_${{ matrix.arch }} ./cmd/syncv3 env: GOARCH: ${{ matrix.arch }} - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 From 62cf2a71c09af8d173840acfbc77dd268b9ef8a1 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 14:40:27 +0100 Subject: [PATCH 3/3] Explicitly specify GOOS --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2928510..7f024842 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + os: ["linux"] arch: ["amd64", "arm64"] steps: - uses: actions/checkout@v4 @@ -18,6 +19,7 @@ jobs: - run: mkdir build - run: go build -o build/syncv3_linux_${{ matrix.arch }} ./cmd/syncv3 env: + GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 with: