From 064819e2ad19a31030d846274179b06fd3b00e07 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Tue, 2 Jan 2024 14:34:11 -0500 Subject: [PATCH 1/2] Updated to v0.0.2 with windows package script. --- .github/workflows/run-tests.yaml | 5 +++-- design/perfin-logo_256.ico | Bin 0 -> 4286 bytes pom.xml | 2 +- scripts/package-linux-deb.sh | 6 +++++- scripts/package-windows-msi.ps1 | 25 ++++++++++++++++++++++++- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 design/perfin-logo_256.ico diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 506feeb..92b5209 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -37,12 +37,13 @@ jobs: - name: Build Windows MSI Package for Release if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }} - run: powershell.exe -File scripts/package-windows-msi.ps1 + run: powershell.exe -File scripts\package-windows-msi.ps1 - name: Create Release if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: softprops/action-gh-release@v1 with: - fail_on_unmatched_files: false + fail_on_unmatched_files: true files: | *.deb + *.msi diff --git a/design/perfin-logo_256.ico b/design/perfin-logo_256.ico new file mode 100644 index 0000000000000000000000000000000000000000..389ecbfd3cf6a951cde096075aaa394a0f87b301 GIT binary patch literal 4286 zcmcgw=~IIGEb+V-jBifGoP&a`N`jBV3qP0eVEpzNRt$l{V4vUp`P zzf?92nOilP<&p^@_Mv~knVP9Djef3iPS5i@?|WbF^?k2=3g+;7&pq$&`7O_R&hMy{ z55ENkihtFKX-Z93N$eV27kbCnJ>tkY8t3~DuWJ&q4{45PQz55g*-e}PHT+{mX)Z7*9QYxZB1t| z2ODFPursC;kN%)%SHGwq-1wNz*tKVp_{I;!d5%6L^j!r0{N!L+sH>=akC9E-ZgS^S#+sEA-55@9FH8DxJRPfKKT?i8!voSGPE9A4YGH z55PWw0XrNqJ|I@sBzXn1H$Kqz13T*t25iyp%x&+BJ#x>~f0e{e{xRQ4N4`O> z4vBw~8@x9Q9QF5}^YCHh&fVC+$9v2-?Pa#_M9hnjhbo=We+4xihpp?v|5-H_{_efj zJoz_{yblW}OnpLP!;1^9_^6?9dgzAihm76(G_(n}?LBVz7>#d#2Yz84{U$!^5NKRy z?JJvm&eIK_`ygZYehp2OywVnVZ?uk_z8C&DG-&|5SzzUIE%fS=YYp7+IagS|SaKL> zdHWwy^4||0bPfHycqrd00=rZ?%=mYX08VnsK z=czfF?X8IWLR{?0=ASuDJ^Y#MMbRH>kmwM&2HneQ-3~6U2Isa4@2QO@-|@~L!-M$o zhj7+yH1(tQ@H_%ua`#uj={50**0kd6t2O#y`DN$#UQcg)oU7F@K)Y?-8`CLWU!VpX zaK0^(K|h!W;Q{gPk?o@MW>vtp+% zc;Vwa_%XX`xt`Y1EKSR)!H9EEPQ^ODy{XdB>cD?*PXHb9S3wey*7fv3m{?qEe zZOqsw^RNtiu}(7=)KnYS=CC|*zVc4QJ;C0I+979com.andrewlalis perfin - 0.0.1-SNAPSHOT + 0.0.2 21 diff --git a/scripts/package-linux-deb.sh b/scripts/package-linux-deb.sh index 21ee25c..cb57274 100755 --- a/scripts/package-linux-deb.sh +++ b/scripts/package-linux-deb.sh @@ -11,13 +11,15 @@ function join_by { fi } +# Fix because H2 is not modular: +rm target/lib/h2-*.jar + # Gets a ":"-separated string of all the dependency jar-files. module_jar_files=(target/lib/*) module_jar_files_path=$(join_by ":" ${module_jar_files[@]}) module_path="target/classes:$module_jar_files_path" # Fix because H2 is not modular: -rm target/lib/h2-*.jar module_path="$module_path:target/modules/h2-2.2.224.jar" jpackage \ @@ -26,9 +28,11 @@ jpackage \ --description "Desktop application for personal finance. Add your accounts, track transactions, and store receipts, invoices, and more." \ --icon design/perfin-logo_256.png \ --vendor "Andrew Lalis" \ + --about-url https://github.com/andrewlalis/perfin \ --module com.andrewlalis.perfin/com.andrewlalis.perfin.PerfinApp \ --module-path $module_path \ --add-modules com.h2database \ + --type deb \ --linux-deb-maintainer "andrewlalisofficial@gmail.com" \ --linux-shortcut \ --linux-menu-group "Office;Finance;Java" \ diff --git a/scripts/package-windows-msi.ps1 b/scripts/package-windows-msi.ps1 index 948f8d5..a6ac6ce 100644 --- a/scripts/package-windows-msi.ps1 +++ b/scripts/package-windows-msi.ps1 @@ -2,4 +2,27 @@ $projectDir = $PSScriptRoot ./mvnw.cmd clean package -$modules = Get-ChildItem -Path target/lib -Name | ForEach-Object { "lib\$_" } +# Fix because H2 is not modular: +Remove-Item -Path target\lib\h2-*.jar -Force + +$modules = Get-ChildItem -Path target\lib -Name | ForEach-Object { "target\lib\$_" } +$modulePath = $modules -join ';' +$modulePath = "target\classes;$modulePath" + +# Fix because H2 is not modular: +$modulePath = "$modulePath;target\modules\h2-2.2.224.jar" + +jpackage ` + --name "Perfin" ` + --app-version "0.0.1" ` + --description "Desktop application for personal finance. Add your accounts, track transactions, and store receipts, invoices, and more." ` + --icon design\perfin-logo_256.ico ` + --vendor "Andrew Lalis" ` + --about-url https://github.com/andrewlalis/perfin ` + --module com.andrewlalis.perfin/com.andrewlalis.perfin.PerfinApp ` + --module-path $modulePath ` + --add-modules com.h2database ` + --type msi ` + --win-menu ` + --win-shortcut-prompt ` + --win-help-url https://github.com/andrewlalis/perfin ` From 8c8e6c3778633b47ef9ed8588cca5548567d7653 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Tue, 2 Jan 2024 10:03:20 -0500 Subject: [PATCH 2/2] Make new release workflow, upload version 0.0.3 --- .github/workflows/make-release.yaml | 77 +++++++++++++++++++++++++++++ .github/workflows/run-tests.yaml | 27 +--------- pom.xml | 2 +- scripts/package-windows-msi.ps1 | 2 - 4 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/make-release.yaml diff --git a/.github/workflows/make-release.yaml b/.github/workflows/make-release.yaml new file mode 100644 index 0000000..8901831 --- /dev/null +++ b/.github/workflows/make-release.yaml @@ -0,0 +1,77 @@ +name: Make Release +on: + push: + tags: + - "v*" +jobs: + make-linux-deb: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + cache: maven + + - name: Build Linux DEB Package for Release + run: ./scripts/package-linux-deb.sh + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: linux-deb + path: '*.deb' + if-no-files-found: error + retention-days: 1 + compression-level: 0 + + make-windows-msi: + runs-on: windows-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + cache: maven + + - name: Build Windows MSI Package for Release + if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }} + run: powershell.exe -File scripts\package-windows-msi.ps1 + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: windows-msi + path: '*.msi' + if-no-files-found: error + retention-days: 1 + compression-level: 0 + + make-release: + needs: + - make-linux-deb + - make-windows-msi + runs-on: ubuntu-latest + steps: + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: release-artifacts + merge-multiple: true + - name: List Artifacts + run: ls -R release-artifacts + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + fail-on-unmatched-files: true + files: | + release-artifacts/*.deb + release-artifacts/*.msi diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 92b5209..25e0d6c 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -3,13 +3,11 @@ on: push: branches: - "*" - tags: - - "v*" jobs: maven-tests: strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout Repository @@ -22,28 +20,5 @@ jobs: distribution: temurin cache: maven - - name: Check versions - run: | - java -version - javac -version - ./mvnw -version - - name: Test with Maven run: ./mvnw -B verify --file pom.xml - - - name: Build Linux DEB Package for Release - if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' }} - run: ./scripts/package-linux-deb.sh - - - name: Build Windows MSI Package for Release - if: ${{ startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' }} - run: powershell.exe -File scripts\package-windows-msi.ps1 - - - name: Create Release - if: ${{ startsWith(github.ref, 'refs/tags/') }} - uses: softprops/action-gh-release@v1 - with: - fail_on_unmatched_files: true - files: | - *.deb - *.msi diff --git a/pom.xml b/pom.xml index e02880d..49bb2e8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.andrewlalis perfin - 0.0.2 + 0.0.3 21 diff --git a/scripts/package-windows-msi.ps1 b/scripts/package-windows-msi.ps1 index a6ac6ce..ba8843f 100644 --- a/scripts/package-windows-msi.ps1 +++ b/scripts/package-windows-msi.ps1 @@ -1,5 +1,3 @@ -$projectDir = $PSScriptRoot - ./mvnw.cmd clean package # Fix because H2 is not modular: