diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index e18307b..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,28 +0,0 @@ -# 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 - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.20.1 - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./... diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 18ae419..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# .github/workflows/release.yaml - -on: - release: - types: [created] - -jobs: - release-linux-amd64: - name: release linux/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: wangyoucao577/go-release-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: linux - goarch: amd64 diff --git a/.github/workflows/release_build.yaml b/.github/workflows/release_build.yaml new file mode 100644 index 0000000..65d7f70 --- /dev/null +++ b/.github/workflows/release_build.yaml @@ -0,0 +1,31 @@ +name: Release Go project + +on: + push: + tags: + - "*" # triggers only if push new tag version, like `0.8.4` or else + +jobs: + build: + name: GoReleaser build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + with: + fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ + + - name: Set up Go 1.20 + uses: actions/setup-go@v2 + with: + go-version: 1.20.1 + id: go + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@master + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}