Skip to content

Commit 4234e51

Browse files
authored
Merge pull request #581 from saalfeldlab/fix/build
This PR fixes a few major issues: - the previous update from paintera 1.13.0 to 1.13.1 include version bumps of a few dependencies. Unfortunately the onnxruntime dependency for windows was built against a different version of VC++ redist, and this was failing to load the dll at runtime. This effectively stopped SAM from working. This version builds against `zulu-fx` instead of `liberica-fx` which seems to have build against a compatible VC++ on windows - fix an issue with the splash screen not showing on first startup - introduce self-signed mac installers. It's not an official developer application signature, so it will still warn the user, but it will allow the application to be run - add `macos-14` installer, and plan to install the most recent 2 versions here on out
2 parents 2bd8967 + 438bff5 commit 4234e51

File tree

9 files changed

+80
-38
lines changed

9 files changed

+80
-38
lines changed

.github/workflows/build-installers.yml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@ on:
88
pull_request:
99
branches: [master]
1010

11-
env:
12-
DEV_IDENTITY: BXPZTQZ35S # Your Apple Dev identity, something like BXPZTQZ35S
13-
PRIMARY_BUNDLE_ID: org.janelia.saalfeldlab.Paintera # Unique to your app, often the launcher class
14-
1511
jobs:
1612
build:
1713
strategy:
1814
matrix:
19-
# currently macos-14 is M1 and macos-13 is intel
20-
os: [ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest, macos-15-intel]
15+
os: [ubuntu-22.04, ubuntu-24.04, windows-latest, macos-14, macos-15, macos-15-intel]
2116
runs-on: ${{ matrix.os }}
2217
steps:
2318
- name: Checkout
@@ -29,38 +24,60 @@ jobs:
2924
echo "VERSION=$short_version" >> $GITHUB_ENV
3025
- name: Download Wix
3126
uses: i3h/download-release-asset@v1
32-
if: matrix.os == 'windows-latest'
27+
if: runner.os == 'Windows'
3328
with:
3429
owner: wixtoolset
3530
repo: wix3
3631
tag: wix3112rtm
3732
file: wix311-binaries.zip
3833
- name: Decompress Wix
3934
uses: DuckSoft/extract-7z-action@v1.0
40-
if: matrix.os == 'windows-latest'
35+
if: runner.os == 'Windows'
4136
with:
4237
pathSource: wix311-binaries.zip
4338
pathTarget: ./target/wix
4439
- name: Add Wix to Path
4540
run: echo "$HOME/target/wix" >> $GITHUB_PATH
46-
if: matrix.os == 'windows-latest'
47-
- uses: actions/checkout@v6
41+
if: runner.os == 'Windows'
4842
- name: Set up JDK
4943
uses: actions/setup-java@v5
5044
with:
5145
java-version: 25
52-
distribution: 'liberica'
46+
distribution: 'zulu'
5347
java-package: jdk+fx
5448
cache: 'maven'
5549
- name: "Build with Maven"
56-
if: matrix.os != 'macos-13' && matrix.os != 'macos-14'
57-
run: mvn -B clean install -DskipTests -Pbuild-installer "-Dmatrix.os=${{ matrix.os }}" --file pom.xml
58-
- name: "Build with Maven (macOS No Signing)"
50+
if: runner.os != 'MacOS'
51+
run: mvn -B clean install -DskipTests -Pbuild-installer "-Dmatrix.os=${{ matrix.os }}" --file pom.xml --no-transfer-progress
52+
- name: "Setup MacOS Signing"
53+
if: runner.os == 'MacOS'
5954
env:
60-
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
61-
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
62-
if: ${{ env.MACOS_CERTIFICATE == null && (matrix.os == 'macos-13' || matrix.os == 'macos-14') }}
63-
run: mvn -B clean install -DskipTests -Pbuild-installer -Djavafx.platform=mac "-Dmatrix.os=${{ matrix.os }}" --file pom.xml
55+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
56+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
57+
run: |
58+
# Create variables
59+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
60+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
61+
KEYCHAIN_PASSWORD="temp-keychain-password"
62+
63+
# Import certificate and create keychain
64+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
65+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
66+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
67+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
68+
69+
# Import certificate to keychain
70+
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
71+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
72+
security list-keychain -d user -s $KEYCHAIN_PATH
73+
- name: "Build with Maven"
74+
if: runner.os == 'MacOS'
75+
run: mvn -B clean install -DskipTests -Pbuild-installer -Pmacos-sign -Djavafx.platform=mac "-Dmatrix.os=${{ matrix.os }}" --file pom.xml --no-transfer-progress
76+
- name: "Verify Signature"
77+
if: runner.os == 'MacOS'
78+
run: |
79+
codesign -dv --verbose=2 target/installer-work/image/Paintera.app 2>&1
80+
codesign -dv --verbose=2 target/installer-work/image/Paintera.app 2>&1 | grep -q "Authority=Developer ID Application: PainteraSelfSignedCert" || (echo "ERROR: App is not signed with expected certificate" && exit 1)
6481
6582
- name: Upload Installers
6683
uses: actions/upload-artifact@v4

