From b730e58985729aa65018a211311cc4fd2d4176a8 Mon Sep 17 00:00:00 2001 From: Eyal Mor <9406299+eyalmor-ent@users.noreply.github.com> Date: Sun, 27 Nov 2022 13:38:25 +0200 Subject: [PATCH] Create release.yml (#7) * Create release.yml * Make the actions work correctly. Co-authored-by: Eyal Mor --- .github/workflows/go.yml | 2 +- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ .goreleaser.yml | 5 ----- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index db44400..c966d27 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: Go +name: Test on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ca53aa9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + release: + types: + - "published" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Build + run: make setup + + - name: Test + run: go test -v ./... + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 6cc8b32..f492e0f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,17 +11,12 @@ builds: - CGO_ENABLED=0 goos: - linux - - windows - darwin - ignore: - - goos: windows - goarch: arm64 archives: - replacements: darwin: Darwin linux: Linux - windows: Windows 386: i386 amd64: x86_64