This is an automated email from the ASF dual-hosted git repository.

tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/main by this push:
     new a4c08551c NO-ISSUE: Change the publication method of JIT Executor 
native binaries from NPM package to OS-specific Maven modules (#2041)
a4c08551c is described below

commit a4c08551cb3aeb15461ba1aab19a1338c670cf61
Author: Tiago Bento <[email protected]>
AuthorDate: Thu May 9 18:06:30 2024 -0400

    NO-ISSUE: Change the publication method of JIT Executor native binaries 
from NPM package to OS-specific Maven modules (#2041)
    
    * Add jitexecutor-native module
    
    * Revert unnecessary changes
    
    * Adding headers
    
    * Place binary inside JAR with classifier 'binaries'
    
    * Remove new modules from bom
    
    * Reverting some changes
    
    * Prevent jitexecutor-native-linux from building on macOS
    
    * Dry-run for publish-jitexecutor-native.yml
    
    * Oops
    
    ---------
    
    Co-authored-by: Luiz João Motta <[email protected]>
---
 .github/workflows/publish-jitexecutor-native.yml   |  92 ++++++----------
 .../jitexecutor-native-darwin/pom.xml              |  47 +++++++++
 .../jitexecutor-native-linux/pom.xml               |  47 +++++++++
 .../jitexecutor-native-win32/pom.xml               |  47 +++++++++
 jitexecutor-native/pom.xml                         | 117 +++++++++++++++++++++
 jitexecutor/jitexecutor-runner/pom.xml             |  37 +------
 kogito-apps-bom/pom.xml                            |   2 +-
 pom.xml                                            |   6 ++
 8 files changed, 298 insertions(+), 97 deletions(-)

diff --git a/.github/workflows/publish-jitexecutor-native.yml 
b/.github/workflows/publish-jitexecutor-native.yml
index 4ca033a8d..bab4aae0a 100644
--- a/.github/workflows/publish-jitexecutor-native.yml
+++ b/.github/workflows/publish-jitexecutor-native.yml
@@ -1,22 +1,20 @@
 name: "Publish jitexecutor-native"
 
 on:
+  pull_request:
+    branches: ["**"]
+    paths:
+      - ".github/workflows/publish-jitexecutor-native.yml"
   workflow_dispatch:
     inputs:
       kogito_runtime_version:
         description: "Kogito Runtime version"
         required: true
-      npm_version:
-        description: "NPM Version"
-        required: true
-      npm_tag:
-        description: "NPM Tag"
-        required: true
   schedule:
-    - cron: '0 16 * * 0' # Every sunday at 4:00PM
+    - cron: "0 16 * * 0" # Every sunday at 4:00PM
 
 jobs:
-  build_jitexecutor_native_binaries:
+  build_jitexecutor_native:
     runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: true
@@ -31,19 +29,15 @@ jobs:
 
       - name: Set version
         id: version
-        run: | 
+        run: |
           if [ ${{ github.event_name }} == "schedule" ]; then
             VERSION="999-${{ steps.date.outputs.CURRENT_DATE }}"
             echo "TAG=$VERSION" >> "$GITHUB_OUTPUT"
             echo "PROJECT_VERSION=$VERSION-SNAPSHOT" >> "$GITHUB_OUTPUT"
-            echo "NPM_VERSION=999.0.0-${{ steps.date.outputs.CURRENT_DATE 
}}-SNAPSHOT" >> "$GITHUB_OUTPUT"
-            echo "NPM_TAG=dev" >> "$GITHUB_OUTPUT"
           else
             VERSION="${{ github.event.inputs.kogito_runtime_version }}"
             echo "TAG=${VERSION//-SNAPSHOT/}" >> "$GITHUB_OUTPUT"
             echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
-            echo "NPM_VERSION=${{ github.event.inputs.npm_version }}" >> 
"$GITHUB_OUTPUT"
-            echo "NPM_TAG=${{ github.event.inputs.npm_tag }}" >> 
"$GITHUB_OUTPUT"
           fi
         shell: bash
 
