1
0
mirror of https://github.com/taigrr/shorturl synced 2025-01-18 04:03:16 -08:00

Add goreleaser config

This commit is contained in:
James Mills 2018-12-31 19:01:04 +10:00
parent fca6b94d77
commit 5b5c76551a
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
2 changed files with 21 additions and 43 deletions

21
.goreleaser.yml Normal file
View File

@ -0,0 +1,21 @@
builds:
- main: .
binary: shorturl
flags: -tags "static_build"
ldflags: -w -X shorturl.Version={{.Version}} -X shorturl.Commit={{.Commit}}
env:
- CGO_ENABLED=0
goos:
- darwin
- freebsd
- linux
goarch:
- i386
- amd64
- arm
- amd64
goarm:
- 6
- 7
sign:
artifacts: checksum

View File

@ -1,43 +0,0 @@
#!/bin/bash
echo -n "Version to tag: "
read TAG
echo -n "Name of release: "
read NAME
echo -n "Desc of release: "
read DESC
git tag ${TAG}
git push --tags
if [ ! -d ./bin ]; then
mkdir bin
else
rm -rf ./bin/*
fi
echo -n "Building binaries ... "
rice embed-go
GOOS=linux GOARCH=amd64 go build -o ./bin/shorturl-Linux-x86_64 .
GOOS=linux GOARCH=arm64 go build -o ./bin/shorturl-Linux-x86_64 .
GOOS=darwin GOARCH=amd64 go build -o ./bin/shorturl-Darwin-x86_64 .
GOOS=windows GOARCH=amd64 go build -o ./bin/shorturl-Windows-x86_64.exe .
echo "DONE"
echo -n "Uploading binaries ... "
github-release release \
-u prologic -p -r shorturl \
-t ${TAG} -n "${NAME}" -d "${DESC}"
for file in bin/*; do
name="$(echo $file | sed -e 's|bin/||g')"
github-release upload -u prologic -r shorturl -t ${TAG} -n $name -f $file
done
echo "DONE"