Skip to content

Commit

Permalink
goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Mar 1, 2024
1 parent c6342a5 commit 95a3933
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This is a goreleaser config file. Check the docs at https://goreleaser.com
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

project_name: mrpack-install

before:
hooks:
- go mod tidy
- go vet ./...
- go test -v ./...
- go generate ./...

builds:
- binary: '{{ .ProjectName }}'
env:
- CGO_ENABLED=0
tags:
- osusergo
- netgo
ldflags:
- '-s'
- '-w'
- '-X hub.lol/mrpack-install/buildinfo.version={{.Version}}'
- '-X hub.lol/mrpack-install/buildinfo.commit={{.Commit}}'
- '-X hub.lol/mrpack-install/buildinfo.date={{.Date}}'
goos:
- linux
- darwin
- windows
ignore:
- goos: linux
goarch: 386
- goos: windows
goarch: 386
- goos: windows
goarch: arm64
#no_unique_dist_dir: true

upx:
- enabled: true
goos: [ linux, windows ]
compress: best
lzma: true

archives:
- meta: false
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
files:
- LICENSE.txt

nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
maintainer: Florian Hübner <[email protected]>
description: |-
A cli application for installing
Minecraft servers and Modrinth modpacks.
homepage: https://github.com/nothub/mrpack-install
license: MIT
formats:
- apk
- deb
- rpm
- archlinux
bindir: /usr/local/bin
meta: false

changelog:
sort: asc

checksum:
name_template: "checksums.txt"
algorithm: sha256

release:
github:
owner: nats-io
name: nats-server
name_template: 'v{{.Version}}'
header: 'Release generated at commit: {{.Tag}}'
draft: true
replace_existing_draft: true
4 changes: 4 additions & 0 deletions buildinfo/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
"runtime/debug"
)

var version = "unknown"
var commit = "unknown"
var date = "unknown"

var name = "unknown"
var module = "unknown"

Expand Down

0 comments on commit 95a3933

Please sign in to comment.