Skip to content

Commit

Permalink
chore: configure goreleaser
Browse files Browse the repository at this point in the history
Configures goreleaser to build the binary
  • Loading branch information
tlkamp committed Oct 1, 2023
1 parent f369cde commit 74b867f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: GoReleaser
on:
push:
tags:
- '**'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: goreleaser/goreleaser-action@v2
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
workflow_run:
workflows:
- Test
branches:
- main
types:
- completed

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
- env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release semantic-release
11 changes: 6 additions & 5 deletions .github/test.yaml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.20
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: go test -v ./...
- run: go version
- run: go mod download
- run: go test -v ./...

golangci-lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,4 +55,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release \
semantic-release -d --branches ${GITHUB_REF##*/}
semantic-release -d --branches ${GITHUB_REF##*/}
19 changes: 19 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
binary: litterrobot
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^style:'

0 comments on commit 74b867f

Please sign in to comment.