@@ -58,9 +52,9 @@ jobs:
           ref: ${{ steps.version.outputs.TAG }}
 
       - name: "Set up Maven"
-        uses: stCarolas/[email protected]
+        uses: stCarolas/setup-maven@v5
         with:
-          maven-version: 3.9.3
+          maven-version: 3.9.6
 
       - name: "Set up JDK 17"
         if: runner.os != 'Windows'
@@ -81,7 +75,13 @@ jobs:
           gu install native-image && \
           mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ 
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true 
-DgenerateBackupPoms=false
           mvn -B -fae -ntp -N -e versions:update-child-modules 
-DallowSnapshots=true -DgenerateBackupPoms=false
-          mvn clean package -B -ntp -DskipTests -f ./jitexecutor && mvn clean 
package -B -ntp -DskipTests -Pnative -am -f ./jitexecutor
+          mvn clean install -B -ntp -DskipTests -pl 
jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native
+
+      - name: "Publish macOS"
+        if: github.event_name != 'pull_request' && runner.os == 'macOS'
+        shell: bash
+        run: |
+          echo "Publishing macOS..."
 
       - name: "Build Linux"
         if: runner.os == 'Linux'
@@ -94,7 +94,13 @@ jobs:
           gir1.2-appindicator3-0.1 && \
           mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ 
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true 
-DgenerateBackupPoms=false
           mvn -B -fae -ntp -N -e versions:update-child-modules 
-DallowSnapshots=true -DgenerateBackupPoms=false
-          mvn clean package -B -ntp -DskipTests -f ./jitexecutor && mvn clean 
package -B -ntp -DskipTests -Pnative -am -f ./jitexecutor
+          mvn clean install -B -ntp -DskipTests -pl 
jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native
+
+      - name: "Publish Linux"
+        if: github.event_name != 'pull_request' && runner.os == 'Linux'
+        shell: bash
+        run: |
+          echo "Publishing Linux..."
 
       - name: "Configure Pagefile"
         if: runner.os == 'Windows'
@@ -125,52 +131,16 @@ jobs:
         run: |
           mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ 
steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true 
-DgenerateBackupPoms=false
           mvn -B -fae -ntp -N -e versions:update-child-modules 
-DallowSnapshots=true -DgenerateBackupPoms=false
-          mvn clean package -B -ntp -DskipTests -f ./jitexecutor && mvn clean 
package -B -ntp -DskipTests -Pnative -am -f ./jitexecutor
+          mvn clean install -B -ntp -DskipTests -pl 
jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native
+      
+      - name: "Publish Windows"
+        if: github.event_name != 'pull_request' && runner.os == 'Windows'
+        shell: bash
+        run: |
+          echo "Publishing Windows..."
 
       - name: "Upload JIT Executor binary"
         uses: actions/upload-artifact@v4
         with:
           name: jitexecutor_${{ runner.os }}
