Skip to content

Commit

Permalink
fix: publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
Diegiwg committed Jun 26, 2024
1 parent ca8ebef commit 0befa71
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.3
v1.3.4
40 changes: 0 additions & 40 deletions scripts/publish.bat

This file was deleted.

10 changes: 1 addition & 9 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@

set -e

# Get the last version in repository
CURRENT_VERSION=$(git describe --abbrev=0 --tags)

# Get the declared version in .version file
VERSION=$(cat .version)

# Check if versions are equal
if [ "$CURRENT_VERSION" = "$VERSION" ]; then
echo "Versions are equal. Nothing to publish"
exit 0
fi

# Tidy the repository
go mod tidy

Expand All @@ -27,6 +18,7 @@ git push origin "$VERSION"
GOPROXY=proxy.golang.org go list -m github.com/Diegiwg/tt@"$VERSION"

# Test if the version was published
echo "Getting the version from https://pkg.go.dev/github.com/Diegiwg/tt@$VERSION..."
OK=$(curl -o /dev/null -s -w "%{http_code}\n" https://pkg.go.dev/github.com/Diegiwg/tt@"$VERSION")

if [ "$OK" = "200" ]; then
Expand Down

0 comments on commit 0befa71

Please sign in to comment.