Skip to content

Commit

Permalink
Add a release script for github
Browse files Browse the repository at this point in the history
  • Loading branch information
rverton committed Dec 2, 2019
1 parent 0990194 commit 361fd39
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions script/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TAG="v${VERSION}"
USER="rverton"
REPO="webanalyze"
REPO_PATH="cmd/webanalyze"
BINARY="webanalyze"
BINARY="${REPO}"

if [[ -z "${VERSION}" ]]; then
echo "Usage: ${0} <version>"
Expand Down Expand Up @@ -54,16 +54,16 @@ for ARCH in "amd64" "386"; do
BINFILE="${BINFILE}.exe"
fi

rm -f ${BINFILE}
# rm -f ${BINFILE}

GOOS=${OS} GOARCH=${ARCH} go build -o $DISTDIR/$BINFILE -ldflags "-X main.gronVersion=${VERSION}" github.com/${USER}/${REPO}/${REPO_PATH}

if [[ "${OS}" == "windows" ]]; then
ARCHIVE="$DISTDIR/${BINARY}-${OS}-${ARCH}-${VERSION}.zip"
cd $DISTDIR && zip ${ARCHIVE} $DISTDIR/${BINFILE}
ARCHIVE="${BINARY}-${OS}-${ARCH}-${VERSION}.zip"
cd $DISTDIR && zip ${ARCHIVE} ${BINFILE}
else
ARCHIVE="$DISTDIR/${BINARY}-${OS}-${ARCH}-${VERSION}.tgz"
cd $DISTDIR && tar --create --gzip --file=${ARCHIVE} $DISTDIR/${BINFILE}
ARCHIVE="${BINARY}-${OS}-${ARCH}-${VERSION}.tgz"
cd $DISTDIR && tar --create --gzip -C $DISTDIR --file=${ARCHIVE} ${BINFILE}
fi

echo "Uploading ${ARCHIVE}..."
Expand Down

0 comments on commit 361fd39

Please sign in to comment.