diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3420a42..cb7bc76 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ before_script: stages: - test + - build format: stage: test @@ -20,3 +21,17 @@ test: stage: test script: - make test + +build: + stage: build + only: + - main + - tags + script: + - git fetch --tags + - make build/snapshot + artifacts: + paths: + - dist/*.tar.gz + - dist/checksums.txt + expire_in: 1 day diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..8659855 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download + # you may remove this if you don't need go generate + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - "386" + - arm + - arm64 + goarm: + - "6" + - "7" + +archives: + - + files: + - LICENSE + - README.md + - CHANGELOG.md +checksum: + name_template: 'checksums.txt' +changelog: + skip: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..86a1f5e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# CHANGELOG + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. + +## [Unreleased] + +[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ +[Semantic Versioning]: https://semver.org/spec/v2.0.0.html diff --git a/Makefile b/Makefile index eb0886b..a303c74 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,9 @@ go-mod-tidy: format: go fmt $(go list ./... | grep -v /vendor/) go vet $(go list ./... | grep -v /vendor/) + +build/snapshot: + ./tools/goreleaser_linux_amd64 --snapshot --rm-dist --skip-publish + +build/release: + ./tools/goreleaser_linux_amd64 --rm-dist --skip-publish diff --git a/tools/goreleaser_linux_amd64 b/tools/goreleaser_linux_amd64 new file mode 100755 index 0000000..62a1e61 Binary files /dev/null and b/tools/goreleaser_linux_amd64 differ