Skip to content

Commit

Permalink
Merge pull request #10 from basecamp/add-release-script
Browse files Browse the repository at this point in the history
Add script/release
  • Loading branch information
kevinmcconnell authored Aug 27, 2024
2 parents 7220a95 + 1cbd335 commit c2bfe9f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test bench docker release
.PHONY: build test bench docker

build:
CGO_ENABLED=0 go build -trimpath -o bin/ ./cmd/...
Expand All @@ -12,9 +12,3 @@ bench:
docker:
docker build -t kamal-proxy .

release:
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag basecamp/kamal-proxy:latest \
--label "org.opencontainers.image.title=kamal-proxy" \
--push .
33 changes: 33 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

usage() {
echo "Usage: $0 <version>"
echo " <version> The new version number (e.g. 1.2.3)"
exit 1
}

if [ $# -ne 1 ]; then
usage
fi

VERSION=$1
TAG=v$VERSION

docker login
make test
git fetch origin --tags

git tag -a ${TAG} -m "Version ${VERSION}
- list important changes here" -e

docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag basecamp/kamal-proxy:${TAG} \
--tag basecamp/kamal-proxy:latest \
--label "org.opencontainers.image.title=kamal-proxy" \
--push .

git push origin tag ${TAG}

0 comments on commit c2bfe9f

Please sign in to comment.