Skip to content

Commit f03eb4f

Browse files
chore(ci): push additional tags with <major> and <major>.<minor> versions
1 parent ffa2106 commit f03eb4f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.releaserc.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,19 @@ plugins:
1717
numReplacements: 1
1818
- - "@semantic-release/exec"
1919
- verifyConditionsCmd: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
20+
verifyReleaseCmd: |
21+
MAJOR_MINOR_PATCH=${/^((\d+)\.\d+)\.\d+$/.exec(nextRelease.version)}
22+
if [ -z $MAJOR_MINOR_PATCH ]; then echo "Only SemVer versions with version core (major.minor.patch) supported!"; exit 1; fi
2023
prepareCmd: docker build -t $DOCKER_IMAGE:latest .
2124
publishCmd: |
22-
docker tag $DOCKER_IMAGE:latest $DOCKER_IMAGE:${nextRelease.version}
25+
MAJOR_MINOR_PATCH=${/^((\d+)\.\d+)\.\d+$/.exec(nextRelease.version)[0]}
26+
MAJOR_MINOR=${ /^((\d+)\.\d+)\.\d+$/.exec(nextRelease.version)[1]}
27+
MAJOR=${ /^((\d+)\.\d+)\.\d+$/.exec(nextRelease.version)[2]}
28+
docker tag $DOCKER_IMAGE:latest $DOCKER_IMAGE:$MAJOR_MINOR_PATCH
29+
docker tag $DOCKER_IMAGE:latest $DOCKER_IMAGE:$MAJOR_MINOR
30+
docker tag $DOCKER_IMAGE:latest $DOCKER_IMAGE:$MAJOR
2331
docker push $DOCKER_IMAGE:latest
24-
docker push $DOCKER_IMAGE:${nextRelease.version}
32+
docker push $DOCKER_IMAGE:$MAJOR_MINOR_PATCH
33+
docker push $DOCKER_IMAGE:$MAJOR_MINOR
34+
docker push $DOCKER_IMAGE:$MAJOR
2535
- "@semantic-release/github"

0 commit comments

Comments
 (0)