Skip to content

Commit

Permalink
build,ci: add snapshot deployment infrastructure
Browse files Browse the repository at this point in the history
- Change CD configuration to deploy snapshots to Sonatype staging
  with modern plugins and Github Action configuration
- Add plugins to POM to enable checks and POM flattening
- Does not yet contain a release profile also doing GPG signing
  • Loading branch information
poikilotherm committed Nov 2, 2022
1 parent b776f2d commit 9011c05
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@ on:
branches:
- main
- develop
- 'develop-jakartaee-*'

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
- run: ./mvnw --batch-mode -s .github/settings.xml -DperformRelease -DskipTests -Dgpg.skip=true deploy
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish snapshot
run: mvn deploy -DskipTests
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
48 changes: 48 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
<version.arquillian.drone>2.5.5</version.arquillian.drone>

<version.wildfly>26.1.1.Final</version.wildfly>

<!-- Official Maven Plugins -->
<version.maven-release-plugin>3.0.0-M6</version.maven-release-plugin>
<version.maven-flatten-plugin>1.3.0</version.maven-flatten-plugin>
<version.maven-gpg-plugin>3.0.1</version.maven-gpg-plugin>
<version.pomchecker-maven-plugin>1.3.0</version.pomchecker-maven-plugin>
<version.nexus-staging-plugin>1.6.13</version.nexus-staging-plugin>
</properties>

<modules>
Expand Down Expand Up @@ -83,6 +90,21 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.kordamp.maven</groupId>
<artifactId>pomchecker-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand All @@ -96,6 +118,7 @@
</checkModificationExcludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down Expand Up @@ -131,6 +154,31 @@
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.maven-release-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven-gpg-plugin}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${version.maven-flatten-plugin}</version>
</plugin>
<plugin>
<groupId>org.kordamp.maven</groupId>
<artifactId>pomchecker-maven-plugin</artifactId>
<version>${version.pomchecker-maven-plugin}</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${version.nexus-staging-plugin}</version>
</plugin>
</plugins>
</pluginManagement>

Expand Down

0 comments on commit 9011c05

Please sign in to comment.