.github/workflows/publish-installers.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ on:
1010
- "prerelease-*"
1111
workflow_dispatch:
1212

13-
14-
15-
env:
16-
DEV_IDENTITY: BXPZTQZ35S # Your Apple Dev identity, something like BXPZTQZ35S
17-
PRIMARY_BUNDLE_ID: org.janelia.saalfeldlab.Paintera # Unique to your app, often the launcher class
18-
1913
jobs:
2014
build_installers:
2115
name: Build Installers
@@ -58,8 +52,9 @@ jobs:
5852
mv Paintera-windows-latest-*/*.msi Paintera-${{ env.VERSION }}-Windows.msi
5953
mv Paintera-ubuntu-22.04-*/*.deb Paintera-${{ env.VERSION }}-ubuntu-22.04_x86_64.deb
6054
mv Paintera-ubuntu-24.04-*/*.deb Paintera-${{ env.VERSION }}-ubuntu-24.04_x86_64.deb
61-
mv Paintera-macos-*-intel-*/*.dmg Paintera-${{ env.VERSION }}-MacOS-Intel.dmg
62-
mv Paintera-macos-latest-*/*.dmg Paintera-${{ env.VERSION }}-MacOS-AppleSilicon.dmg
55+
mv Paintera-macos-15-intel-*/*.dmg Paintera-${{ env.VERSION }}-MacOS-15-Intel.dmg
56+
mv Paintera-macos-14-*/*.dmg Paintera-${{ env.VERSION }}-MacOS-14-AppleSilicon.dmg
57+
mv Paintera-macos-15-*/*.dmg Paintera-${{ env.VERSION }}-MacOS-15-AppleSilicon.dmg
6358
- name: Create Release
6459
uses: softprops/action-gh-release@v2
6560
with:
@@ -71,5 +66,6 @@ jobs:
7166
Paintera-${{ env.VERSION }}-Windows.msi
7267
Paintera-${{ env.VERSION }}-ubuntu-22.04_x86_64.deb
7368
Paintera-${{ env.VERSION }}-ubuntu-24.04_x86_64.deb
74-
Paintera-${{ env.VERSION }}-MacOS-Intel.dmg
75-
Paintera-${{ env.VERSION }}-MacOS-AppleSilicon.dmg
69+
Paintera-${{ env.VERSION }}-MacOS-15-Intel.dmg
70+
Paintera-${{ env.VERSION }}-MacOS-14-AppleSilicon.dmg
71+
Paintera-${{ env.VERSION }}-MacOS-15-AppleSilicon.dmg

pom.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@
3333
<!--package properties -->
3434
<package-name>org.janelia.saalfeldlab.paintera</package-name>
3535
<main-class>org.janelia.saalfeldlab.paintera.Paintera</main-class>
36+
<preloader-class>org.janelia.saalfeldlab.paintera.ui.PainteraSplashScreen</preloader-class>
3637
<license.licenseName>GNU General Public License v2.0</license.licenseName>
3738
<license.copyrightOwners>Philipp Hanslovsky, Stephan Saalfeld</license.copyrightOwners>
39+
<!--macos signing default (empty unless -Pmacos-sign)-->
40+
<macos.sign/>
41+
<macos.sign.identity/>
42+
<macos.sign.prefix/>
43+
<macos.sign.entitlements/>
3844

3945
<!-- NB: Deploy releases to the SciJava Maven repository. -->
4046
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
@@ -757,6 +763,7 @@
757763
<configuration>
758764
<mainClass>${main-class}</mainClass>
759765
<options>
766+
<option>-Djavafx.preloader=org.janelia.saalfeldlab.paintera.ui.PainteraSplashScreen</option>
760767
<option>--add-opens=javafx.base/javafx.util=ALL-UNNAMED</option>
761768
<option>--add-opens=javafx.base/javafx.event=ALL-UNNAMED</option>
762769
<option>--add-opens=javafx.base/javafx.beans.property=ALL-UNNAMED</option>
@@ -952,7 +959,7 @@
952959
<arg>--no-header-files</arg>
953960
<arg>--strip-debug</arg>
954961
<arg>--no-man-pages</arg>
955-
<arg>--compress=2</arg>
962+
<arg>--compress=zip-6</arg>
956963
</args>
957964
</configuration>
958965
</execution>
@@ -991,16 +998,16 @@
991998
These properties are then use to build the directory paths to the platform specific resources.
992999
It would be great if Maven automatically added the os family as a property by default
9931000
-->
994-
9951001
<profile>
9961002
<id>macos-sign</id>
9971003
<activation>
9981004
<activeByDefault>false</activeByDefault>
9991005
</activation>
10001006
<properties>
10011007
<macos.sign>--mac-sign</macos.sign>
1002-
<!-- You will have to replace this with your own dev information from your Apple identity -->
1003-
<macos.sign.identity>--mac-signing-key-user-name "Company Name, Inc. (BXPXTXC35S)"</macos.sign.identity>
1008+
<macos.sign.identity>--mac-signing-key-user-name "PainteraSelfSignedCert"</macos.sign.identity>
1009+
<macos.sign.prefix>--mac-package-signing-prefix "org.janelia.saalfeldlab.paintera."</macos.sign.prefix>
1010+
<macos.sign.entitlements>--mac-entitlements "${project.build.directory}/packaging/${os.detected.name}/entitlements.plist"</macos.sign.entitlements>
10041011
</properties>
10051012
</profile>
10061013

