Skip to content

Commit

Permalink
Merge pull request #75 from it-at-m/22-erstellung-releasekandidatvers…
Browse files Browse the repository at this point in the history
…ion-von-wls-common-2

update pom und erstellungt workflow in Vorbereitung auf wls-common release
  • Loading branch information
MrSebastian authored Apr 9, 2024
2 parents b0a6c9f + bea3545 commit 1306206
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/dispatch-wls-common-mvn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: dispatch wls-common release with deploy

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to release from ?"
required: true
default: "main"
release-version:
description: "Release version ?"
required: true
release-tag:
description: "Release tag ?"
required: true
development-version:
description: "Next Development version ?"
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup git user
uses: fregante/setup-git-user@v2
- name: Set up JDK 17 and OSSRH auth / GPG signing
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "central"
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: SIGN_KEY_PASS
- name: Perform maven release
run: >
mvn -B -ntp release:prepare release:perform -f wls-common/pom.xml
-DreleaseVersion=${{ github.event.inputs.release-version }}
-DdevelopmentVersion=${{ github.event.inputs.development-version }}
-Dtag=${{ github.event.inputs.release-tag }}
-Darguments="-DskipTests"
env:
SIGN_KEY_PASS: ${{ secrets.gpg_passphrase }}
CENTRAL_USERNAME: ${{ secrets.sonatype_username }}
CENTRAL_PASSWORD: ${{ secrets.sonatype_password }}
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.release-tag }}
draft: false
prerelease: false
generate_release_notes: false

112 changes: 112 additions & 0 deletions wls-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
<name>wls-common</name>
<packaging>pom</packaging>
<description>Serviceübergreifende Aspekte</description>
<url>https://github.com/it-at-m/Wahllokalsystem</url>

<licenses>
<license>
<name>MIT License</name>
</license>
</licenses>

<properties>
<java.version>17</java.version>
Expand Down Expand Up @@ -68,6 +74,51 @@
<tag>HEAD</tag>
</scm>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!-- Central Portal Publishing Plugin -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<tokenAuth>true</tokenAuth>
<autoPublish>true</autoPublish>
<deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
</configuration>
</plugin>
<!-- GPG plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<skip>${skipGpg}</skip>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -126,6 +177,23 @@
</dependency>
</dependencies>
</plugin>

<!-- release specific plugins -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.4.0</version>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -162,4 +230,48 @@
</plugins>
</build>

<distributionManagement>
<!-- Central Repository -->
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<developers>
<developer>
<name>MrSebastian</name>
<organization>Landeshauptstadt München</organization>
<url>https://github.com/MrSebastian</url>
<roles>
<role>initiator</role>
<role>developer</role>
</roles>
</developer>
<developer>
<name>Nic12345678</name>
<organization>Landeshauptstadt München</organization>
<url>https://github.com/Nic12345678</url>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<name>dragonfly28</name>
<organization>Landeshauptstadt München</organization>
<url>https://github.com/dragonfly28</url>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<name>GerhardPx</name>
<organization>Landeshauptstadt München</organization>
<url>https://github.com/GerhardPx</url>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>

</project>

0 comments on commit 1306206

Please sign in to comment.