diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1f6c18f..3cec5a50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ env: MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} MAVEN_CENTRAL_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} + GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }} GITHUB_ACTIONS_DEPLOY_TIMEOUT: 90 jobs: @@ -170,6 +171,15 @@ jobs: - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0 - name: "Build" run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V + - name: Import GPG key + env: + GPG_TTY: $(tty) + run: | + echo "${{ secrets.GPG_SIGNING_PRIVATE_KEY }}" | gpg --batch --import + echo "use-agent" >> ~/.gnupg/gpg.conf + echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf + echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf + gpg --batch --yes --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE --list-keys - name: "Publish" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn deploy $MAVEN_CLI_OPTS -DskipTests \ No newline at end of file + run: mvn --batch-mode clean deploy -P sdk-release -DskipTests=true -Dgpg.passphrase=$GPG_SIGNING_PASSPHRASE \ No newline at end of file diff --git a/pom.xml b/pom.xml index f54747ee..ce05abe5 100644 --- a/pom.xml +++ b/pom.xml @@ -330,12 +330,40 @@ sdk-release - - https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/latest - deploy site-deploy - + + + central-releases-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.8.0 + + + attach-javadocs + + jar + + + + org.apache.maven.plugins maven-gpg-plugin @@ -352,10 +380,22 @@ --pinentry-mode loopback + ${gpg.passphrase} + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + central-releases-staging + https://oss.sonatype.org/ + true + + org.apache.maven.plugins maven-release-plugin @@ -548,8 +588,8 @@ - central-releases-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2 + alfresco-public + https://nexus.alfresco.com/nexus/repository/releases alfresco-public-snapshots