Skip to content

Commit

Permalink
21 - build.sh migration to goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufcanb committed Apr 12, 2024
1 parent ee75ce6 commit 4857b55
Showing 1 changed file with 17 additions and 41 deletions.
58 changes: 17 additions & 41 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,22 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

# goreleaser.yaml
project_name: tlm
release:
github:
owner: yusufcanb
name: tlm
builds:
- env:
- CGO_ENABLED=0
- id: "tlm"
main: ./main.go
binary: tlm
goos:
- darwin
- linux
- windows
- darwin

goarch:
- amd64
- arm64
ldflags:
- -X main.sha1ver={{.ShortCommit}}
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- format: binary
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

0 comments on commit 4857b55

Please sign in to comment.