Skip to content

Commit

Permalink
ENT-5035: Build release SSO notification 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tbkennisnet committed Aug 23, 2024
1 parent ff00883 commit 5313b29
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ jobs:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Fail build if version contains SNAPSHOT
- run: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- run: echo "BUILD_VERSION=${VERSION%-SNAPSHOT}" >> $GITHUB_ENV
- name: Build with Maven and publish package
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo $VERSION
echo $BUILD_VERSION
if [[ "$VERSION" == *SNAPSHOT ]]; then
echo "Version contains SNAPSHOT, failing the workflow!"
exit 1
git config --global user.email "[email protected]"
git config --global user.name "Maven Release Plugin"
mvn -B clean release:prepare release:perform -Prelease -DreleaseVersion=$BUILD_VERSION -Dresume=false -DautoVersionSubmodules=true -DdryRun=false -Dmaven.test.skip=true -DskipITs -DscmCommentPrefix="[maven-release-plugin][ci skip] " -Djdk.net.URLClassPath.disableClassPathURLCheck=true
else
echo "Version is valid, continuing with the workflow."
echo "Version is not valid, failing the workflow."
exit 1
fi
- name: Build with Maven and publish package
run: mvn -B -U clean verify install -P release deploy -Djdk.net.URLClassPath.disableClassPathURLCheck=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "RELEASE_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
- run: echo "ARTIFACT_JAR_FILE=$(ls oc-sso-notificatie/target/*.jar | xargs basename)" >> $GITHUB_ENV
- run: echo "ARTIFACT_FILE_NAME=$(ls oc-sso-notificatie/target/*.jar | xargs basename | sed 's/\.[^.]*$//')" >> $GITHUB_ENV
- run: echo "ARTIFACT_PATH=$(ls oc-sso-notificatie/target/*.jar)" >> $GITHUB_ENV
Expand All @@ -49,8 +52,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.BUILD_VERSION }}
release_name: Release ${{ env.BUILD_VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
Expand Down
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<name>OC SSO Notification</name>
<description>OpenConext SSO Notification as a separate Service.</description>

<scm>
<url>https://github.com/OpenConext/OpenConext-SSO-Notification</url>
<developerConnection>scm:git:https://github.com/OpenConext/OpenConext-SSO-Notification.git</developerConnection>
<tag>HEAD</tag>
</scm>

<inceptionYear>2021</inceptionYear>

<properties>
Expand Down Expand Up @@ -62,6 +68,14 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -105,9 +119,10 @@
<artifactId>maven-release-plugin</artifactId>
<version>${maven.release.version}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<releaseProfiles>release</releaseProfiles>
<remoteTagging>true</remoteTagging>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>${BUILD_VERSION}</tagNameFormat>
</configuration>
<dependencies>
<dependency>
Expand Down
8 changes: 7 additions & 1 deletion release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<!-- A list of all the previous versions in reverse order, separated by a comma separator -->
<!-- The current version is automatically added in the release-notes-all overview. -->
<versions>2.3.1,2.3.0,2.2.1,2.2.0,2.1.1,2.1.0,2.0.6,2.0.5,2.0.4,2.0.3,2.0.2,2.0.1,1.0.0</versions>
<maven.deploy.skip>false</maven.deploy.skip>
<maven.project.info.version>2.8</maven.project.info.version>
<maven.site.version>3.8.2</maven.site.version>
<maven.install.version>2.4</maven.install.version>
Expand Down Expand Up @@ -104,6 +103,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 5313b29

Please sign in to comment.