Skip to content

Commit

Permalink
split github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
helios57 committed Apr 22, 2024
1 parent 68fbbf2 commit 2677ee1
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 77 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
push:
branches-ignore:
- 'master'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package --file pom.xml --no-transfer-progress
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
push:
branches:
- 'master'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.PGP_KEY }}
gpg-passphrase: PGP_PASSPHRASE
- name: Build and Deploy with Maven
run: mvn -B -P sign-artifacts deploy --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
20 changes: 20 additions & 0 deletions .github/workflows/it-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
push:
branches-ignore:
- 'master'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: IT-Tests with Maven
run: mvn -B verify -Dmaven.test.skip=false -P it_tests --file pom.xml --no-transfer-progress
33 changes: 0 additions & 33 deletions .github/workflows/maven.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/test-sign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Sign

on:
push:
branches-ignore:
- 'master'

jobs:
deploy:
name: Sign
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
gpg-private-key: ${{ secrets.PGP_KEY }}
gpg-passphrase: PGP_PASSPHRASE
- name: Build and Deploy with Maven
run: mvn -B -P sign-artifacts package --no-transfer-progress
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
108 changes: 64 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.4</version>
<relativePath /> <!-- lookup parent from repository -->
<version>3.2.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>ch.sbb</groupId>
<artifactId>spring-cloud-stream-binder-solace</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>4.0.0</version>

<name>Spring Cloud Stream Binder Solace</name>
<description>A Spring Cloud Stream Binder implementation using the Solace Java API (JCSMP)</description>
<url>https://github.com/SchweizerischeBundesbahnen/spring-cloud-stream-binder</url>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/SchweizerischeBundesbahnen/spring-cloud-stream-binder/issues</url>
</issueManagement>

<properties>
<java.version>17</java.version>
<spring-cloud.version>2023.0.1</spring-cloud.version>
<solace.jcsmp.version>10.23.0</solace.jcsmp.version>
<maven.test.skip>true</maven.test.skip>
<build.timestamp>${maven.build.timestamp}</build.timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<java.version>17</java.version>
<spring-cloud.version>2023.0.1</spring-cloud.version>
<solace.jcsmp.version>10.22.0</solace.jcsmp.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -88,6 +94,27 @@
</dependencies>

<profiles>
<profile>
<id>sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>it_tests</id>
<properties>
Expand Down Expand Up @@ -202,23 +229,31 @@
<configuration>
<properties>
<property>
<name>org.slf4j.simpleLogger.log.io.swagger.codegen.v3.generators.DefaultCodegenConfig</name>
<name>
org.slf4j.simpleLogger.log.io.swagger.codegen.v3.generators.DefaultCodegenConfig
</name>
<value>OFF</value>
</property>
<property>
<name>org.slf4j.simpleLogger.log.io.swagger.codegen.v3.AbstractGenerator</name>
<name>org.slf4j.simpleLogger.log.io.swagger.codegen.v3.AbstractGenerator
</name>
<value>OFF</value>
</property>
<property>
<name>org.slf4j.simpleLogger.log.org.apache.maven.plugin.compiler.CompilerMojo</name>
<name>
org.slf4j.simpleLogger.log.org.apache.maven.plugin.compiler.CompilerMojo
</name>
<value>OFF</value>
</property>
<property>
<name>org.slf4j.simpleLogger.log.org.apache.maven.plugins.javadoc.JavadocJar</name>
<name>
org.slf4j.simpleLogger.log.org.apache.maven.plugins.javadoc.JavadocJar
</name>
<value>OFF</value>
</property>
<property>
<name>org.slf4j.simpleLogger.log.c.s.test.integration.semp.v2.SempV2Api</name>
<name>org.slf4j.simpleLogger.log.c.s.test.integration.semp.v2.SempV2Api
</name>
<value>OFF</value>
</property>
</properties>
Expand Down Expand Up @@ -249,7 +284,8 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-action.json</inputSpec>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-action.json
</inputSpec>
<apiPackage>com.solace.test.integration.semp.v2.action.api</apiPackage>
<modelPackage>com.solace.test.integration.semp.v2.action.model</modelPackage>
<modelNamePrefix>Action</modelNamePrefix>
Expand Down Expand Up @@ -278,7 +314,8 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-config.json</inputSpec>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-config.json
</inputSpec>
<apiPackage>com.solace.test.integration.semp.v2.config.api</apiPackage>
<modelPackage>com.solace.test.integration.semp.v2.config.model</modelPackage>
<modelNamePrefix>Config</modelNamePrefix>
Expand Down Expand Up @@ -307,7 +344,8 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-monitor.json</inputSpec>
<inputSpec>${project.basedir}/src/test/resources/semp/semp-v2-swagger-monitor.json
</inputSpec>
<apiPackage>com.solace.test.integration.semp.v2.monitor.api</apiPackage>
<modelPackage>com.solace.test.integration.semp.v2.monitor.model</modelPackage>
<modelNamePrefix>Monitor</modelNamePrefix>
Expand Down Expand Up @@ -383,8 +421,8 @@

<scm>
<connection>scm:git:[email protected]:SchweizerischeBundesbahnen/spring-cloud-stream-binder.git</connection>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>

<build>
<plugins>
Expand Down Expand Up @@ -422,27 +460,10 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<projectVersionPolicyId>ConventionalCommitsVersionPolicy</projectVersionPolicyId>
</configuration>
<dependencies>
<dependency>
<groupId>nl.basjes.maven.release</groupId>
<artifactId>conventional-commits-version-policy</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.2.4</version>
<version>3.2.5</version>
<configuration>
<skip>true</skip>
</configuration>
Expand All @@ -460,7 +481,7 @@
</execution>
</executions>
<configuration>
<source>17</source>
<source>${java.version}</source>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
</plugin>
Expand All @@ -479,16 +500,15 @@
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>central</id>
<name>f1c32b487257-releases</name>
<url>https://bin.sbb.ch/artifactory/tms.mvn</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>f1c32b487257-snapshots</name>
<url>https://bin.sbb.ch/artifactory/tms.mvn</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>

0 comments on commit 2677ee1

Please sign in to comment.