diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 1d49fca..4d54b8e 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -53,7 +53,7 @@ jobs: - name: Build and Publish to Maven Central and NPM registry run: | - mvn -B deploy -Pgpg-sign -Drc.version=${{ github.run_number }} --file pom.xml --settings .github/workflows/maven/settings.xml + mvn -B deploy -Pgpg-sign,publish-npm,publish-maven -Drc.version=${{ github.run_number }} --file pom.xml --settings .github/workflows/maven/settings.xml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9f58fa2..f8e260d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -99,9 +99,22 @@ jobs: echo "Maven artifact exists: ${{ steps.check_maven.outputs.maven_exists }}" echo "Will publish: ${{ steps.check_npm.outputs.npm_exists == 'false' || steps.check_maven.outputs.maven_exists == 'false' }}" + - name: Compute Maven profiles + id: compute_profiles + run: | + PROFILES="gpg-sign,release-npm" + if [ "${{ steps.check_npm.outputs.npm_exists }}" = "false" ]; then + PROFILES="${PROFILES},publish-npm" + fi + if [ "${{ steps.check_maven.outputs.maven_exists }}" = "false" ]; then + PROFILES="${PROFILES},publish-maven" + fi + PROFILES="${PROFILES#,}" + echo "profiles=-P$PROFILES" >> $GITHUB_OUTPUT + - name: Build and Publish to Maven Central and NPM registry if: steps.check_npm.outputs.npm_exists == 'false' || steps.check_maven.outputs.maven_exists == 'false' - run: mvn -B deploy -Pgpg-sign -Prelease-npm --settings .github/workflows/maven/settings.xml + run: mvn -B deploy ${{ steps.compute_profiles.outputs.profiles }} --settings .github/workflows/maven/settings.xml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/pom.xml b/pom.xml index 39c976c..d210e64 100644 --- a/pom.xml +++ b/pom.xml @@ -533,16 +533,6 @@ limitations under the License.]]> run compile - - yarn publish - deploy - - yarn - - - run publish-package - - ${node.version} @@ -560,15 +550,6 @@ limitations under the License.]]> true - - - org.sonatype.central - central-publishing-maven-plugin - - central - true - - @@ -624,6 +605,45 @@ limitations under the License.]]> + + publish-maven + + + + org.sonatype.central + central-publishing-maven-plugin + true + + central + true + + + + + + + publish-npm + + + + com.github.eirslett + frontend-maven-plugin + + + yarn publish + deploy + + yarn + + + run publish-package + + + + + + + gpg-sign