Skip to content

Commit

Permalink
build images
Browse files Browse the repository at this point in the history
  • Loading branch information
rvullriede committed Sep 9, 2024
1 parent 2ddec10 commit abc31bf
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 29 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ jobs:
distribution: 'temurin'
cache: 'maven'
- name: build-and-package
run: mvn -Pnative-jpackage clean package jpackage:jpackage
run: mvn -Pnative-jpackage clean verify

- name: get-cpu-architecture
shell: bash
run: |
ARCH=$(uname -m)
echo "CPU_ARCHITECTURE=$ARCH" >> $GITHUB_ENV
- name: build-and-package
uses: actions/upload-artifact@v4
- name: upload-to-release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: log-gazer-${{ env.CPU_ARCHITECTURE }}
path: target/dist/*
files: dist/*
75 changes: 57 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,6 @@
</plugins>
</build>
</profile>
<profile>
<id>native-jpackage</id>
<build>
<plugins>
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>${jpackage.maven.plugin.version}</version>
<configuration>
<destination>${project.build.directory}/dist</destination>
<input>${project.build.directory}</input>
<mainJar>${project.artifactId}-${project.version}.jar</mainJar>
<mainClass>${mainClass}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>win</id>
<activation>
Expand Down Expand Up @@ -187,6 +169,63 @@
</plugins>
</build>
</profile>
<profile>
<id>native-jpackage</id>
<build>
<plugins>
<plugin>
<groupId>org.panteleyev</groupId>
<artifactId>jpackage-maven-plugin</artifactId>
<version>${jpackage.maven.plugin.version}</version>
<configuration>
<destination>${project.build.directory}/dist</destination>
<input>${project.build.directory}</input>
<mainJar>${project.artifactId}-${project.version}.jar</mainJar>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jpackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>rename-artifact</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Define Properties for OS and Architecture -->
<property name="os.classifier" value="${os.detected.classifier}"/>

<!-- Rename all files in /target/dist -->
<fileset dir="${project.build.directory}/dist">
<!-- Include all files in the directory -->
<include name="*.*"/>
</fileset>

<move todir="${project.build.directory}/dist">
<fileset dir="${project.build.directory}/dist"/>
<mapper type="regexp" from="^(.*)\.(.*)$" to="\1-${os.classifier}.\2" />
</move>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand Down

0 comments on commit abc31bf

Please sign in to comment.