diff --git a/.github/workflows/maven.yml b/.github/workflows/maven-build.yml similarity index 88% rename from .github/workflows/maven.yml rename to .github/workflows/maven-build.yml index 5ccae54e..dd3b534e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven-build.yml @@ -16,7 +16,7 @@ on: jobs: build: - + name: Build, test and publish to Github Packages runs-on: ubuntu-latest steps: @@ -31,10 +31,6 @@ jobs: cache: maven - name: Build with Maven run: mvn -B package --file pom.xml - - name: publish artifacts to Github Packages - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml - env: - GITHUB_TOKEN: ${{ github.token }} # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Update dependency graph diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml new file mode 100644 index 00000000..ba4ebc2b --- /dev/null +++ b/.github/workflows/maven-release.yml @@ -0,0 +1,27 @@ +name: Deploy to maven central + +on: + release: + types: [ "created" ] + +jobs: + build: + name: Build, test and publish to Github Packages + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Docker Compose Action + uses: isbang/compose-action@v1.5.1 + - name: Set up JDK 17 and Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: publish to maven central + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index f6ab548c..72f26edc 100644 --- a/pom.xml +++ b/pom.xml @@ -87,10 +87,10 @@ - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - + + + + ossrh https://oss.sonatype.org/service/local/staging/deploy/maven2/