From dde87716b7c2c1e730b77b6ec2ec4d2c37af4fc0 Mon Sep 17 00:00:00 2001 From: Tycho Bellers Date: Wed, 8 Jun 2022 20:15:50 -0700 Subject: [PATCH] Update version code. Update create-release.sh --- package.json | 2 +- tools/create-release.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e3130d7..e6391fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "twitch_drops_bot", - "version": "1.2.0", + "version": "1.2.1", "description": "A Node.js bot for automatically collecting Twitch drops.", "type": "module", "repository": { diff --git a/tools/create-release.sh b/tools/create-release.sh index e554ded..7821dab 100644 --- a/tools/create-release.sh +++ b/tools/create-release.sh @@ -5,7 +5,7 @@ currentDirectory=$(dirname "$0") personalAccessToken=$1 if [ -z "${personalAccessToken}" ]; then - echo "Missing GitHub personal access token! See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry if you need to create one." + echo "Missing GitHub personal access token! Visit https://github.com/settings/tokens/new to create one. Must have \"write:packages\" permission." exit 1 fi @@ -54,6 +54,10 @@ if ! confirm; then exit 2 fi +# Get the project directory (https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel) +scriptDirectory="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" &>/dev/null && pwd 2>/dev/null)" +projectDirectory="$(cd "$scriptDirectory/../" && pwd)" + # Build and push docker image docker buildx build \ --platform linux/amd64,linux/arm64/v8,linux/arm/v7 \ @@ -61,4 +65,10 @@ docker buildx build \ --tag ghcr.io/tychothetaco/twitch-drops-bot:latest-release \ --build-arg GIT_COMMIT_HASH="$hash" \ --output type=registry \ - . + "$projectDirectory" + +# Tag the commit with the version number +echo "Tagging commit with version code..." +git tag v"$currentVersion" "$hash" + +echo "Done!" \ No newline at end of file