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 d62abd3..c92b6c8 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 @@ -63,6 +55,8 @@ 3.2.0 3.1.2 2.7 + 1.6 + 1.6.8 google_checks.xml @@ -200,8 +194,17 @@ release release-@{project.version} deploy - ${env.GITHUB_ACTOR} - ${env.GITHUB_TOKEN} + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-maven-plugin.version} + true + + ossrh + https://oss.sonatype.org/ + true @@ -219,7 +222,7 @@ The reactor is not valid true - + @@ -268,6 +271,24 @@ + + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + --pinentry-mode + loopback + + + + + sign-artifacts + + sign + + + + com.spotify @@ -396,6 +417,37 @@ 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/ + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + + maven-gpg-plugin + + + +