From 889b156e24f238f46afa2bae30e524ef74f91c53 Mon Sep 17 00:00:00 2001 From: Simone Ferretti Date: Sun, 14 Jul 2024 18:08:30 +0200 Subject: [PATCH] build: add release action --- .github/workflows/go.yml | 7 ++----- .github/workflows/release_build.yml | 32 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release_build.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ef031ff..0c7b796 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,7 +1,4 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go +name: Go build on: push: @@ -21,7 +18,7 @@ jobs: with: go-version: '1.22.5' - - name: Build + - name: build run: go build -o todocheck -v ./app/... # - name: Test diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml new file mode 100644 index 0000000..a63a856 --- /dev/null +++ b/.github/workflows/release_build.yml @@ -0,0 +1,32 @@ +name: Release Go project + +on: + push: + tags: + - "*" # trigger only if push new tag version + +jobs: + build: + name: Go Releaser Build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22.5' + id: go + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@master + with: + version: latest + args: release --rm-dist + workdir: ./app/ + env: + GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}