Skip to content

Commit

Permalink
Preparing go releaser #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Nov 20, 2024
1 parent 4e30b82 commit 487a255
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: "0" # make sure we get all commits!

Expand All @@ -26,5 +26,20 @@ jobs:
uses: anothrNick/github-tag-action@1.52.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCHES: release
RELEASE_BRANCHES: main
WITH_V: true

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
id: go

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
before:
hooks:
- go mod download
builds:
- id: gobl.xinvoice
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/gobl.xinvoice
binary: gobl.xinvoice

archives:
- id: gobl.xinvoice
builds:
- gobl.xinvoice
format: tar.gz
name_template: "gobl.xinvoice_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: true

checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
release:
github:
owner: invopop
name: gobl.xinvoice
prerelease: auto

0 comments on commit 487a255

Please sign in to comment.