-          path: ./jitexecutor/jitexecutor-runner/target/jitexecutor-runner-${{ 
steps.version.outputs.PROJECT_VERSION }}-run*
-
-    outputs:
-      package_version: ${{ steps.version.outputs.PROJECT_VERSION }}
-      npm_version: ${{ steps.version.outputs.NPM_VERSION }}
-      npm_tag: ${{ steps.version.outputs.NPM_TAG }}
-
-  pack_and_publish:
-    runs-on: ubuntu-latest
-    needs: [build_jitexecutor_native_binaries]
-    steps:
-      - name: "Checkout kie-kogito-apps"
-        uses: actions/checkout@v4
-
-      - name: "Download Windows binary"
-        uses: actions/download-artifact@v4
-        with:
-          name: jitexecutor_Windows
-          path: 
./.github/supporting-files/publish_jitexecutor_native/dist/win32
-
-      - name: "Download macOS binary"
-        uses: actions/download-artifact@v4
-        with:
-          name: jitexecutor_macOS
-          path: 
./.github/supporting-files/publish_jitexecutor_native/dist/darwin
-
-      - name: "Download Linux binary"
-        uses: actions/download-artifact@v4
-        with:
-          name: jitexecutor_Linux
-          path: 
./.github/supporting-files/publish_jitexecutor_native/dist/linux
-
-      - name: "Pack and publish"
-        working-directory: 
./.github/supporting-files/publish_jitexecutor_native
-        env:
-          NPM_TOKEN: ${{ secrets.KIEGROUP_NPM_TOKEN }}
-        run: |
-          mv ./dist/linux/jitexecutor-runner-${{ 
needs.build_jitexecutor_native_binaries.outputs.package_version }}-runner 
./dist/linux/jitexecutor
-          mv ./dist/darwin/jitexecutor-runner-${{ 
needs.build_jitexecutor_native_binaries.outputs.package_version }}-runner 
./dist/darwin/jitexecutor
-          mv ./dist/win32/jitexecutor-runner-${{ 
needs.build_jitexecutor_native_binaries.outputs.package_version }}-runner.exe 
./dist/win32/jitexecutor.exe
-          npm version ${{ 
needs.build_jitexecutor_native_binaries.outputs.npm_version }}
-          echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
-          npm publish --tag ${{ 
needs.build_jitexecutor_native_binaries.outputs.npm_tag }} --access public
+          path: 
./jitexecutor-native/jitexecutor-native-*/target/jitexecutor-native-*-${{ 
steps.version.outputs.PROJECT_VERSION }}-run*
diff --git a/jitexecutor-native/jitexecutor-native-darwin/pom.xml 
b/jitexecutor-native/jitexecutor-native-darwin/pom.xml
new file mode 100644
index 000000000..4dd67713d
--- /dev/null
+++ b/jitexecutor-native/jitexecutor-native-darwin/pom.xml
@@ -0,0 +1,47 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.kie.kogito</groupId>
+    <artifactId>jitexecutor-native</artifactId>
+    <version>999-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>jitexecutor-native-darwin</artifactId>
+  <packaging>jar</packaging>
+  <name>Kogito Apps :: JIT Executor Native :: Darwin</name>
+
+  <properties>
+    <jitexecutor.native.skip>false</jitexecutor.native.skip>
+    
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.kie.kogito</groupId>
+      <artifactId>jitexecutor-runner</artifactId>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/jitexecutor-native/jitexecutor-native-linux/pom.xml 
b/jitexecutor-native/jitexecutor-native-linux/pom.xml
new file mode 100644
index 000000000..e88b81f1c
--- /dev/null
+++ b/jitexecutor-native/jitexecutor-native-linux/pom.xml
@@ -0,0 +1,47 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.kie.kogito</groupId>
+    <artifactId>jitexecutor-native</artifactId>
+    <version>999-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>jitexecutor-native-linux</artifactId>
+  <packaging>jar</packaging>
+  <name>Kogito Apps :: JIT Executor Native :: Linux</name>
+
+  <properties>
+    <jitexecutor.native.skip>false</jitexecutor.native.skip>
+    
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.kie.kogito</groupId>
+      <artifactId>jitexecutor-runner</artifactId>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/jitexecutor-native/jitexecutor-native-win32/pom.xml 
b/jitexecutor-native/jitexecutor-native-win32/pom.xml
new file mode 100644
index 000000000..a6e61c578
--- /dev/null
+++ b/jitexecutor-native/jitexecutor-native-win32/pom.xml
@@ -0,0 +1,47 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.kie.kogito</groupId>
+    <artifactId>jitexecutor-native</artifactId>
+    <version>999-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>jitexecutor-native-win32</artifactId>
+  <packaging>jar</packaging>
+  <name>Kogito Apps :: JIT Executor Native :: Win32</name>
+  
+  <properties>
+    <jitexecutor.native.skip>false</jitexecutor.native.skip>
+    
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.kie.kogito</groupId>
+      <artifactId>jitexecutor-runner</artifactId>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/jitexecutor-native/pom.xml b/jitexecutor-native/pom.xml
new file mode 100644
index 000000000..38fbe6319
--- /dev/null
+++ b/jitexecutor-native/pom.xml
@@ -0,0 +1,117 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <parent>
+    <groupId>org.kie.kogito</groupId>
+    <artifactId>kogito-apps-build-parent</artifactId>
+    <version>999-SNAPSHOT</version>
+    <relativePath>../kogito-apps-build-parent/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>jitexecutor-native</artifactId>
+  <name>Kogito Apps :: JIT Executor Native</name>
+  <packaging>pom</packaging>
+
+  <properties>
+    <java.module.name>org.kie.kogito.jitexecutor.runner</java.module.name>
+    <jitexecutor.native.skip>true</jitexecutor.native.skip>
+    <quarkus.package.type>native</quarkus.package.type>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>io.quarkus</groupId>
+        <artifactId>quarkus-maven-plugin</artifactId>
+        <configuration>
+          <skipOriginalJarRename>true</skipOriginalJarRename>
+          <skip>${jitexecutor.native.skip}</skip>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <goal>build</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+            <configuration>
+              <classesDirectory>${project.build.directory}</classesDirectory>
+              <classifier>binaries</classifier>
+              <includes>
+                <include>jitexecutor-native-*-${project.version}-run*</include>
+              </includes>
+              <forceCreation>true</forceCreation>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>platform-windows</id>
+      <activation>
+        <os>
+          <family>windows</family>
+        </os>
+      </activation>
+      <modules>
+        <module>jitexecutor-native-win32</module>
+      </modules>
+    </profile>
+    <profile>
+      <id>platform-darwin</id>
+      <activation>
+        <os>
+          <family>mac</family>
+        </os>
+      </activation>
+      <modules>
+        <module>jitexecutor-native-darwin</module>
+      </modules>
+    </profile>
+    <profile>
+      <id>platform-linux</id>
+      <activation>
+        <os>
+          <name>Linux</name>
+        </os>
+      </activation>
+      <modules>
+        <module>jitexecutor-native-linux</module>
+      </modules>
+    </profile>
+  </profiles>
+</project>
\ No newline at end of file
diff --git a/jitexecutor/jitexecutor-runner/pom.xml 
b/jitexecutor/jitexecutor-runner/pom.xml
index 867e0ca8e..3b51f2eff 100644
--- a/jitexecutor/jitexecutor-runner/pom.xml
+++ b/jitexecutor/jitexecutor-runner/pom.xml
@@ -20,8 +20,8 @@
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0";
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <parent>
     <artifactId>jitexecutor</artifactId>
     <groupId>org.kie.kogito</groupId>
