Skip to content

Commit

Permalink
Fix serpro69#37 - remove auto-increments of patch versions
Browse files Browse the repository at this point in the history
  • Loading branch information
serpro69 committed Jul 9, 2020
1 parent 06c44dd commit 1126658
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 43 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: java

branches:
except:
- /^v(\d+\.?){3}/
- /^untagged/

jobs:
Expand All @@ -21,11 +20,12 @@ jobs:
file_glob: true
file: "cli-bot/build/graal/faker-bot_*"
on:
branch: master
branch: /^v(\d+\.?){3}/
tags: true

stages:
- name: test
if: NOT branch = master
if: tag is blank

- name: deploy and release
if: branch = master
if: tag IS present
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and the project versioning adheres to [Semantic Versioning](https://semver.org/s
### Fixed
- [#36](https://github.com/serpro69/kotlin-faker/issues/36) Build native-image before uploading to bintray

### Changed
- [#37](https://github.com/serpro69/kotlin-faker/issues/37) Revisit automated builds for patches

### Added
- [#34](https://github.com/serpro69/kotlin-faker/issues/34) 8 new providers:
- `warhammerFantasy`
Expand Down
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
- [Comparison with other JVM-based faker libraries](#comparison-with-other-jvm-based-faker-libs)
- [Usage](#usage)
- [Downloading](#downloading)
- [Using latest hotfix version](#using-the-latest-hotfix-release)
- [Generating data](#generating-data)
- [Configuring Faker](#configuring-faker)
- [Default configuration](#default-configuration)
Expand Down Expand Up @@ -121,29 +120,6 @@ Add dependency:
**Downloading a jar**
The jar and pom files can also be found at this [link](https://dl.bintray.com/serpro69/maven/io/github/serpro69/kotlin-faker/)

#### Using the latest hotfix release
Hotfixes are automatically built and deployed to bintray on every push to master that passes tests.
This means that it could be cumbersome to always have the latest hotfix version in your dependencies,
therefore it is recommended to use a dependency range instead, providing only major and minor versions.

In maven:
```xml
<dependency>
<groupId>io.github.serpro69</groupId>
<artifactId>kotlin-faker</artifactId>
<version>[1.1,1.2)</version> <!--Use latest version between 1.1 (inclusive) and 1.2 (exclusive)-->
</dependency>
```

In gradle:
```groovy
dependencies {
implementation 'io.github.serpro69:kotlin-faker:1.1.+'
}
```

Major and minor versions are still bumped manually and therefore are not that frequent.
The project adheres to semantic versions rules.

### Generating data
```kotlin
Expand Down Expand Up @@ -649,9 +625,8 @@ has to be updated to build the native image with graal.


## Build and Deploy
Builds and deploys to bintray are automated with travis-ci through usage of git tags.
Patches/hotfixes versions are automatically bumped on every push to master and do not require any user interactions.
Major and minor versions need to be bumped manually through a tag with the next release version that has to follow the
Build/deploy to bintray and github release processes are automated with travis-ci through usage of git tags.
Major, minor, and patch versions need to be bumped manually through a tag with the next release version that has to follow the
`v<major>.<minor>.<patch>` pattern, and the tag has to be pushed to origin along with the changes.
Creating the tag can be either done manually with `git tag` or by using `gradlew tag -Prelease -PbumpComponent=${comp}`
where `comp` can be one of the following values: `major`, `minor`, or `patch`.
Expand Down
16 changes: 4 additions & 12 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@ if [[ "${_dir}" != "$(pwd)" ]]; then
cd "${_dir}"
fi

# Set git author config
git config --local user.name "${GIT_USER_NAME}"
git config --local user.email "${GIT_USER_EMAIL}"

_tag="$(git describe --exact-match --tags HEAD 2>&1)"

if [[ "${_tag}" == *"no tag exactly matches"* ]]; then
./gradlew clean tag build cli-bot:nativeImage core:bintrayUpload -Prelease -PbintrayUser=${BINTRAY_USER} -PbintrayKey=${BINTRAY_KEY}
if [[ "${_tag}" == *"No names found, cannot describe anything"* ]] || [[ "${_tag}" == *"no tag exactly matches"* ]]; then
echo 2>&1 "$_tag"
exit 1
else
if [[ "${_tag}" == *"No names found, cannot describe anything"* ]]; then
echo "Setting tag for first release"
git tag v0.0.1
fi

./gradlew clean printVersion build cli-bot:nativeImage core:bintrayUpload -Prelease -PbintrayUser=${BINTRAY_USER} -PbintrayKey=${BINTRAY_KEY}
./gradlew clean printVersion build nativeImage bintrayUpload -Prelease -PbintrayUser=${BINTRAY_USER} -PbintrayKey=${BINTRAY_KEY}
fi

0 comments on commit 1126658

Please sign in to comment.