src/main/java/org/janelia/saalfeldlab/paintera/serialization/SourceInfoSerializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import gnu.trove.set.hash.TIntHashSet;
1212
import net.imglib2.exception.IncompatibleTypeException;
1313
import org.janelia.saalfeldlab.paintera.Paintera;
14-
import org.janelia.saalfeldlab.paintera.SplashScreenUpdateNotification;
15-
import org.janelia.saalfeldlab.paintera.SplashScreenUpdateNumItemsNotification;
14+
import org.janelia.saalfeldlab.paintera.ui.SplashScreenUpdateNotification;
15+
import org.janelia.saalfeldlab.paintera.ui.SplashScreenUpdateNumItemsNotification;
1616
import org.janelia.saalfeldlab.paintera.serialization.sourcestate.SourceStateSerialization;
1717
import org.janelia.saalfeldlab.paintera.state.SourceInfo;
1818
import org.janelia.saalfeldlab.paintera.state.SourceState;

src/main/kotlin/org/janelia/saalfeldlab/paintera/Paintera.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import org.janelia.saalfeldlab.paintera.Paintera.Companion.paintableRunnables
3333
import org.janelia.saalfeldlab.paintera.config.ScreenScalesConfig
3434
import org.janelia.saalfeldlab.paintera.data.mask.MaskedSource
3535
import org.janelia.saalfeldlab.paintera.state.label.ConnectomicsLabelState
36+
import org.janelia.saalfeldlab.paintera.ui.PainteraSplashScreen
37+
import org.janelia.saalfeldlab.paintera.ui.SplashScreenFinishPreloader
38+
import org.janelia.saalfeldlab.paintera.ui.SplashScreenUpdateNotification
39+
import org.janelia.saalfeldlab.paintera.ui.SplashScreenUpdateNumItemsNotification
3640
import org.janelia.saalfeldlab.paintera.ui.dialogs.PainteraAlerts
3741
import org.janelia.saalfeldlab.paintera.util.debug.DebugModeProperty
3842
import org.janelia.saalfeldlab.paintera.util.logging.LogUtils

src/main/kotlin/org/janelia/saalfeldlab/paintera/ui/PainteraSplashScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.janelia.saalfeldlab.paintera
1+
package org.janelia.saalfeldlab.paintera.ui
22

33
import javafx.animation.*
44
import javafx.application.Preloader

src/packaging/mvn-jpackage.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ app.version=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsed
44

55

66
windows.upgrade.uuid=f918b6f9-8685-4b50-9fbd-9be7a1209249
7-
macos.sign=
8-
macos.sign.identity=
97

108
jvm.modules=javafx.base,\
119
javafx.controls,\
@@ -19,6 +17,7 @@ jvm.modules=javafx.base,\
1917
java.sql
2018

2119
jpackage.java-options=-XX:MaxRAMPercentage=75 \
20+
-Djavafx.preloader=${preloader-class} \
2221
--add-opens=javafx.base/javafx.util=ALL-UNNAMED \
2322
--add-opens=javafx.base/javafx.event=ALL-UNNAMED \
2423
--add-opens=javafx.base/javafx.beans.property=ALL-UNNAMED \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<!-- this is needed until we have a proper apple developer ID -->
6+
<key>com.apple.security.cs.disable-library-validation</key>
7+
<true/>
8+
9+
<key>com.apple.security.cs.allow-jit</key>
10+
<true/>
11+
12+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
13+
<true/>
14+
15+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
16+
<true/>
17+
</dict>
18+
</plist>

src/packaging/osx/jpackage.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--runtime-image "${project.build.directory}/jvm-image"
88
--temp "${project.build.directory}/installer-work"
99
--java-options "${jpackage.java-options}"
10-
1110
${macos.sign}
1211
${macos.sign.identity}
12+
${macos.sign.prefix}
13+
${macos.sign.entitlements}

0 commit comments

Comments
 (0)