diff --git a/.github/workflows/pre-release-ci.yml b/.github/workflows/pre-release-ci.yml index 664e97c..c028fa7 100644 --- a/.github/workflows/pre-release-ci.yml +++ b/.github/workflows/pre-release-ci.yml @@ -16,20 +16,37 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: Set up JDK 1.8 + - name: Set up Java for publishing to Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Deploy pre-release version to the Maven Central Repository + run: | + pre_release_version=${{ github.event.release.tag_name }} + echo Pre-release version $pre_release_version + mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false + mvn versions:commit + mvn clean deploy -Pdeploy2Maven -DskipTests -B -V + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + - name: Set up Java for publishing to GitHub Packages uses: actions/setup-java@v1 with: java-version: 1.8 server-id: github server-username: GITHUB_ACTOR server-password: GITHUB_TOKEN - - name: Deploy pre-release version + - name: Deploy pre-release version to GitHub Packages run: | pre_release_version=${{ github.event.release.tag_name }} echo Pre-release version $pre_release_version mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false mvn versions:commit - mvn clean deploy -B -V + mvn clean deploy -Pdeploy2Github -DskipTests -B -V env: GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }} - name: Rollback pre-release (remove tag) diff --git a/pom.xml b/pom.xml index d62abd3..df13c62 100644 --- a/pom.xml +++ b/pom.xml @@ -20,14 +20,6 @@ - - - github - GitHub Packages - https://maven.pkg.github.com/scalecube/scalecube-parent - - - https://scalecube.io scm:git:https://github.com/scalecube/scalecube-parent.git @@ -396,6 +388,26 @@ false + + deploy2Github + + + github + GitHub Packages + https://maven.pkg.github.com/scalecube/scalecube-parent + + + + + deploy2Maven + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + +