Skip to content

Commit b618970

Browse files
authored
Use the version from tag to perform the release (#61)
* Use version from tag to perform the release Signed-off-by: Pavol Loffay <[email protected]> * Add readme Signed-off-by: Pavol Loffay <[email protected]> * remove ssh finger Signed-off-by: Pavol Loffay <[email protected]> * change tag filter CI Signed-off-by: Pavol Loffay <[email protected]>
1 parent 3634c21 commit b618970

File tree

4 files changed

+15
-33
lines changed

4 files changed

+15
-33
lines changed

.circleci/config.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ jobs:
4444
- image: circleci/openjdk:11.0.6-jdk-buster
4545
steps:
4646
- setup_build_environment
47-
- run: ./gradlew :tag -Prelease
47+
- run: echo "Releasing version" && ./gradlew printVersion
4848
- run: ./gradlew publish
49-
- add_ssh_keys:
50-
fingerprints:
51-
- 'f1:dd:0f:dc:42:b3:bf:9f:b8:e3:e8:3f:9b:92:04:fb'
52-
- run: git push origin $(./gradlew -q :printVersion)
5349

5450
workflows:
5551
version: 2
@@ -72,4 +68,4 @@ workflows:
7268
branches:
7369
ignore: /.*/
7470
tags:
75-
only: /^release-.*/
71+
only: /^[0-9]+\.[0-9]+\.[0-9]+/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ hs_err_pid*
3333
build
3434

3535
.idea
36+
37+
# the ./gradlew printVersion generates this file
38+
# ignore this file because the version is consumed from the git tags only
39+
semantic-build-versioning.gradle

RELEASE.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
# Release
22

3-
This repository uses fully automated release process. The release build is triggered by pushing a release tag e.g.
4-
`git tag release-1 && git push origin release-1` (`1` is a sequence number to trigger the release).
5-
The release version is supplied from the
6-
[Hypertrace version plugin](https://github.com/hypertrace/hypertrace-gradle-version-settings-plugin)
7-
that uses git history and [semantic versioning settings](./semantic-build-versioning.gradle) to
8-
decide what the next release version should be.
9-
10-
The major version is incremented if commit history contains:
11-
* Prefix `BREAKING CHANGE`
12-
* Feature suffix `!` e.g. `feat!` or `feat(scope)!`
3+
This repository uses automated release process. The release build is triggered by pushing a release tag e.g.
4+
`git tag 0.2.0 && git push origin 0.2.0` to release version `0.2.0`.
135

14-
The minor version is incremented if commit history contains:
15-
* `feat` or `feat(scope)`
16-
17-
The patch version is incremented in other cases.
6+
The version is supplied from the
7+
[Hypertrace version plugin](https://github.com/hypertrace/hypertrace-gradle-version-settings-plugin)
8+
that uses git history (e.g. the latest tag) to derive the version. For instance if the last
9+
commit has a tag then the version from tag is used. If the last commit does not have a tag then
10+
the last tag version with `-SNAPSHOT` is used.
1811

19-
## Print the next release version:
12+
## Print the current version:
2013

2114
```bash
22-
./gradlew printVersion -Prelease
15+
./gradlew printVersion # -Prelease - prints the next release version, it's not used at the moment.
2316
```
2417

2518
## Release CI job

semantic-build-versioning.gradle

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)