@@ -147,37 +147,4 @@
       </plugin>
     </plugins>
   </build>
-  <profiles>
-    <profile>
-      <id>native</id>
-      <activation>
-        <property>
-          <name>native</name>
-        </property>
-      </activation>
-      <properties>
-        <quarkus.package.type>native</quarkus.package.type>
-      </properties>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-failsafe-plugin</artifactId>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>integration-test</goal>
-                  <goal>verify</goal>
-                </goals>
-                <configuration combine.self="override">
-                  <systemProperties>
-                    
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
-                  </systemProperties>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
 </project>
\ No newline at end of file
diff --git a/kogito-apps-bom/pom.xml b/kogito-apps-bom/pom.xml
index 1915a8688..90fce247c 100644
--- a/kogito-apps-bom/pom.xml
+++ b/kogito-apps-bom/pom.xml
@@ -965,7 +965,7 @@
                 <version>${project.version}</version>
                 <classifier>javadoc</classifier>
             </dependency>
-
+            
         </dependencies>
     </dependencyManagement>
 
diff --git a/pom.xml b/pom.xml
index 1382b6266..1136ee2e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,5 +104,11 @@
         <module>trusty</module>
       </modules>
     </profile>
+    <profile>
+      <id>jitexecutor-native</id>
+      <modules>
+        <module>jitexecutor-native</module>
+      </modules>
+    </profile>
   </profiles>
 </project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to