Skip to content

Commit

Permalink
switch to gh cli for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
naggie committed Sep 13, 2022
1 parent 3e6c842 commit a3b912c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions do-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@ LDFLAGS="-s -w \
-X \"github.com/naggie/dsnet.BUILD_DATE=$BUILD_DATE\"\
"

# get release information
if ! test -f $RELEASE_FILE || head -n 1 $RELEASE_FILE | grep -vq $VERSION; then
# file doesn't exist or is for old version, replace
printf "$VERSION\n\n\n" > $RELEASE_FILE
fi

vim "+ normal G $" $RELEASE_FILE


# build
mkdir -p dist

Expand All @@ -49,9 +42,14 @@ GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/dsnet cmd/root.go
# upx -q dsnet
mv dist/dsnet dist/dsnet-linux-amd64

hub release create \
-a dist/dsnet-linux-arm5#"dsnet linux-arm5" \
-a dist/dsnet-linux-arm64#"dsnet linux-arm64" \
-a dist/dsnet-linux-amd64#"dsnet linux-amd64" \
-F $RELEASE_FILE \
$1
# github.com/cli/cli
# https://github.com/cli/cli/releases/download/v2.15.0/gh_2.15.0_linux_amd64.deb
# do: gh auth login
gh release create \
--title $VERSION \
--notes-file $RELEASE_FILE \
--draft \
$VERSION \
dist/dsnet-linux-arm5#"dsnet linux-arm5" \
dist/dsnet-linux-arm64#"dsnet linux-arm64" \
dist/dsnet-linux-amd64#"dsnet linux-amd64" \

0 comments on commit a3b912c

Please sign in to comment.