From ef868fa2cce573f1afc22ac73b757025e17f8662 Mon Sep 17 00:00:00 2001 From: Brian Ferris Date: Thu, 16 Jun 2022 15:23:31 -0700 Subject: [PATCH] fix: Temporary fix for MacOS validator app corruption (#1186) * Include Mac OS .app in installer artifact. * Use temurin jdk distro, drop .app from package. * Don't create the app dmg in gradle. Instead, create an unsigned bundle in github workflow. * Add a comment. * Switch back to zulu distro. Co-authored-by: Maxime Armstrong <46797220+maximearmstrong@users.noreply.github.com> --- .github/workflows/package_installers.yml | 13 +++++++++++++ app/pkg/build.gradle | 1 + 2 files changed, 14 insertions(+) diff --git a/.github/workflows/package_installers.yml b/.github/workflows/package_installers.yml index a62153651a..4b938973d8 100644 --- a/.github/workflows/package_installers.yml +++ b/.github/workflows/package_installers.yml @@ -44,6 +44,19 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: jpackage + # Per discussion in https://github.com/MobilityData/gtfs-validator/issues/1183, there is a + # bug with jpackage in Java 17 that caused Mac apps to be left in an ambiguous signing state + # that results in them being reported as 'damaged' when run. As a temporary workaround, we + # unsign the app and repackage as a dmg. This bug could be fixed in the future by upgrading + # to Java 18 or by officially signing the app. + - name: Unsign and package Mac OS app + if: matrix.os == 'macos-latest' + shell: bash + run: | + codesign --remove-signature app/pkg/build/jpackage/GTFS\ Validator.app + appVersion=$(./gradlew cV -q -Prelease.quiet) + appVersion=${appVersion//-SNAPSHOT/} + jpackage --type dmg --name 'GTFS Validator' --app-version ${appVersion} --app-image app/pkg/build/jpackage/GTFS\ Validator.app --dest app/pkg/build/jpackage - name: Upload Installer uses: actions/upload-artifact@v2 with: diff --git a/app/pkg/build.gradle b/app/pkg/build.gradle index efbcc55490..38ba418bc6 100644 --- a/app/pkg/build.gradle +++ b/app/pkg/build.gradle @@ -111,6 +111,7 @@ jlink { imageOptions = [ '--icon', "${projectDir}/src/main/icons/Icon.icns" ] + skipInstaller = true } } }