Fix set-version.sh's handling of NPM versions (#23638)

This introduces a maven property, `project.version.npm`, to allow maven to know what NPM version is, in scenarios that it's not identical to `project.version`. This occurs when the set-version's semver translation code is activated

Closes #23635
This commit is contained in:
Alex Szczuczko 2023-10-04 00:00:53 -06:00 committed by GitHub
parent 1332e53a97
commit 7953085ed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -83,8 +83,8 @@
</goals> </goals>
<configuration> <configuration>
<artifacts> <artifacts>
<artifact>${project.basedir}/assembly.xml <artifact>
<file>target/keycloak-js-${project.version}.tgz</file> <file>target/keycloak-js-${project.version.npm}.tgz</file>
<type>tar.gz</type> <type>tar.gz</type>
</artifact> </artifact>
</artifacts> </artifacts>

View file

@ -35,6 +35,8 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<project.version.npm>999.0.0-SNAPSHOT</project.version.npm>
<asciidoctor.plugin.version>1.5.8</asciidoctor.plugin.version> <asciidoctor.plugin.version>1.5.8</asciidoctor.plugin.version>
<jboss.repo.nexusUrl>https://s01.oss.sonatype.org/</jboss.repo.nexusUrl> <jboss.repo.nexusUrl>https://s01.oss.sonatype.org/</jboss.repo.nexusUrl>

View file

@ -11,6 +11,7 @@ fi
# Maven # Maven
mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=*
mvn versions:set-property --non-recursive -Dproperty=project.version.npm -DnewVersion="$NEW_NPM_VERSION"
# Docker # Docker
sed -i "s/ENV KEYCLOAK_VERSION .*/ENV KEYCLOAK_VERSION $NEW_VERSION/" quarkus/container/Dockerfile sed -i "s/ENV KEYCLOAK_VERSION .*/ENV KEYCLOAK_VERSION $NEW_VERSION/" quarkus/container/Dockerfile
@ -29,3 +30,6 @@ echo "$(jq '. += {"version": "'$NEW_NPM_VERSION'"}' js/libs/keycloak-js/package.
# Keycloak Admin Client # Keycloak Admin Client
echo "$(jq '. += {"version": "'$NEW_NPM_VERSION'"}' js/libs/keycloak-admin-client/package.json)" > js/libs/keycloak-admin-client/package.json echo "$(jq '. += {"version": "'$NEW_NPM_VERSION'"}' js/libs/keycloak-admin-client/package.json)" > js/libs/keycloak-admin-client/package.json
echo "New Mvn Version: $NEW_VERSION" >&2
echo "New NPM Version: $NEW_NPM_VERSION" >&2