diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 56c819c..d1f802d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -53,6 +53,7 @@ jobs:
with:
name: BUILD_FILES
path: |
+ stylesniffer-report-aggregate/target
stylesniffer-annotation-processor/target
stylesniffer-api/target
stylesniffer-impl/target
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..836fef9
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,38 @@
+name: Release
+on:
+ release:
+ types: [ created, published ]
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Java for publishing to Maven Central Repository
+ uses: actions/setup-java@v4
+ with:
+ java-version: '21'
+ distribution: 'temurin'
+ server-id: ossrh
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
+ gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ gpg-passphrase: GPG_PASSPHRASE # Env var that holds the key's passphrase
+ - if: github.event.release
+ name: Update version in pom.xml (Release only)
+ run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
+ - name: Publish to the Maven Central Repository
+ run: mvn --no-transfer-progress --batch-mode deploy -DperformRelease=true
+ env:
+ MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME_OSSRH }}
+ MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD_OSSRH }}
+ MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
+ GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
+ - name: Discord notification
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+ uses: Ilshidur/action-discord@master
+ with:
+ args: '{{ EVENT_PAYLOAD.repository.full_name }} version {{ EVENT_PAYLOAD.release.name }} is out!'
diff --git a/pom.xml b/pom.xml
index b96ea14..5f8365b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,8 @@
4.5
1.2.0
4.0.0.4121
+ 3.1.0
+ 1.7.0
@@ -163,6 +165,44 @@
+
+
+ release-sign-artifacts
+
+
+ performRelease
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${maven-gpg-plugin.version}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+
+
+
+
@@ -174,7 +214,17 @@
${java.sdk.version}
-
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ ${maven-staging-plugin.version}
+ true
+
+ ossrh
+ https://s01.oss.sonatype.org/
+ true
+
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -185,12 +235,32 @@
org.apache.maven.plugins
maven-source-plugin
${maven-source-plugin.version}
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
org.apache.maven.plugins
maven-javadoc-plugin
${maven-javadoc-plugin.version}
+
+ -Xdoclint:none
+ false
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
@@ -319,6 +389,14 @@
org.apache.maven.plugins
maven-compiler-plugin
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -354,4 +432,25 @@
+
+
+
+ central
+ https://repo1.maven.org/maven2
+
+
+
+
+ mavencentral
+ Maven central
+ https://repo.maven.apache.org/maven2
+
+
+
+
+
+ ossrh
+ https://s01.oss.sonatype.org/content/repositories/snapshots
+
+