Skip to content

Commit

Permalink
Fix the CMake 'install' target on macOS to sign bundled dependencies.
Browse files Browse the repository at this point in the history
In the 'release' GitHub action, use 'runner.arch' instead of 'amd64'.

Co-authored-by: Will Pazner <will.e.p@gmail.com>
  • Loading branch information
v-dobrev and pazner committed Aug 7, 2024
1 parent da0d756 commit 2f673c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ jobs:
- name: package binary (Windows)
if: matrix.os == 'windows-latest'
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
run: |
cd glvis/build
Copy-Item -Path "Release" -Destination "${Env:GLVIS_EXPORT_NAME}" -Recurse
- name: package binary (Mac)
if: matrix.os == 'macos-latest'
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
run: |
cd glvis/build
make app
Expand All @@ -222,12 +222,14 @@ jobs:
mkdir dmg_tmp
cp -a ../install-${{ matrix.os }}/GLVis.app dmg_tmp/GLVis.app
# Create DMG since actions/upload-artifact will clobber Unix permissions
hdiutil create -volname "GLVis macOS x86_64" -srcfolder dmg_tmp -ov -format UDZO GLVis.dmg
hdiutil create -volname "GLVis macOS arm64" -srcfolder dmg_tmp -ov -format UDZO GLVis.dmg
mkdir ${GLVIS_EXPORT_NAME}
cp GLVis.dmg ${GLVIS_EXPORT_NAME}
- name: upload binary
uses: actions/upload-artifact@v4
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
with:
name: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
path: glvis/build/glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
name: ${{ env.GLVIS_EXPORT_NAME }}
path: glvis/build/${{ env.GLVIS_EXPORT_NAME }}
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ if(NOT EMSCRIPTEN)
install(CODE [[
include (BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/GLVis.app" "" "")
file(GLOB LIBS_TO_SIGN
"${CMAKE_INSTALL_PREFIX}/GLVis.app/Contents/Frameworks/*.dylib")
foreach(LIB ${LIBS_TO_SIGN})
if (NOT IS_SYMLINK ${LIB})
execute_process(COMMAND codesign --force --sign - ${LIB})
endif()
endforeach()
execute_process(COMMAND codesign --force --sign - ${CMAKE_INSTALL_PREFIX}/GLVis.app)
]] COMPONENT RUNTIME)
endif(APPLE)

Expand Down

0 comments on commit 2f673c1

Please sign in to comment.