forked from compose/transporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.fish
executable file
·31 lines (24 loc) · 877 Bytes
/
release.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env fish
# original version courtesy of https://github.com/oklog/oklog
function version_prompt
echo "Semantic version: "
end
read --prompt version_prompt VERSION
if test (echo $VERSION | grep '^v')
echo Use the raw semantic version, without a v prefix
exit
end
set REV (git rev-parse --short HEAD)
echo Tagging $REV as v$VERSION
git tag --annotate v$VERSION -m "Release v$VERSION"
echo Be sure to: git push --tags
echo
set DISTDIR dist/v$VERSION
mkdir -p $DISTDIR
for pair in linux/amd64 darwin/amd64 dragonfly/amd64 freebsd/amd64 netbsd/amd64 openbsd/amd64 windows/amd64
set GOOS (echo $pair | cut -d'/' -f1)
set GOARCH (echo $pair | cut -d'/' -f2)
set BIN $DISTDIR/transporter-$VERSION-$GOOS-$GOARCH
echo $BIN
env GOOS=$GOOS GOARCH=$GOARCH go build -o $BIN -ldflags="-X main.version=$VERSION" github.com/compose/transporter/cmd/transporter
end