diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..d319ca7 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,28 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +builds: +- env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + ldflags: + - -X "{{ .Env.IMPORTPATH }}/meta.semVersion={{ .Tag }}" -X "{{ .Env.IMPORTPATH }}/meta.version={{ .Env.VERSIONSHORT }}" -X "{{ .Env.IMPORTPATH }}/meta.versionLong={{ .Env.VERSIONLONG }}" -X "{{ .Env.IMPORTPATH }}/meta.commitMsg={{ .Env.COMMITMSG }}" +archives: + - id: zip + name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' + replacements: + linux: Linux + amd64: x86_64 + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6a0972e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +os: linux +dist: bionic +language: go +go: + - 1.14.4 + +install: true + +cache: + directories: + - $HOME/.cache/go-build + - $HOME/gopath/pkg/mod + +services: + - docker + +script: + - make + +deploy: + provider: script + skip_cleanup: true + script: ./scripts/deploy.sh + file: bin/voidwalker + on: + repo: lbryio/voidwalker + tags: true diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..cdf34fb --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +export IMPORTPATH="github.com/lbryio/voidwalker" +export VERSIONSHORT="${TRAVIS_COMMIT:-"$(git describe --tags --always --dirty)"}" +export VERSIONLONG="${TRAVIS_COMMIT:-"$(git describe --tags --always --dirty --long)"}" +export COMMITMSG="$(echo ${TRAVIS_COMMIT_MESSAGE:-"$(git show -s --format=%s)"} | tr -d '"' | head -n 1)" +curl -sL https://git.io/goreleaser | bash \ No newline at end of file diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..965d9a4 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +GO111MODULE=off go get github.com/caarlos0/svu +git tag `svu "$1"` +git push --tags