Skip to content

Commit b758c14

Browse files
committed
fix(release): make core dependency and verify packaging
1 parent cc7528a commit b758c14

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ jobs:
4343
echo "RELEASE_APP_DIR=${RELEASE_APP_DIR}" >> "${GITHUB_ENV}"
4444
4545
rm -rf "${RELEASE_APP_DIR}"
46-
mkdir -p "${RELEASE_APP_DIR}/packages/desktop" "${RELEASE_APP_DIR}/packages/ui" "${RELEASE_APP_DIR}/vendor/snowtree-core"
46+
mkdir -p "${RELEASE_APP_DIR}/packages/desktop" "${RELEASE_APP_DIR}/packages/ui" "${RELEASE_APP_DIR}/packages/core"
4747
48-
cp package.json pnpm-lock.yaml .npmrc LICENSE "${RELEASE_APP_DIR}/"
48+
cp package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc LICENSE "${RELEASE_APP_DIR}/"
4949
cp -R packages/desktop/dist "${RELEASE_APP_DIR}/packages/desktop/dist"
5050
cp -R packages/desktop/assets "${RELEASE_APP_DIR}/packages/desktop/assets"
51+
cp packages/desktop/package.json "${RELEASE_APP_DIR}/packages/desktop/package.json"
5152
cp -R packages/ui/dist "${RELEASE_APP_DIR}/packages/ui/dist"
5253
53-
cp "${GITHUB_WORKSPACE}/packages/core/package.json" "${RELEASE_APP_DIR}/vendor/snowtree-core/package.json"
54-
cp -R "${GITHUB_WORKSPACE}/packages/core/dist" "${RELEASE_APP_DIR}/vendor/snowtree-core/dist"
55-
cp -R "${GITHUB_WORKSPACE}/packages/core/dist-cjs" "${RELEASE_APP_DIR}/vendor/snowtree-core/dist-cjs"
54+
cp "${GITHUB_WORKSPACE}/packages/core/package.json" "${RELEASE_APP_DIR}/packages/core/package.json"
55+
cp -R "${GITHUB_WORKSPACE}/packages/core/dist" "${RELEASE_APP_DIR}/packages/core/dist"
56+
cp -R "${GITHUB_WORKSPACE}/packages/core/dist-cjs" "${RELEASE_APP_DIR}/packages/core/dist-cjs"
5657
5758
pushd "${RELEASE_APP_DIR}"
58-
node -e "const fs=require('fs'); const p='package.json'; const j=JSON.parse(fs.readFileSync(p,'utf8')); j.dependencies=j.dependencies||{}; j.dependencies['@snowtree/core']='file:vendor/snowtree-core'; fs.writeFileSync(p, JSON.stringify(j,null,2)+'\\n');"
59-
pnpm install -P --ignore-scripts
59+
pnpm install -P --frozen-lockfile --ignore-scripts
6060
popd
6161
6262
- name: Rebuild native dependencies (Electron)
@@ -67,6 +67,26 @@ jobs:
6767
"${GITHUB_WORKSPACE}/node_modules/.bin/electron-builder" install-app-deps
6868
popd
6969
70+
- name: Build artifacts (no publish)
71+
shell: bash
72+
run: |
73+
set -euo pipefail
74+
"${GITHUB_WORKSPACE}/node_modules/.bin/electron-builder" --projectDir "${RELEASE_APP_DIR}" --publish never
75+
76+
- name: Verify packaged app contains core (macOS)
77+
if: runner.os == 'macOS'
78+
shell: bash
79+
run: |
80+
set -euo pipefail
81+
ZIP="$(ls -1 "${RELEASE_APP_DIR}/dist-electron/"*macOS-arm64.zip | head -n 1)"
82+
TMP_DIR="${RUNNER_TEMP}/verify-app"
83+
rm -rf "${TMP_DIR}"
84+
mkdir -p "${TMP_DIR}"
85+
unzip -q "${ZIP}" -d "${TMP_DIR}"
86+
APP_ASAR="$(find "${TMP_DIR}" -path '*snowtree.app/Contents/Resources/app.asar' | head -n 1)"
87+
echo "Verifying asar: ${APP_ASAR}"
88+
"${GITHUB_WORKSPACE}/node_modules/.bin/asar" list "${APP_ASAR}" | grep -q "node_modules/@snowtree/core/dist-cjs/types/models.js"
89+
7090
- name: Publish to GitHub Releases
7191
shell: bash
7292
run: |

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowtree",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"private": true,
55
"description": "Snowtree - Multi-session AI CLI workspace manager with git worktrees",
66
"homepage": "https://github.com/bohutang/snowtree",
@@ -40,6 +40,7 @@
4040
"dependencies": {
4141
"@anthropic-ai/claude-code": "^2.0.0",
4242
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0",
43+
"@snowtree/core": "workspace:*",
4344
"better-sqlite3": "^11.7.0",
4445
"bull": "^4.16.3",
4546
"electron-updater": "^6.6.2",

packages/desktop/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"description": "Snowtree desktop application - Electron main process",
55
"main": "dist/index.js",
66
"type": "commonjs",
7+
"dependencies": {
8+
"@snowtree/core": "workspace:*"
9+
},
710
"scripts": {
811
"dev": "tsc -w",
912
"build": "rimraf dist && tsc && npm run copy:assets",

pnpm-lock.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)