Skip to content

Commit

Permalink
Adds go.mod, go.sum, fixed release script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom committed Jun 11, 2022
1 parent 9daab00 commit 20e5bfe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/tomnomnom/meg

go 1.18

require github.com/tomnomnom/rawhttp v0.0.0-20200527083831-e904eb0f15db
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/tomnomnom/rawhttp v0.0.0-20200527083831-e904eb0f15db h1:Fwx3Qv6/rHBXlve9LVAClrUqL1cJXSY0vIzJZApzAZo=
github.com/tomnomnom/rawhttp v0.0.0-20200527083831-e904eb0f15db/go.mod h1:qYu1IEu1J5DBOJH+4Xg+jCfjyPHFEQuIIV3XhIJtBjw=
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 20e5bfe

Please sign in to comment.