Skip to content

Commit cc962b9

Browse files
committed
Verify signature: for the CPACK package + on a clean machine too
1 parent 97e71e2 commit cc962b9

File tree

2 files changed

+465
-0
lines changed

2 files changed

+465
-0
lines changed

.github/workflows/app_build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,25 @@ jobs:
602602
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.COMPRESSED_EXT }}
603603
path: build/${{ matrix.COMPRESSED_PKG_PATH }}/*.${{ env.COMPRESSED_EXT }}
604604

605+
- name: Full Test Package signing for IFW and TGZ
606+
if: runner.os == 'macOS'
607+
working-directory: ./build
608+
shell: bash
609+
run: |
610+
begin_group() { echo -e "::group::\033[93m$1\033[0m"; }
611+
612+
begin_group "Full Check signature of _CPack_Packages for both IFW and TGZ"
613+
python ../developer/python/verify_signature.py --verbose --only-generator IFW .
614+
python ../developer/python/verify_signature.py --otool --otool-out-file otool_infos_cpack_tgz.json --verbose --only-generator TGZ .
615+
echo "::endgroup::"
616+
617+
- name: Upload otool info as artifact
618+
uses: actions/upload-artifact@v4
619+
with:
620+
name: otool_infos_cpack_${{ matrix.os }}_${{ matrix.arch }}
621+
path: build/otool*json
622+
if-no-files-found: error
623+
605624
- name: Test
606625
working-directory: ./build
607626
shell: bash
@@ -675,3 +694,94 @@ jobs:
675694
/bin/rm OpenStudioApplication-*${{ env.COMPRESSED_EXT }} || true
676695
/bin/rm OpenStudioApplication-*${{ env.BINARY_EXT }} || true
677696
ls OpenStudioApplication-* || true
697+
698+
699+
test_package:
700+
name: Test Built Package
701+
needs: build_installer_artifact
702+
runs-on: ${{ matrix.os }}
703+
strategy:
704+
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
705+
fail-fast: false
706+
matrix:
707+
os: [macos-13, macos-arm64]
708+
include:
709+
- os: macos-13
710+
SELF_HOSTED: false
711+
BINARY_EXT: dmg
712+
COMPRESSED_EXT: tar.gz
713+
arch: x86_64
714+
- os: macos-arm64
715+
SELF_HOSTED: true
716+
BINARY_EXT: dmg
717+
COMPRESSED_EXT: tar.gz
718+
arch: arm64
719+
720+
721+
steps:
722+
- uses: actions/checkout@v4 # Still need E+ checked out to get testing scripts
723+
with:
724+
path: checkout
725+
726+
#- name: Gather Test Package from Artifacts
727+
# uses: actions/download-artifact@v4
728+
# with:
729+
# name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.COMPRESSED_EXT }}
730+
# path: package
731+
732+
- name: Gather Dmg Package from Artifacts
733+
uses: actions/download-artifact@v4
734+
with:
735+
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.BINARY_EXT }}
736+
path: dmg
737+
738+
- name: Test Dmg Install and Package signing
739+
working-directory: ./dmg
740+
shell: bash
741+
run: |
742+
begin_group() { echo -e "::group::\033[93m$1\033[0m"; }
743+
744+
set -x
745+
746+
dmg=$(ls OpenStudioApplication-*.dmg)
747+
begin_group "Checking Signature of .dmg"
748+
spctl --assess --type open --context context:primary-signature -vvvv $dmg
749+
echo "::endgroup::"
750+
751+
begin_group "Mounting Dmg, and checking signature of installer app"
752+
mkdir temp_mount
753+
hdiutil attach -mountpoint ./temp_mount/ $dmg
754+
filename="${dmg%.*}"
755+
spctl --assess --type open --context context:primary-signature -vvvv ./temp_mount/$filename.app
756+
echo "::endgroup::"
757+
758+
begin_group "Installing"
759+
sudo ./temp_mount/$filename.app/Contents/MacOS/$filename --accept-licenses --default-answer --confirm-command --root $(pwd)/test_install install
760+
hdiutil detach ./temp_mount/
761+
echo "::endgroup::"
762+
763+
begin_group "Quick Check signature of inner executables and binaries"
764+
codesign -dvvv ./lib/libopenstudiolib.dylib
765+
codesign -dvvv ./lib/libpythonengine.so
766+
codesign -dvvv ./lib/librubyengine.so
767+
codesign -dvvv ./test_install/EnergyPlus/energyplus
768+
codesign -dvvv ./test_install/EnergyPlus/libenergyplusapi.dylib
769+
codesign -dvvv ./test_install/EnergyPlus/libpython*.dylib
770+
codesign -dvvv ./test_install/ExpandObjects
771+
echo "::endgroup::"
772+
773+
begin_group "Full Check signature of installed DMG for all executables and resolve otool libraries"
774+
python ../developer/python/verify_signature.py --otool --otool-out-file otool_info_dmg.json --verbose --install test_install
775+
echo "::endgroup::"
776+
777+
begin_group "Running a simulation with python"
778+
./test_install/EnergyPlus/energyplus --help
779+
./test_install/EnergyPlus/energyplus -w ./test_install/EnergyPlus/WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw -d out ./test_install/EnergyPlus/ExampleFiles/PythonPluginCustomSchedule.idf
780+
echo "::endgroup::"
781+
782+
- name: Upload otool info as artifact
783+
uses: actions/upload-artifact@v4
784+
with:
785+
name: otool_info_dmg_${{ matrix.os }}_${{ matrix.arch }}
786+
path: dmg/otool*json
787+
if-no-files-found: error

0 commit comments

Comments
 (0)