diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2136ec14..ab6437c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,34 +4,35 @@ on: types: [created] jobs: publish: + environment: prod runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v3 -# - name: Set up Java for publishing to Maven Central Repository -# uses: actions/setup-java@v3 -# with: -# java-version: '20' -# distribution: 'temurin' -# server-id: ossrh -# server-username: MAVEN_USERNAME -# server-password: MAVEN_PASSWORD -# - name: Publish to the Maven Central Repository -# run: mvn --batch-mode deploy -# env: -# MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME_OSSRH }} -# MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD_OSSRH }} - - name: Set up Java for publishing to GitHub Packages + - name: Set up Java for publishing to Maven Central Repository uses: actions/setup-java@v3 with: java-version: '20' distribution: 'temurin' - - name: Publish to GitHub Packages + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish to the Maven Central Repository run: mvn --batch-mode deploy env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME_OSSRH }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD_OSSRH }} +# - name: Set up Java for publishing to GitHub Packages +# uses: actions/setup-java@v3 +# with: +# java-version: '20' +# distribution: 'temurin' +# - name: Publish to GitHub Packages +# run: mvn --batch-mode deploy +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -41,8 +42,7 @@ jobs: with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_SECRET }} - - - name: Build and push + - name: Build and push uses: docker/build-push-action@v4 with: context: . diff --git a/pom.xml b/pom.xml index 0fd7d1b7..d075f544 100644 --- a/pom.xml +++ b/pom.xml @@ -193,18 +193,18 @@ - - github - GitHub Packages - https://maven.pkg.github.com/sebastienvermeille/rika2mqtt - - - - - - - + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ +