Skip to content

Commit

Permalink
Adds go.mod, newer release script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom committed Jun 9, 2022
1 parent 5555984 commit 7e8abdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/tomnomnom/httprobe

go 1.18
31 changes: 10 additions & 21 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,15 @@ if [ $? -ne 0 ]; then
exit 3
fi

# Check if tag exists
git fetch --tags
git tag | grep "^${TAG}$"

if [ $? -ne 0 ]; then
github-release release \
--user ${USER} \
--repo ${REPO} \
--tag ${TAG} \
--name "${REPO} ${TAG}" \
--description "${TAG}" \
--pre-release
fi

FILELIST=""

for ARCH in "amd64" "386"; do
for OS in "darwin" "linux" "windows" "freebsd"; do

if [[ "${OS}" == "darwin" && "${ARCH}" == "386" ]]; then
continue
fi

BINFILE="${BINARY}"

if [[ "${OS}" == "windows" ]]; then
Expand All @@ -57,18 +48,16 @@ for ARCH in "amd64" "386"; do
if [[ "${OS}" == "windows" ]]; then
ARCHIVE="${BINARY}-${OS}-${ARCH}-${VERSION}.zip"
zip ${ARCHIVE} ${BINFILE}
rm ${BINFILE}
else
ARCHIVE="${BINARY}-${OS}-${ARCH}-${VERSION}.tgz"
tar --create --gzip --file=${ARCHIVE} ${BINFILE}
fi

echo "Uploading ${ARCHIVE}..."
github-release upload \
--user ${USER} \
--repo ${REPO} \
--tag ${TAG} \
--name "${ARCHIVE}" \
--file ${PROJDIR}/${ARCHIVE}
FILELIST="${FILELIST} ${PROJDIR}/${ARCHIVE}"
done
done

gh release create ${TAG} ${FILELIST}
rm ${FILELIST}

0 comments on commit 7e8abdb

Please sign in to comment.