Skip to content

Commit

Permalink
chore: add workflow to publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAtra committed Sep 5, 2023
1 parent 4baf832 commit 5eaa724
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to Maven Central
on:
release:
types:
- created

concurrency:
group: publish-maven-central

permissions:
contents: read

jobs:
publish:
name: Publish to Maven Central
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Publish package
run: mvn -B -ntp -Ppublish-ossrh clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,21 @@
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>publish-ossrh</id>

<distributionManagement>
<snapshotRepository>
<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>
</profile>
</profiles>
</project>

0 comments on commit 5eaa724

Please sign in to comment.