mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-03-29 20:20:56 +02:00
Fix WT Compile issues and prepare auto release pipeline (#13)
* Fixup WinTest Error * Prepare CI/CD Auto Release Pipeline * Fix CI/CD Components not running * CI/CD Pre-Check n nighty and produce zip for more intutive User Design * fix Version * App Version Update. * More Similar Naming to old Convention
This commit is contained in:
145
.github/workflows/nightly-artifacts.yml
vendored
Normal file
145
.github/workflows/nightly-artifacts.yml
vendored
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
name: Nightly Runtime Artifacts
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: "20 2 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-windows-zip:
|
||||||
|
name: Build Windows ZIP Artifact
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Extract version from pom.xml
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$xml = [xml](Get-Content pom.xml)
|
||||||
|
$version = $xml.project.version
|
||||||
|
Add-Content -Path $env:GITHUB_ENV -Value "VERSION=$version"
|
||||||
|
|
||||||
|
- name: Set up Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Install WiX Toolset
|
||||||
|
shell: pwsh
|
||||||
|
run: choco install wixtoolset --no-progress -y
|
||||||
|
|
||||||
|
- name: Build JAR and copy runtime dependencies
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
.\mvnw.cmd -B -DskipTests package dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dist-libs
|
||||||
|
$jar = Get-ChildItem -Path target -Filter 'praktiKST-*.jar' | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
||||||
|
if (-not $jar) {
|
||||||
|
throw "No project JAR produced"
|
||||||
|
}
|
||||||
|
Copy-Item $jar.FullName target/dist-libs/app.jar
|
||||||
|
|
||||||
|
- name: Build app-image with jpackage
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
||||||
|
jpackage --type app-image --name praktiKST --input target/dist-libs --main-jar app.jar --main-class kst4contest.view.Kst4ContestApplication --module-path target/dist-libs --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql --dest dist
|
||||||
|
|
||||||
|
- name: Create Windows ZIP
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
if (-not (Test-Path dist/praktiKST)) {
|
||||||
|
throw "No Windows app-image produced by jpackage"
|
||||||
|
}
|
||||||
|
Compress-Archive -Path dist/praktiKST -DestinationPath dist/praktiKST-${{ env.VERSION }}-windows-x64.zip -Force
|
||||||
|
|
||||||
|
- name: Upload Windows ZIP artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nightly-windows-zip
|
||||||
|
path: dist/praktiKST-${{ env.VERSION }}-windows-x64.zip
|
||||||
|
retention-days: 14
|
||||||
|
|
||||||
|
build-linux-appimage:
|
||||||
|
name: Build Linux AppImage Artifact
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Extract version from pom.xml
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set up Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Ensure mvnw is executable
|
||||||
|
run: chmod +x mvnw
|
||||||
|
|
||||||
|
- name: Build JAR and copy runtime dependencies
|
||||||
|
run: |
|
||||||
|
./mvnw -B -DskipTests package dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dist-libs
|
||||||
|
cp "$(ls -t target/praktiKST-*.jar | head -n 1)" target/dist-libs/app.jar
|
||||||
|
|
||||||
|
- name: Build app-image with jpackage
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
jpackage \
|
||||||
|
--type app-image \
|
||||||
|
--name praktiKST \
|
||||||
|
--input target/dist-libs \
|
||||||
|
--main-jar app.jar \
|
||||||
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
|
--module-path target/dist-libs \
|
||||||
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql \
|
||||||
|
--dest dist
|
||||||
|
|
||||||
|
- name: Create AppDir metadata
|
||||||
|
run: |
|
||||||
|
rm -rf target/praktiKST.AppDir
|
||||||
|
cp -a dist/praktiKST target/praktiKST.AppDir
|
||||||
|
|
||||||
|
cat > target/praktiKST.AppDir/AppRun << 'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
HERE="$(dirname "$(readlink -f "$0")")"
|
||||||
|
exec "$HERE/bin/praktiKST" "$@"
|
||||||
|
EOF
|
||||||
|
chmod +x target/praktiKST.AppDir/AppRun
|
||||||
|
|
||||||
|
cat > target/praktiKST.AppDir/praktiKST.desktop << 'EOF'
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=praktiKST
|
||||||
|
Exec=praktiKST
|
||||||
|
Icon=praktiKST
|
||||||
|
Categories=Network;HamRadio;
|
||||||
|
Terminal=false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -f target/praktiKST.AppDir/lib/praktiKST.png ]; then
|
||||||
|
cp target/praktiKST.AppDir/lib/praktiKST.png target/praktiKST.AppDir/praktiKST.png
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build AppImage
|
||||||
|
run: |
|
||||||
|
wget -q -O target/appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||||
|
chmod +x target/appimagetool.AppImage
|
||||||
|
APPIMAGE_EXTRACT_AND_RUN=1 ARCH=x86_64 target/appimagetool.AppImage target/praktiKST.AppDir dist/praktiKST-${{ env.VERSION }}-linux-x86_64.AppImage
|
||||||
|
|
||||||
|
- name: Upload Linux AppImage artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nightly-linux-appimage
|
||||||
|
path: dist/praktiKST-${{ env.VERSION }}-linux-x86_64.AppImage
|
||||||
|
retention-days: 14
|
||||||
28
.github/workflows/pr-compile-check.yml
vendored
Normal file
28
.github/workflows/pr-compile-check.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: PR Compile Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
compile:
|
||||||
|
name: Compile (Java 17)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Ensure mvnw is executable
|
||||||
|
run: chmod +x mvnw
|
||||||
|
|
||||||
|
- name: Compile
|
||||||
|
run: ./mvnw -B -DskipTests compile
|
||||||
164
.github/workflows/tagged-release.yml
vendored
Normal file
164
.github/workflows/tagged-release.yml
vendored
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
name: Tagged Release Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-windows-zip:
|
||||||
|
name: Build Windows ZIP
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Install WiX Toolset
|
||||||
|
shell: pwsh
|
||||||
|
run: choco install wixtoolset --no-progress -y
|
||||||
|
|
||||||
|
- name: Build JAR and copy runtime dependencies
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
.\mvnw.cmd -B -DskipTests package dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dist-libs
|
||||||
|
$jar = Get-ChildItem -Path target -Filter 'praktiKST-*.jar' | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
||||||
|
if (-not $jar) {
|
||||||
|
throw "No project JAR produced"
|
||||||
|
}
|
||||||
|
Copy-Item $jar.FullName target/dist-libs/app.jar
|
||||||
|
|
||||||
|
- name: Build app-image with jpackage
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
||||||
|
jpackage --type app-image --name praktiKST --input target/dist-libs --main-jar app.jar --main-class kst4contest.view.Kst4ContestApplication --module-path target/dist-libs --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql --dest dist
|
||||||
|
|
||||||
|
- name: Create Windows ZIP
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
if (-not (Test-Path dist/praktiKST)) {
|
||||||
|
throw "No Windows app-image produced by jpackage"
|
||||||
|
}
|
||||||
|
Compress-Archive -Path dist/praktiKST -DestinationPath dist/praktiKST-${{ github.ref_name }}-windows-x64.zip -Force
|
||||||
|
|
||||||
|
- name: Upload Windows artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-zip
|
||||||
|
path: dist/praktiKST-${{ github.ref_name }}-windows-x64.zip
|
||||||
|
|
||||||
|
build-linux-appimage:
|
||||||
|
name: Build Linux AppImage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Java 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Ensure mvnw is executable
|
||||||
|
run: chmod +x mvnw
|
||||||
|
|
||||||
|
- name: Build JAR and copy runtime dependencies
|
||||||
|
run: |
|
||||||
|
./mvnw -B -DskipTests package dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dist-libs
|
||||||
|
cp "$(ls -t target/praktiKST-*.jar | head -n 1)" target/dist-libs/app.jar
|
||||||
|
|
||||||
|
- name: Build app-image with jpackage
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
jpackage \
|
||||||
|
--type app-image \
|
||||||
|
--name praktiKST \
|
||||||
|
--input target/dist-libs \
|
||||||
|
--main-jar app.jar \
|
||||||
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
|
--module-path target/dist-libs \
|
||||||
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql \
|
||||||
|
--dest dist
|
||||||
|
|
||||||
|
- name: Create AppDir metadata
|
||||||
|
run: |
|
||||||
|
rm -rf target/praktiKST.AppDir
|
||||||
|
cp -a dist/praktiKST target/praktiKST.AppDir
|
||||||
|
|
||||||
|
cat > target/praktiKST.AppDir/AppRun << 'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
HERE="$(dirname "$(readlink -f "$0")")"
|
||||||
|
exec "$HERE/bin/praktiKST" "$@"
|
||||||
|
EOF
|
||||||
|
chmod +x target/praktiKST.AppDir/AppRun
|
||||||
|
|
||||||
|
cat > target/praktiKST.AppDir/praktiKST.desktop << 'EOF'
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=praktiKST
|
||||||
|
Exec=praktiKST
|
||||||
|
Icon=praktiKST
|
||||||
|
Categories=Network;HamRadio;
|
||||||
|
Terminal=false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -f target/praktiKST.AppDir/lib/praktiKST.png ]; then
|
||||||
|
cp target/praktiKST.AppDir/lib/praktiKST.png target/praktiKST.AppDir/praktiKST.png
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build AppImage
|
||||||
|
run: |
|
||||||
|
wget -q -O target/appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||||
|
chmod +x target/appimagetool.AppImage
|
||||||
|
APPIMAGE_EXTRACT_AND_RUN=1 ARCH=x86_64 target/appimagetool.AppImage target/praktiKST.AppDir dist/praktiKST-${{ github.ref_name }}-linux-x86_64.AppImage
|
||||||
|
|
||||||
|
- name: Upload Linux artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux-appimage
|
||||||
|
path: dist/praktiKST-${{ github.ref_name }}-linux-x86_64.AppImage
|
||||||
|
|
||||||
|
release-tag:
|
||||||
|
name: Publish Tagged Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build-windows-zip
|
||||||
|
- build-linux-appimage
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download Windows artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-zip
|
||||||
|
path: release-assets/windows
|
||||||
|
|
||||||
|
- name: Download Linux artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux-appimage
|
||||||
|
path: release-assets/linux
|
||||||
|
|
||||||
|
- name: Create tagged release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: ${{ github.ref_name }}
|
||||||
|
name: Release ${{ github.ref_name }}
|
||||||
|
allowUpdates: false
|
||||||
|
replacesArtifacts: false
|
||||||
|
makeLatest: true
|
||||||
|
generateReleaseNotes: true
|
||||||
|
artifacts: release-assets/windows/praktiKST-${{ github.ref_name }}-windows-x64.zip,release-assets/linux/praktiKST-${{ github.ref_name }}-linux-x86_64.AppImage
|
||||||
8
pom.xml
8
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.x08</groupId>
|
<groupId>de.x08</groupId>
|
||||||
<artifactId>praktiKST</artifactId>
|
<artifactId>praktiKST</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.40.0-nightly</version>
|
||||||
|
|
||||||
<name>praktiKST</name>
|
<name>praktiKST</name>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<javafx.version>19.0.2.1</javafx.version>
|
<javafx.version>19.0.2.1</javafx.version>
|
||||||
<jetbrains.annotations.version>24.0.1</jetbrains.annotations.version>
|
<jetbrains.annotations.version>24.0.1</jetbrains.annotations.version>
|
||||||
<junit.version>5.10.1</junit.version>
|
<junit.version>5.10.1</junit.version>
|
||||||
<lombok.version>1.18.30</lombok.version>
|
<lombok.version>1.18.44</lombok.version>
|
||||||
<mockito.version>5.7.0</mockito.version>
|
<mockito.version>5.7.0</mockito.version>
|
||||||
<sqlite.version>3.43.2.2</sqlite.version>
|
<sqlite.version>3.43.2.2</sqlite.version>
|
||||||
|
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
<pmd.version>6.55.0</pmd.version>
|
<pmd.version>6.55.0</pmd.version>
|
||||||
<codehaus.version.plugin>2.16.1</codehaus.version.plugin>
|
<codehaus.version.plugin>2.16.1</codehaus.version.plugin>
|
||||||
<javafx.maven.plugin>0.0.8</javafx.maven.plugin>
|
<javafx.maven.plugin>0.0.8</javafx.maven.plugin>
|
||||||
<spotbugs.maven.plugin>4.8.1.0</spotbugs.maven.plugin>
|
<spotbugs.maven.plugin>4.9.8.2</spotbugs.maven.plugin>
|
||||||
<spotbugs.version>4.8.1</spotbugs.version>
|
<spotbugs.version>4.9.8</spotbugs.version>
|
||||||
|
|
||||||
<!-- other properties -->
|
<!-- other properties -->
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class ApplicationConstants {
|
|||||||
/**
|
/**
|
||||||
* Name of file to store preferences in.
|
* Name of file to store preferences in.
|
||||||
*/
|
*/
|
||||||
public static final double APPLICATION_CURRENTVERSIONNUMBER = 1.33;
|
public static final double APPLICATION_CURRENTVERSIONNUMBER = 1.40;
|
||||||
|
|
||||||
public static final String VERSIONINFOURLFORUPDATES_KST4CONTEST = "https://do5amf.funkerportal.de/kst4ContestVersionInfo.xml";
|
public static final String VERSIONINFOURLFORUPDATES_KST4CONTEST = "https://do5amf.funkerportal.de/kst4ContestVersionInfo.xml";
|
||||||
public static final String VERSIONINFDOWNLOADEDLOCALFILE = "kst4ContestVersionInfo.xml";
|
public static final String VERSIONINFDOWNLOADEDLOCALFILE = "kst4ContestVersionInfo.xml";
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ public class ReadUDPByWintestThread extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String formattedQRG = String.format(Locale.US, "%.1f", freqFloat);
|
String formattedQRG = String.format(Locale.US, "%.1f", freqFloat);
|
||||||
this.client.getChatPreferences().getMYQRG().set(formattedQRG);
|
this.client.getChatPreferences().getMYQRGFirstCat().set(formattedQRG);
|
||||||
|
|
||||||
System.out.println("[WinTest STATUS] stn=" + stn + ", mode=" + mode + ", qrg=" + formattedQRG);
|
System.out.println("[WinTest STATUS] stn=" + stn + ", mode=" + mode + ", qrg=" + formattedQRG);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user