Skip to content

Commit

Permalink
Merge branch 'release/2.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Aug 31, 2021
2 parents eb2752b + e062269 commit 0cc9a98
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 116 deletions.
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

23 changes: 20 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,35 @@ pipeline {
agent {
docker {
image 'maven:3.6-jdk-11'
args '-v $HOME/.m2:/root/.m2 -u 0:0'
args '-v /home/jenkins/.m2:/var/maven/.m2 -v /home/jenkins/.gnupg:/.gnupg -e MAVEN_CONFIG=/var/maven/.m2 -e MAVEN_OPTS=-Duser.home=/var/maven'
}
}
environment {
COVERALLS_REPO_TOKEN = credentials('coveralls_repo_token_semantic_version')
GPG_SECRET = credentials('gpg_password')
}
stages {
stage('Build') {
steps {
sh 'mvn clean install'
sh 'mvn -B clean verify'
}
}
stage('Coverage') {
steps {
sh 'mvn -B jacoco:report jacoco:report-integration coveralls:report -DrepoToken=$COVERALLS_REPO_TOKEN'
}
}
stage('javadoc') {
steps {
sh 'mvn javadoc:javadoc'
sh 'mvn -B javadoc:javadoc'
}
}
stage('Deploy SNAPSHOT') {
when {
branch 'dev'
}
steps {
sh 'mvn -B -Prelease -DskipTests -Dgpg.passphrase=${GPG_SECRET} deploy'
}
}
}
Expand Down
44 changes: 36 additions & 8 deletions JenkinsfileRelease
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,50 @@ pipeline {
environment {
GPG_SECRET = credentials('gpg_password')
GITHUB = credentials('Github-Username-Pw')
GITHUB_RELEASE_TOKEN = credentials('github_registry_release')
GIT_ASKPASS='./.git-askpass'
}
stages {
stage ('Set Git Information') {
steps {
sh 'git config user.email "[email protected]"'
sh 'git config user.name "Simon Taddiken"'
stage ('Ensure dev branch') {
when {
expression {
return env.BRANCH_NAME != 'dev';
}
}
steps {
error("Releasing is only possible from dev branch")
}
}
stage ('Set Git Information') {
steps {
sh 'echo \'echo \$GITHUB_PSW\' > ./.git-askpass'
sh 'chmod +x ./.git-askpass'
sh 'git config url."https://[email protected]/".insteadOf "https://github.com/"'
sh 'git config url."https://[email protected]/".insteadOf "ssh://[email protected]/"'
sh 'git config url."https://[email protected]/".insteadOf "[email protected]:"'
sh 'git config user.email "[email protected]"'
sh 'git config user.name "Jenkins"'
}
}
stage('Create release branch') {
steps {
sh 'mvn -B -Prelease gitflow:release-start'
}
}
stage('Verify release') {
steps {
sh 'mvn -B -Prelease -Dgpg.passphrase=${GPG_SECRET} verify'
}
}
stage('Prepare') {
stage('Perform release') {
steps {
sh 'mvn -B release:prepare -Dpassword=${GITHUB_PSW} -Dusername=${GITHUB_USR}'
sh "mvn -B gitflow:release-finish -DargLine=\"-Prelease -B -Dgpg.passphrase=${GPG_SECRET} -DskipTests\""
}
}
stage('Perform') {
stage('Create GitHub release') {
steps {
sh 'mvn -B release:perform -Darguments="-Dgpg.passphrase=${GPG_SECRET} -Dpassword=${GITHUB_PSW} -Dusername=${GITHUB_USR}"'
sh 'git checkout master'
sh "mvn -B github-release:github-release -Dgithub.release-token=${GITHUB_RELEASE_TOKEN}"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* #5: System locale might lead to illegal identifiers during lower/upper casing (Thx [@portlek](https://github.com/portlek))
86 changes: 54 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.skuzzle</groupId>
<artifactId>skuzzle-parent</artifactId>
<version>2.0.11</version>
<relativePath>../skuzzle-parent/pom.xml</relativePath>
<version>3.0.1</version>
</parent>

<artifactId>semantic-version</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.1.1</version>
<packaging>jar</packaging>

<name>semantic-version</name>
Expand All @@ -24,34 +24,43 @@
</licenses>

<properties>
<javadoc.version>3.1.1</javadoc.version>

<site.name>semantic-version</site.name>
<github.name>semantic-version</github.name>

<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.platform.version>1.5.2</junit.platform.version>
<junit.version>5.7.2</junit.version>
<jackson.version>2.10.0.pr1</jackson.version>
<maven.surefire.version>3.0.0-M4</maven.surefire.version>
<maven.failsafe.version>3.0.0-M4</maven.failsafe.version>
<gson.version>2.8.5</gson.version>
<java-semver.version>0.9.0</java-semver.version>
<semver4j.version>3.1.0</semver4j.version>

<surefire.useModulePath>false</surefire.useModulePath>
<failsafe.useModulePath>false</failsafe.useModulePath>

<skipIT>true</skipIT>
</properties>


<scm>
<developerConnection>scm:git:https://github.com/skuzzle/${github.name}.git</developerConnection>
<tag>HEAD</tag>
</scm>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<version>${gson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -69,43 +78,29 @@
<dependency>
<groupId>com.github.zafarkhaja</groupId>
<artifactId>java-semver</artifactId>
<version>0.9.0</version>
<version>${java-semver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>semver4j</artifactId>
<version>2.0.1</version>
<version>${semver4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>${junit.platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>${junit.platform.version}</version>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -119,10 +114,37 @@
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<configuration>
<postReleaseGoals>deploy</postReleaseGoals>
<detail>true</detail>
<verbose>true</verbose>
<skipTestProject>true</skipTestProject>
<gitFlowConfig>
<productionBranch>master</productionBranch>
<developmentBranch>dev</developmentBranch>
</gitFlowConfig>
</configuration>
</plugin>
<plugin>
<groupId>com.ragedunicorn.tools.maven</groupId>
<artifactId>github-release-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<owner>skuzzle</owner>
<repository>${github.name}</repository>
<authToken>${github.release-token}</authToken>
<tagName>v${project.version}</tagName>
<name>Semantic Version ${project.version}</name>
<targetCommitish>master</targetCommitish>
<releaseNotes>RELEASE_NOTES.md</releaseNotes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>default-compile</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class IsPreReleasePerformanceIT extends VersionPerformanceTestBase {

@Test
public void testIsNoPreReleaseWithRegex() throws Exception {
performTest("Is no pre-release with regex", RUN, new Runnable() {
performTest("Is no pre-release with regex", RUNS, new Runnable() {

@Override
public void run() {
Expand All @@ -19,7 +19,7 @@ public void run() {

@Test
public void testIsNoPreRelease() throws Exception {
performTest("Is no pre-release without regex", RUN, new Runnable() {
performTest("Is no pre-release without regex", RUNS, new Runnable() {

@Override
public void run() {
Expand Down
8 changes: 4 additions & 4 deletions src/it/java/de/skuzzle/semantic/ParsingPerformanceIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ public class ParsingPerformanceIT extends VersionPerformanceTestBase {

@Test
public void testNoRegex() throws Exception {
performTest("Without regex", RUN, () -> Version.parseVersion(TEST_STRING));
performTest("Without regex", RUNS, () -> Version.parseVersion(TEST_STRING));
}

@Test
public void testWithRegex() throws Exception {
performTest("With regex", RUN, () -> VersionRegEx.parseVersion(TEST_STRING));
performTest("With regex", RUNS, () -> VersionRegEx.parseVersion(TEST_STRING));
}

@Test
public void testJSemver() throws Exception {
performTest("jsemver", RUN, () -> com.github.zafarkhaja.semver.Version.valueOf(TEST_STRING));
performTest("jsemver", RUNS, () -> com.github.zafarkhaja.semver.Version.valueOf(TEST_STRING));
}

@Test
public void testsemver4j() throws Exception {
performTest("semver4j", RUN, () -> new Semver(TEST_STRING));
performTest("semver4j", RUNS, () -> new Semver(TEST_STRING));
}
}
Loading

0 comments on commit 0cc9a98

Please sign in to comment.