Files
cadcraft/.github/workflows/nightly-dispatch.yml
T
skylartaylor b462abfdff packaging: add the isolated CADCraft nightly for Windows and macOS
The app-side flavor and the Windows/macOS producers, on top of Dylan's
nightly-linux-packaging branch: the Linux producer, the shared nightly helpers,
the release-ref callers and the policy, and the eframe persistence fix are his
(9bbbfb49) and stay as he wrote them. This commit adds what was missing for a
nightly to be a separate, isolated app on all three platforms.

App side: the `CADCRAFT_BUILD_CHANNEL=nightly-v1` build channel with its own
icon, version identity, product name and Windows AUMID; the Launcher's
`--launch-profile nightly-v1 --profile-root <abs> --` protocol with the early
`--version` answer in both forms, before logging, identity, IPC or any window;
the profile fences (stable roots, portable layout, install boundary, aliases,
`FLATPAK_ID`, and `CADCRAFT_CONFIG_DIR` accepted only when it names the profile
itself, so a Launcher wrapper can export it); one data-root hook so the settings
folder *and* eframe's `app.ron` are the profile, with autosave/Drawing Recovery,
logs, reports and the single-instance socket inside it; the session lease and
unclean-exit record finished from `on_exit` (macOS Cmd+Q); updater, control
server and agent surfaces off in this channel; the channel name in the window
title, drawn caption and About.

Windows: `packaging/windows/nightly.ps1` with `package.ps1 -Nightly
-BuildOnly` and `sign.ps1 -Required/-CheckOnly/-CheckBuildEnvironment`.
macOS: `nightly.sh`, `nightly-lib.sh`, `nightly-sign.sh`, `nightly-verify.sh`
and `nightly_plist.py`.
Shared: the `nightly-tests.py` runner over Dylan's release contracts plus the
archive, plist and macOS signing suites; the no-build `nightly-source-contract`
lint job; the dormant `nightly-dispatch.yml` (no schedule); the stable Linux key
file his tests read; and the nightly icon set with its provenance.
2026-11-24 22:30:27 +01:00

73 lines
3.7 KiB
YAML

name: Dispatch release-ref nightly
# Transport only, never authorization. No checkout, payload parsing or release environment.
on:
workflow_run:
workflows: [CADCraft unsigned nightly]
types: [completed]
branches: [main]
permissions: {}
jobs:
dispatch:
# SOURCE PREPARATION: literal off until immutable shared tooling and policy qualification.
if: >-
false && github.repository == 'storytold/cadcraft' &&
github.event_name == 'workflow_run'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
steps:
- name: Dispatch only the exact completed producer run and attempt
shell: python
env:
GH_TOKEN: ${{ github.token }}
run: |
import json
import os
import urllib.request
def require(value, message):
if not value:
raise RuntimeError(message)
# These filters reduce noise; the protected release validator repeats admission
# against authenticated API metadata and required attestation/quality evidence.
require(os.environ.get('GITHUB_REPOSITORY') == 'storytold/cadcraft', 'wrong repository')
require(os.environ.get('GITHUB_EVENT_NAME') == 'workflow_run', 'wrong event')
with open(os.environ['GITHUB_EVENT_PATH'], encoding='utf-8') as stream:
event = json.load(stream)
require(event.get('action') == 'completed', 'producer is not complete')
require(event.get('repository', {}).get('full_name') == 'storytold/cadcraft', 'wrong event repository')
producer = event.get('workflow_run', {})
require(producer.get('head_repository', {}).get('full_name') == 'storytold/cadcraft', 'foreign producer')
require(producer.get('path') == '.github/workflows/nightly.yml', 'wrong producer path')
require(producer.get('head_branch') == 'main', 'wrong producer branch')
require(producer.get('status') == 'completed' and producer.get('conclusion') == 'success', 'producer did not succeed')
# First scheduled attempt only; reviewed manual/re-run authority belongs to release policy.
require(producer.get('event') == 'schedule', 'not an automatic scheduled producer')
run_id, attempt = producer.get('id'), producer.get('run_attempt')
require(type(run_id) is int and run_id > 0, 'invalid producer run id')
require(type(attempt) is int and attempt == 1, 'invalid automatic producer attempt')
body = json.dumps({'ref': 'release', 'inputs': {
'producer_run_id': str(run_id), 'producer_run_attempt': str(attempt)
}}).encode('utf-8')
request = urllib.request.Request(
'https://api.github.com/repos/storytold/cadcraft/actions/workflows/nightly-sign.yml/dispatches',
data=body, method='POST', headers={
'Authorization': 'Bearer ' + os.environ['GH_TOKEN'],
'Accept': 'application/vnd.github+json',
'Content-Type': 'application/json',
'X-GitHub-Api-Version': '2022-11-28',
'User-Agent': 'cadcraft-nightly-dispatch'
})
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
raise RuntimeError('dispatch redirects are forbidden')
# One bounded request, no retry: duplicate transport is not publication authority.
with urllib.request.build_opener(NoRedirect()).open(request, timeout=20) as response:
require(response.status == 204, 'dispatch was not accepted')
print('Dispatched producer run/attempt to the release-ref validator; not a signing result.')