Skip to content

Commit cd0af8a

Browse files
committed
Try to get correct artifact for testing
1 parent c16559a commit cd0af8a

File tree

3 files changed

+45
-36
lines changed

3 files changed

+45
-36
lines changed

.github/workflows/app_build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
build:
2424
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
2525

26+
outputs:
27+
OS_APP_VERSION: ${{ steps.parse_cmake_versions.outputs.OS_APP_VERSION }}
28+
2629
runs-on: ${{ matrix.os }}
2730
continue-on-error: true
2831
strategy:
@@ -719,20 +722,20 @@ jobs:
719722

720723

721724
steps:
722-
- uses: actions/checkout@v4 # Still need E+ checked out to get testing scripts
725+
- uses: actions/checkout@v4 # Still need code checked out to get testing scripts
723726
with:
724727
path: checkout
725728

726729
#- name: Gather Test Package from Artifacts
727730
# uses: actions/download-artifact@v4
728731
# with:
729-
# name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.COMPRESSED_EXT }}
732+
# name: OpenStudioApplication-${{ needs.build.outputs.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ matrix.COMPRESSED_EXT }}
730733
# path: package
731734

732735
- name: Gather Dmg Package from Artifacts
733736
uses: actions/download-artifact@v4
734737
with:
735-
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.BINARY_EXT }}
738+
name: OpenStudioApplication-${{ needs.build.outputs.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ matrix.BINARY_EXT }}
736739
path: dmg
737740

738741
- name: Test Dmg Install and Package signing

ci/parse_cmake_versions.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def parse_os_app_version(cmakelists_path: Path):
1515

1616
if "GITHUB_ENV" not in os.environ:
1717
return
18-
with open(os.environ["GITHUB_ENV"], "a") as f:
19-
f.write(f"\nOS_APP_VERSION={version}")
18+
for out in ["GITHUB_ENV", "GITHUB_OUTPUT"]:
19+
with open(os.environ[out], "a") as f:
20+
f.write(f"\nOS_APP_VERSION={version}")
2021

2122

2223
def parse_os_sdk_version(find_sdk_path: Path):
@@ -62,14 +63,15 @@ def parse_os_sdk_version(find_sdk_path: Path):
6263
if "GITHUB_ENV" not in os.environ:
6364
return
6465

65-
with open(os.environ["GITHUB_ENV"], "a") as f:
66-
f.write(f"\nOS_SDK_VERSION_MAJOR={OS_SDK_VERSION_MAJOR}")
67-
f.write(f"\nOS_SDK_VERSION_MINOR={OS_SDK_VERSION_MINOR}")
68-
f.write(f"\nOS_SDK_VERSION_PATCH={OS_SDK_VERSION_PATCH}")
69-
f.write(f"\nOS_SDK_VERSION={OS_SDK_VERSION}")
70-
f.write(f"\nOS_SDK_VERSION={OS_SDK_VERSION}")
71-
f.write(f"\nOS_SDK_VERSION_SHA={OS_SDK_VERSION_SHA}")
72-
f.write(f"\nOS_SDK_INSTALLER_NAME={OS_SDK_INSTALLER_NAME}")
66+
for out in ["GITHUB_ENV", "GITHUB_OUTPUT"]:
67+
with open(os.environ[out], "a") as f:
68+
f.write(f"\nOS_SDK_VERSION_MAJOR={OS_SDK_VERSION_MAJOR}")
69+
f.write(f"\nOS_SDK_VERSION_MINOR={OS_SDK_VERSION_MINOR}")
70+
f.write(f"\nOS_SDK_VERSION_PATCH={OS_SDK_VERSION_PATCH}")
71+
f.write(f"\nOS_SDK_VERSION={OS_SDK_VERSION}")
72+
f.write(f"\nOS_SDK_VERSION={OS_SDK_VERSION}")
73+
f.write(f"\nOS_SDK_VERSION_SHA={OS_SDK_VERSION_SHA}")
74+
f.write(f"\nOS_SDK_INSTALLER_NAME={OS_SDK_INSTALLER_NAME}")
7375

7476

7577
if __name__ == "__main__":

developer/python/verify_signature.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ class Generator(Enum):
1414
IFW = 1
1515
TGZ = 2
1616

17-
BUNDLED_APPS = ['OpenStudioApp.app']
17+
18+
BUNDLED_APPS = ["OpenStudioApp.app"]
1819
# BUNDLED_APPS = []
1920

2021

