diff --git a/.github/workflows/pre-release-ci.yml b/.github/workflows/pre-release-ci.yml index 664e97c..a7f3588 100644 --- a/.github/workflows/pre-release-ci.yml +++ b/.github/workflows/pre-release-ci.yml @@ -16,22 +16,42 @@ 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 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 -B -V env: GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }} + - 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 + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - 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 deploy -Pdeploy2Maven -DskipTests -B -V + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Rollback pre-release (remove tag) if: failure() run: git push origin :refs/tags/${{ github.event.release.tag_name }} diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index d674150..f4c7b08 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -19,7 +19,7 @@ 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 GitHub Packages uses: actions/setup-java@v1 with: java-version: 1.8 @@ -44,10 +44,30 @@ jobs: -Darguments="-DskipTests=true -Ddockerfile.skip=true" echo ::set-output name=release_tag::$(git describe --tags --abbrev=0) - name: Perform release - run: mvn -B release:perform -Darguments="-DskipTests=true -Ddockerfile.skip=true" + run: mvn -B release:perform -Pdeploy2Github -Darguments="-DskipTests=true -Ddockerfile.skip=true -Pdeploy2Github" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} + - 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 + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Deploy release version to the Maven Central Repository + run: | + release_version=$(echo ${{ steps.prepare_release.outputs.release_tag }} | sed "s/release-//") + echo release version $release_version + mvn versions:set -DnewVersion=$release_version -DgenerateBackupPoms=false + mvn versions:commit + mvn deploy -Pdeploy2Maven -DskipTests -B -V + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Rollback release if: failure() run: | diff --git a/pom.xml b/pom.xml index 4528e3b..0cb449f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 io.scalecube scalecube-parent-pom - 0.2.17 + 0.2.19 scalecube-gateway-parent @@ -48,14 +50,6 @@ - - - github - GitHub Packages - https://maven.pkg.github.com/scalecube/scalecube-gateway - - - https://github.com/scalecube/scalecube-gateway scm:git:https://github.com/scalecube/scalecube-gateway.git @@ -65,10 +59,10 @@ - 1.0.11 - 2.10.9 + 1.0.12 + 2.10.12 1.2.2 - 0.4.7 + 0.4.14 Dysprosium-SR9 1.0.1 @@ -280,4 +274,44 @@ + + + deploy2Github + + + github + GitHub Packages + https://maven.pkg.github.com/scalecube/scalecube-gateway + + + + + deploy2Maven + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + + maven-source-plugin + + + maven-javadoc-plugin + + + maven-gpg-plugin + + + + + +