Skip to content

Commit

Permalink
Automatically release when tag is created
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslorentz committed Apr 21, 2022
1 parent 41083a9 commit e3a0d33
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
trigger:
branches:
include:
- '*'
- refs/tags/*

jobs:
- job: Build_Binaries
pool:
Expand Down
6 changes: 3 additions & 3 deletions build-images-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ if [[ "${BUILD_SOURCEBRANCH}" == "refs/heads/master" ]]; then
TAGS_ALPINE="-t lucaslorentz/caddy-docker-proxy:ci-alpine"
fi

if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
echo "Releasing version ${RELEASE_VERSION}..."
if [[ "${BUILD_SOURCEBRANCH}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
echo "Releasing version ${BUILD_SOURCEBRANCHNAME}..."

docker login -u lucaslorentz -p "$DOCKER_PASSWORD"

PATCH_VERSION=$(echo $RELEASE_VERSION | cut -c2-)
PATCH_VERSION=$(echo $BUILD_SOURCEBRANCHNAME | cut -c2-)
MINOR_VERSION=$(echo $PATCH_VERSION | cut -d. -f-2)

OUTPUT="type=registry"
Expand Down
6 changes: 3 additions & 3 deletions build-images-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ if [[ "${BUILD_SOURCEBRANCH}" == "refs/heads/master" ]]; then
docker push lucaslorentz/caddy-docker-proxy:ci-nanoserver-ltsc2022
fi

if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
echo "Releasing version ${RELEASE_VERSION}..."
if [[ "${BUILD_SOURCEBRANCH}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
echo "Releasing version ${BUILD_SOURCEBRANCHNAME}..."

PATCH_VERSION=$(echo $RELEASE_VERSION | cut -c2-)
PATCH_VERSION=$(echo $BUILD_SOURCEBRANCHNAME | cut -c2-)
MINOR_VERSION=$(echo $PATCH_VERSION | cut -d. -f-2)

docker login -u lucaslorentz -p "$DOCKER_PASSWORD"
Expand Down

0 comments on commit e3a0d33

Please sign in to comment.