2122
# Path.is_relative_to was added only in Python 3.9
22-
if not hasattr(Path, 'is_relative_to'):
23+
if not hasattr(Path, "is_relative_to"):
24+
2325
def _is_relative_to(self, other):
2426
if not isinstance(other, Path):
2527
other = Path(other)
2628
return other == self or other in self.parents
29+
2730
Path.is_relative_to = _is_relative_to
2831

2932

@@ -32,13 +35,13 @@ def get_cmake_install_prefix_for_generator(build_dir: Path, generator: Generator
3235
if not cpack_dir.exists():
3336
print(f"Could not find a _CPack_Packages directory for {generator.name}")
3437
return None
35-
cmake_install_root = next(x for x in cpack_dir.glob('*') if x.is_dir() and x.suffix != '.app')
38+
cmake_install_root = next(x for x in cpack_dir.glob("*") if x.is_dir() and x.suffix != ".app")
3639
if generator == Generator.TGZ:
3740
return cmake_install_root
3841

39-
p = cmake_install_root / 'packages'
42+
p = cmake_install_root / "packages"
4043
if component:
41-
p = p / component / 'data'
44+
p = p / component / "data"
4245
assert p.is_dir()
4346
return p
4447

@@ -67,12 +70,15 @@ def find_executable_files(root_dir: Path) -> List[Path]:
6770
]
6871
)
6972

70-
sos = list([
71-
x for x in root_dir.glob('**/*.so')
72-
if x.is_file()
73-
and not x.is_symlink()
74-
and not any([x.is_relative_to(bundled_p) for bundled_p in bundled_apps])
75-
])
73+
sos = list(
74+
[
75+
x
76+
for x in root_dir.glob("**/*.so")
77+
if x.is_file()
78+
and not x.is_symlink()
79+
and not any([x.is_relative_to(bundled_p) for bundled_p in bundled_apps])
80+
]
81+
)
7682

7783
print(f"In {root_dir} found {len(files)} executable files and {len(dylibs)} dylibs and {len(sos)} SOs")
7884

@@ -133,26 +139,26 @@ def get_linked_libraries(p):
133139

134140
m = _OTOOL_ARCHITECTURE_RE.match(lines[0])
135141
assert m
136-
arch = m.groupdict()['architecture']
142+
arch = m.groupdict()["architecture"]
137143
if arch is None:
138144
lines = lines[1:]
139145
else:
140146
arches = {}
141-
arches[arch] = {'start': 1}
147+
arches[arch] = {"start": 1}
142148
for i, line in enumerate(lines):
143149
if i == 0:
144150
continue
145151
if m := _OTOOL_ARCHITECTURE_RE.match(line):
146-
arches[arch]['end'] = i
147-
arch = m.groupdict()['architecture']
148-
arches[arch] = {'start': i + 1}
149-
arches[arch]['end'] = len(lines) - 1
152+
arches[arch]["end"] = i
153+
arch = m.groupdict()["architecture"]
154+
arches[arch] = {"start": i + 1}
155+
arches[arch]["end"] = len(lines) - 1
150156

151-
in_preference_order = ['arm64', 'x86_64', 'i386']
157+
in_preference_order = ["arm64", "x86_64", "i386"]
152158
for pref_arch in in_preference_order:
153159
if pref_arch in arches:
154160
arch = pref_arch
155-
lines = lines[arches[pref_arch]['start']:arches[pref_arch]['end']]
161+
lines = lines[arches[pref_arch]["start"] : arches[pref_arch]["end"]]
156162
print(f"Found multiple architectures, will select {pref_arch}, candidates were {arches.keys()}")
157163
break
158164

@@ -244,7 +250,7 @@ def otool(p, verify_resolve=False, verbose=False):
244250
break
245251
if not found and verify_resolve:
246252
msg = f"Could not resolve '{libname}' for '{p}'"
247-
if 'Radiance' in p.parts:
253+
if "Radiance" in p.parts:
248254
print(msg)
249255
else:
250256
raise ValueError(msg)
@@ -274,9 +280,7 @@ def otool(p, verify_resolve=False, verbose=False):
274280
parser.add_argument(
275281
"--install", action="store_true", default=False, help="This is an install dir, not the build_dir"
276282
)
277-
parser.add_argument(
278-
"--verbose", action="store_true", default=False, help="Enable verbose output"
279-
)
283+
parser.add_argument("--verbose", action="store_true", default=False, help="Enable verbose output")
280284
parser.add_argument(
281285
"--only-generator", type=str, help="Only run for the given generator", choices=[i.name for i in Generator]
282286
)

0 commit comments

Comments
 (0)