|
11 | 11 |
|
12 | 12 | ROOT = Path(os.environ['GITHUB_WORKSPACE']) |
13 | 13 | SOURCE = os.environ['SOURCE_SHA'] |
14 | | -VERSION = '0.1.8' |
| 14 | +VERSION = os.environ['RELEASE_VERSION'] |
15 | 15 | RUN = f"https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['GITHUB_RUN_ID']}" |
16 | 16 | TEMPLATES = Path(__file__).parent / 'templates' |
17 | 17 | PE_FILES = ('openshell.exe', 'openshell-gateway.exe', 'openshell-supervisor.exe', 'openshell-windows-sandbox.exe', 'libz3.dll') |
@@ -63,6 +63,9 @@ def check(name, data): |
63 | 63 | for arch, machine in (('arm64', 0xAA64), ('x64', 0x8664)): |
64 | 64 | kit = ROOT / 'kits' / f'OpenShell-Windows-{VERSION}-{arch}' |
65 | 65 | shutil.copytree(TEMPLATES, kit) |
| 66 | + for text in kit.rglob('*'): |
| 67 | + if text.is_file() and text.suffix in ('.md', '.ps1', '.mjs', '.py', '.template', '.yaml'): |
| 68 | + text.write_bytes(text.read_bytes().replace(b'@VERSION@', VERSION.encode())) |
66 | 69 | sboms = list((ROOT / 'source/deploy/sbom/output').glob('*.cdx.json')) |
67 | 70 | assert len(sboms) == 1, 'Expected freshly generated source SBOM' |
68 | 71 | sbom = json.loads(sboms[0].read_text()) |
@@ -94,11 +97,11 @@ def check(name, data): |
94 | 97 | shutil.copy2(binary, kit / 'bin' / name) |
95 | 98 | inventory.append({'architecture': arch, 'file': f'{kit.name}/bin/{name}', 'sha256': digest(binary), 'authenticode': 'pending'}) |
96 | 99 | shutil.copytree(ROOT / 'inputs/sdk', kit / 'sdk') |
97 | | - assert sorted(p.name for p in (kit / 'sdk').iterdir()) == ['nvidia-openshell-sdk-0.1.8.tgz', 'openshell-0.1.8-py3-none-any.whl'] |
| 100 | + assert sorted(p.name for p in (kit / 'sdk').iterdir()) == [f'nvidia-openshell-sdk-{VERSION}.tgz', f'openshell-{VERSION}-py3-none-any.whl'] |
98 | 101 | (kit / 'BUILD.md').write_text(f'''# Build record |
99 | 102 |
|
100 | 103 | Product source: NVIDIA/OpenShell windows branch, commit `{SOURCE}`. |
101 | | -Version: {VERSION}, stamped in the workspace manifest. This is different from the main-branch v0.1.8 tag. |
| 104 | +Version: {VERSION}, stamped in the workspace manifest. This is different from the main-branch v{VERSION} tag. |
102 | 105 | Workflow: {RUN} |
103 | 106 | Automation commit: `{os.environ['GITHUB_SHA']}`. |
104 | 107 |
|
@@ -131,7 +134,7 @@ def check(name, data): |
131 | 134 | 'packageStatus': 'unsigned-candidate-not-release-ready', |
132 | 135 | 'source': {'repository': 'https://github.com/NVIDIA/OpenShell', 'branch': 'windows', 'commit': SOURCE, 'versionStamp': VERSION}, |
133 | 136 | 'build': {'workflowRun': RUN, 'automationCommit': os.environ['GITHUB_SHA'], 'builtByThisWorkflow': True}, |
134 | | - 'intendedRelease': {'repository': 'NVIDIA/OpenShell', 'tag': 'v0.1.8', 'matchesReleaseTagSource': False}, |
| 137 | + 'intendedRelease': {'repository': 'NVIDIA/OpenShell', 'tag': f'v{VERSION}', 'matchesReleaseTagSource': False}, |
135 | 138 | 'signing': {'authenticode': 'pending', 'githubArchiveAttestation': 'detached-verify-after-download'}, |
136 | 139 | 'validation': {'nativeLaunchChecks': 'passed', 'runtimeReport': 'external-bound-to-sha256', 'finalSignedBytesValidated': False}, |
137 | 140 | 'files': [{'path': p.relative_to(kit).as_posix(), 'size': p.stat().st_size, 'sha256': digest(p)} for p in sorted(kit.rglob('*')) if p.is_file()], |
|
0 commit comments