Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
58 changes: 39 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -533,16 +533,6 @@ limitations under the License.]]>
<arguments>run compile</arguments>
</configuration>
</execution>
<execution>
<id>yarn publish</id>
<phase>deploy</phase>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run publish-package</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
Expand All @@ -560,15 +550,6 @@ limitations under the License.]]>
<skip>true</skip>
</configuration>
</plugin>
<!-- Central Publishing Plugin for Maven Central deployment -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>

<!-- flatten-maven-plugin:flatten is bound to the process-resources phase and will create
a .flattened-pom.xml -->
Expand Down Expand Up @@ -624,6 +605,45 @@ limitations under the License.]]>
<npm.tag/>
</properties>
</profile>
<profile>
<id>publish-maven</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish-npm</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>yarn publish</id>
<phase>deploy</phase>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run publish-package</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gpg-sign</id>
<build>
Expand Down