forked from jstemmer/go-junit-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·39 lines (31 loc) · 1.36 KB
/
release.sh
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
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
if [ -n "$1" ]; then
VERSION=$1
else
echo 'Version not set'
exit 1
fi
echo "Releasing $VERSION"
if [ -n "$2" ]; then
GITHUB_TOKEN=$2
else
echo 'Github token not set'
exit 1
fi
go get github.com/aktau/github-release
GH_ACCOUNT=specgen-io
GH_REPO=go-junit-report
PROGRAM_NAME=go-junit-report
RELEASE_NAME=$VERSION
echo "Creating release in Github: $RELEASE_NAME"
set +e
$GOPATH/bin/github-release release --security-token $GITHUB_TOKEN --user $GH_ACCOUNT --repo $GH_REPO --tag $RELEASE_NAME
set -e
echo "Releasing zips/${PROGRAM_NAME}_darwin_amd64.zip"
$GOPATH/bin/github-release upload --replace --security-token $GITHUB_TOKEN --user $GH_ACCOUNT --repo $GH_REPO --tag $RELEASE_NAME --name ${PROGRAM_NAME}_darwin_amd64.zip --file zips/${PROGRAM_NAME}_darwin_amd64.zip
echo "Releasing zips/${PROGRAM_NAME}_linux_amd64.zip"
$GOPATH/bin/github-release upload --replace --security-token $GITHUB_TOKEN --user $GH_ACCOUNT --repo $GH_REPO --tag $RELEASE_NAME --name ${PROGRAM_NAME}_linux_amd64.zip --file zips/${PROGRAM_NAME}_linux_amd64.zip
echo "Releasing zips/${PROGRAM_NAME}_windows_amd64.zip"
$GOPATH/bin/github-release upload --replace --security-token $GITHUB_TOKEN --user $GH_ACCOUNT --repo $GH_REPO --tag $RELEASE_NAME --name ${PROGRAM_NAME}_windows_amd64.zip --file zips/${PROGRAM_NAME}_windows_amd64.zip
echo "Done releasing $VERSION"