Skip to content

Commit

Permalink
[toru] setup goreleaser for building and packing binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetbbak committed Feb 14, 2024
1 parent 5a4d962 commit f6926f8
Showing 1 changed file with 139 additions and 0 deletions.
139 changes: 139 additions & 0 deletions .goreleaser.yaml
@@ -0,0 +1,139 @@
# 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 ./...

builds:
- binary: "toru"
id: "toru"
main: ./cmd/toru

env:
- CGO_ENABLED=0

goos:
- linux
- windows
- darwin
- android
goarch:
- amd64
- arm
- arm64

ignore:
- goos: windows
goarch: arm

- goos: windows
goarch: arm64
- goos: android
goarch: arm
goarm: 6

- goos: android
goarch: amd64
# - goos: android
# goarch: amd64
# goarm: v2

flags:
- -v

ldflags:
- -s -w -X main.version={{.Version}}

overrides:
# - goos: android
# goarch: amd64
# goarm: v1
# env:
# - CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc
- goos: android
goarch: amd64
goarm: v2
env:
- CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc
- goos: android
goarch: amd64
goarm: v3
env:
- CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc

# - goos: android
# goarch: arm
# goarm: 6
# env:
# - CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc

- goos: android
goarch: arm
goarm: 7
env:
- CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc

# - goos: android
# goarch: arm64
# goamd64: v1
# env:
# - CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc
- goos: android
goarch: arm64
goamd64: v2
env:
- CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc

- goos: android
goarch: arm64
goamd64: v3
env:
- CGO_ENABLED=1
# - CC=arm-linux-gnueabi-gcc

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:"

upx:
- enabled: true
compress: best
lzma: true
brute: true

0 comments on commit f6926f8

Please sign in to comment.