Skip to content

Commit

Permalink
Merge pull request 'Release v24.04.2' (#5) from release_24.04.2 into …
Browse files Browse the repository at this point in the history
…master
  • Loading branch information
Dominick Leppich committed May 3, 2024
2 parents 79f12e3 + 0f08581 commit fcdc287
Show file tree
Hide file tree
Showing 21 changed files with 322 additions and 308 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/develop-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Development Build

permissions:
contents: write

on:
push:
branches:
- 'develop'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up Maven cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean verify -U -P snapshot-build
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
- name: Create tag name from date
id: tagdate
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
- name: Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.date.outputs.date }}
tag_name: ${{ steps.tagdate.outputs.tagdate }}
generate_release_notes: true
draft: false
prerelease: true
files: |
**/target/*.jar
install/*
40 changes: 40 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Release Build

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up Maven cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean verify -U -P release-build
- name: Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
files: |
**/target/*.jar
install/*
62 changes: 0 additions & 62 deletions .github/workflows/release.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# Junk files
*~
.DS_Store

# Build
target/
bin/
build/
node_modules/

# Eclipse
.project
.classpath
.settings/

# IntelliJ IDEA
.idea
*.iml

121 changes: 108 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,133 @@

pipeline {

agent {
docker {
image 'maven:3-jdk-11'
args '-v $HOME/.m2:/var/maven/.m2:z -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
/* using a custom build image with a defined home directory for UID 1000 among other things */
image 'nexus.intranda.com:4443/maven:3.9.3-eclipse-temurin-17'
registryUrl 'https://nexus.intranda.com:4443'
registryCredentialsId 'jenkins-docker'
args '-v $HOME/.m2:/var/maven/.m2:z -v $HOME/.config:/var/maven/.config -v $HOME/.sonar:/var/maven/.sonar -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
}
}

options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '15', daysToKeepStr: '90', numToKeepStr: '')
}



stages {
stage('prepare') {
steps {
sh 'git clean -fdx'
sh 'git reset --hard HEAD && git clean -fdx'
}
}

stage('build') {
stage('build-snapshot') {
when {
not {
anyOf {
branch 'master'
branch 'release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
}
steps {
sh 'mvn clean verify -U -P snapshot-build'
}
}
stage('build-release') {
when {
anyOf {
branch 'master'
branch 'release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
steps {
sh 'mvn clean verify -U -P release-build'
}
}
stage('sonarcloud') {
when {
anyOf {
branch 'master'
branch 'release_*'
branch 'sonar_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
steps {
sh 'mvn -f plugin/pom.xml package'
recordIssues enabledForFailure: true, aggregatingResults: true, tools: [java(), javaDoc()]
withCredentials([string(credentialsId: 'jenkins-sonarcloud', variable: 'TOKEN')]) {
sh 'mvn verify sonar:sonar -Dsonar.token=$TOKEN -U'
}
}
}
stage('deploy-libs') {
when {
anyOf {
branch 'master'
branch 'develop'
}
}
steps {
script {
if (fileExists('module-lib/pom.xml')) {
sh 'mvn -N deploy'
sh 'mvn -f module-lib/pom.xml deploy'
}
}
}
}
stage('tag release') {
when { branch 'master' }
steps {
withCredentials([gitUsernamePassword(credentialsId: '93f7e7d3-8f74-4744-a785-518fc4d55314',
gitToolName: 'git-tool')]) {
sh '''#!/bin/bash -xe
projectversion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout)
if [ $? != 0 ]
then
exit 1
elif [[ "${projectversion}" =~ "SNAPSHOT" ]]
then
echo "This is a SNAPSHOT version"
exit 1
fi
echo "${projectversion}"
git tag -a "v${projectversion}" -m "releasing v${projectversion}" && git push origin v"${projectversion}"
'''
}
}
}
}

post {
always {
junit allowEmptyResults: true, testResults: "**/target/surefire-reports/*.xml"
step([
$class : 'JacocoPublisher',
execPattern : '**/target/jacoco.exec',
classPattern : '**/target/classes/',
sourcePattern : '**/src/main/java',
exclusionPattern : '**/*Test.class'
])
recordIssues (
enabledForFailure: true, aggregatingResults: false,
tools: [checkStyle(pattern: 'target/checkstyle-result.xml', reportEncoding: 'UTF-8')]
)
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
}
success {
archiveArtifacts artifacts: '**/target/*.jar, */plugin_*.xml, plugin_*.xml', fingerprint: true, onlyIfSuccessful: true
archiveArtifacts artifacts: '**/target/*.jar, install/*', fingerprint: true, onlyIfSuccessful: true
}
changed {
emailext(
Expand All @@ -42,5 +139,3 @@ pipeline {
}
}
}

/* vim: set ts=2 sw=2 tw=120 et :*/
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions module-base/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<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>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-opac-generic-xml</artifactId>
<version>24.04.2</version>
</parent>
<artifactId>plugin-opac-generic-xml-base</artifactId>
<packaging>jar</packaging>
</project>
Loading

0 comments on commit fcdc287

Please sign in to comment.