Skip to content

Commit

Permalink
Update version code. Update create-release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoTheTaco committed Jun 9, 2022
1 parent ee9957a commit dde8771
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
14 changes: 12 additions & 2 deletions tools/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -54,11 +54,21 @@ 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 \
--tag ghcr.io/tychothetaco/twitch-drops-bot:v"$currentVersion" \
--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!"

0 comments on commit dde8771

Please sign in to comment.