Skip to content

Commit 822534a

Browse files
committed
Add root install smoke checklist and release attachment checks
1 parent 18085fb commit 822534a

4 files changed

Lines changed: 141 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Release Artifacts
22

3+
permissions:
4+
contents: write
5+
36
on:
47
push:
58
tags:
@@ -57,6 +60,18 @@ jobs:
5760
PKG_PATH="$(find dist -maxdepth 1 -name 'DevStackMenu-*.pkg' -type f | sort | head -n 1)"
5861
./Scripts/verify-package.sh "$PKG_PATH" "$CI_REQUIRE_SIGNED_PACKAGE"
5962
63+
- name: Publish package to GitHub release
64+
if: github.ref_type == 'tag'
65+
env:
66+
GH_TOKEN: ${{ github.token }}
67+
run: |
68+
PKG_PATH="$(find dist -maxdepth 1 -name 'DevStackMenu-*.pkg' -type f | sort | head -n 1)"
69+
if gh release view "${{ github.ref_name }}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
70+
gh release upload "${{ github.ref_name }}" "$PKG_PATH" --repo "${GITHUB_REPOSITORY}" --clobber
71+
else
72+
gh release create "${{ github.ref_name }}" "$PKG_PATH" --repo "${GITHUB_REPOSITORY}" --title "${{ github.ref_name }}" --notes "Release ${GITHUB_REF_NAME}"
73+
fi
74+
6075
- name: Upload installer package
6176
uses: actions/upload-artifact@v4
6277
with:

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,37 @@ make package
6262
make install-package
6363
```
6464

65+
For a real root-install smoke-check (installer + pkgutil + post-install checks), run one command:
66+
67+
```sh
68+
./Scripts/release-smoke-install.sh dist/DevStackMenu-*.pkg
69+
```
70+
71+
For signed artifacts:
72+
73+
```sh
74+
./Scripts/release-smoke-install.sh --signed dist/DevStackMenu-*.pkg
75+
```
76+
77+
The smoke script verifies:
78+
79+
- package path resolution and signature policy
80+
- required payload entries (`./Applications/DevStackMenu.app`, `./Applications/Import Compose To DX.app`, `./usr/local/bin/dx`)
81+
- package installation through `sudo installer`
82+
- presence of installed artifacts in `/Applications` and `/usr/local/bin`
83+
- CLI entrypoint execution (`dx status`)
84+
6585
The installer places:
6686

6787
- `DevStackMenu.app` and `Import Compose To DX.app` into `/Applications`
6888
- `dx` into `/usr/local/bin`
6989

90+
If `dx` is still not found in your shell after install, run:
91+
92+
```sh
93+
export PATH="/usr/local/bin:$PATH"
94+
```
95+
7096
This `.pkg` is the primary release artifact built by CI.
7197

7298
## What It Does

RELEASING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ Do not bump `Resources/Info.plist` for ordinary maintenance, documentation sync
1717
3. If this commit is a real release, bump `CFBundleShortVersionString` and `CFBundleVersion` in `Resources/Info.plist`.
1818
4. Build release artifacts with `make package` (unsigned by default).
1919
5. Confirm package content and signature with `./Scripts/verify-package.sh dist/DevStackMenu-*.pkg 0` for unsigned path, or `1` when signing is mandatory.
20-
6. Sanity-check the generated package and confirm it installs with `sudo installer -pkg dist/DevStackMenu-*.pkg -target /`.
21-
7. Sanity-check generated apps in `/Applications` after install.
20+
6. Run a root-install smoke checklist with one command:
21+
22+
```sh
23+
./Scripts/release-smoke-install.sh dist/DevStackMenu-*.pkg
24+
```
25+
26+
It performs installer + pkgutil + post-install checks.
27+
7. Sanity-check generated apps in `/Applications` after install (script already validates this, including `/Applications/Import Compose To DX.app` and `/usr/local/bin/dx`).
2228
8. Verify the main app and compose-import helper use distinct bundle identifiers in the built artifacts.
2329
9. Verify single-instance behavior by launching the installed app twice and confirming the second launch exits while the original instance stays alive.
2430
10. If signing credentials are configured, run `workflow_dispatch` on Release Artifacts for signed/notarized output.
2531

2632
## GitHub Release Flow
2733

28-
The repository includes a workflow that builds a `.pkg` artifact and uploads it for tagged releases or manual runs.
34+
The repository includes a workflow that builds a `.pkg` artifact, uploads it as a workflow artifact, and attaches it to the GitHub release for the tag on push/tag events.
2935
Signed/notarized output is optional and driven by workflow secrets.
3036

3137
To enable signing/notarization on `workflow_dispatch`, configure:

Scripts/release-smoke-install.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
REPO_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
5+
PKG_PATH=""
6+
REQUIRE_SIGNED="0"
7+
8+
if [ "$#" -gt 2 ]; then
9+
echo "Too many arguments. Usage: $0 [--signed] <package>" >&2
10+
exit 1
11+
fi
12+
13+
if [ "$#" -ge 1 ]; then
14+
if [ "$1" = "--signed" ]; then
15+
REQUIRE_SIGNED="1"
16+
PKG_PATH="${2:-}"
17+
else
18+
PKG_PATH="$1"
19+
fi
20+
fi
21+
22+
if [ -z "$PKG_PATH" ]; then
23+
PKG_PATH="$(cd "$REPO_DIR" && find dist -maxdepth 1 -name 'DevStackMenu-*.pkg' -type f | sort | head -n 1 || true)"
24+
fi
25+
26+
if [ -z "$PKG_PATH" ] || [ ! -f "$PKG_PATH" ]; then
27+
echo "Package not found. Provide a path: ./Scripts/release-smoke-install.sh dist/DevStackMenu-...pkg" >&2
28+
exit 1
29+
fi
30+
31+
TMP_DIR="$(mktemp -d)"
32+
TMP_LOG="$TMP_DIR/release-install.log"
33+
TMP_PAYLOAD="$TMP_DIR/payload.txt"
34+
TMP_HELP="$TMP_DIR/dx-help.txt"
35+
TMP_HELP_ERR="$TMP_DIR/dx-help.err"
36+
trap 'rm -rf "$TMP_DIR"' EXIT
37+
38+
printf 'Using package: %s\n' "$PKG_PATH"
39+
"$REPO_DIR/Scripts/verify-package.sh" "$PKG_PATH" "$REQUIRE_SIGNED"
40+
41+
printf 'Inspecting payload paths:\n'
42+
pkgutil --payload-files "$PKG_PATH" | sort > "$TMP_PAYLOAD"
43+
cat "$TMP_PAYLOAD"
44+
printf '\n'
45+
46+
if [ "$REQUIRE_SIGNED" = "1" ] && ! pkgutil --check-signature "$PKG_PATH" >/dev/null 2>&1; then
47+
echo "Package signature is required but missing." >&2
48+
exit 1
49+
fi
50+
51+
printf 'Installing package (requires sudo)...\n'
52+
if [ "$(id -u)" -eq 0 ]; then
53+
installer -pkg "$PKG_PATH" -target / | tee "$TMP_LOG"
54+
else
55+
sudo installer -pkg "$PKG_PATH" -target / | tee "$TMP_LOG"
56+
fi
57+
58+
printf 'Verifying installed artifacts...\n'
59+
if [ ! -x /usr/local/bin/dx ]; then
60+
echo "dx missing in /usr/local/bin" >&2
61+
exit 1
62+
fi
63+
64+
if [ ! -d "/Applications/DevStackMenu.app" ]; then
65+
echo "DevStackMenu.app missing in /Applications" >&2
66+
exit 1
67+
fi
68+
69+
if [ ! -d "/Applications/Import Compose To DX.app" ]; then
70+
echo "Import Compose To DX.app missing in /Applications" >&2
71+
exit 1
72+
fi
73+
74+
if /usr/local/bin/dx --help >"$TMP_HELP" 2>"$TMP_HELP_ERR"; then
75+
printf 'dx status: '
76+
/usr/local/bin/dx status
77+
else
78+
echo "dx failed to run" >&2
79+
cat "$TMP_HELP_ERR"
80+
exit 1
81+
fi
82+
83+
if command -v dx >/dev/null 2>&1; then
84+
printf 'dx path from PATH: %s\n' "$(command -v dx)"
85+
else
86+
printf 'dx is not on current PATH. Binary is at /usr/local/bin/dx\n'
87+
printf 'You can add it for this shell with: export PATH="/usr/local/bin:$PATH"\n'
88+
fi
89+
90+
printf '\nSmoke install passed.\n'
91+
printf 'To clean artifacts: sudo rm -rf /Applications/DevStackMenu.app /Applications/Import\\ Compose\\ To\\ DX.app /usr/local/bin/dx\n'

0 commit comments

Comments
 (0)