|
| 1 | +name: Dreamforge desktop release |
| 2 | + |
| 3 | +# Builds Dreamforge for macOS (Apple Silicon and Intel) and Windows. A manual run |
| 4 | +# with publish=true uploads the installers and latest.json to the rolling release |
| 5 | +# dreamforge-desktop-latest, which installed apps poll for updates. Publishing only |
| 6 | +# works from main. Pull requests touching this file only build; their installers are |
| 7 | +# run artifacts. |
| 8 | +# |
| 9 | +# Updater signing needs the TAURI_SIGNING_PRIVATE_KEY secret: the minisign key whose |
| 10 | +# public half is desktop/src-tauri/dreamforge-updater.pub, with an empty password. |
| 11 | +# The key only reaches manual runs on main, so it never meets unreviewed code. Other |
| 12 | +# runs still produce installers but no updater archives, and publish refuses. |
| 13 | +# |
| 14 | +# macOS builds are ad-hoc signed and not notarized (no Apple Developer account). |
| 15 | + |
| 16 | +on: |
| 17 | + workflow_dispatch: |
| 18 | + inputs: |
| 19 | + version: |
| 20 | + description: Version, plain x.y.z, newer than the published one |
| 21 | + required: true |
| 22 | + type: string |
| 23 | + publish: |
| 24 | + description: Upload to the dreamforge-desktop-latest release |
| 25 | + type: boolean |
| 26 | + default: false |
| 27 | + pull_request: |
| 28 | + paths: |
| 29 | + - .github/workflows/dreamforge-desktop-release.yml |
| 30 | + - scripts/release-latest-json.py |
| 31 | + |
| 32 | +concurrency: |
| 33 | + group: dreamforge-desktop-release-${{ github.ref }} |
| 34 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 35 | + |
| 36 | +permissions: |
| 37 | + contents: read |
| 38 | + |
| 39 | +env: |
| 40 | + BUZZ_UPDATER_ENDPOINT: https://github.com/QuicksilverSlick/buzz/releases/download/dreamforge-desktop-latest/latest.json |
| 41 | + VERSION: ${{ inputs.version }} |
| 42 | + PUBLISH: ${{ inputs.publish }} |
| 43 | + HAS_UPDATER_KEY: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && secrets.TAURI_SIGNING_PRIVATE_KEY != '' }} |
| 44 | + |
| 45 | +jobs: |
| 46 | + macos: |
| 47 | + name: macOS ${{ matrix.arch }} |
| 48 | + if: github.repository == 'QuicksilverSlick/buzz' |
| 49 | + runs-on: macos-latest |
| 50 | + timeout-minutes: 90 |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + include: |
| 55 | + - target: aarch64-apple-darwin |
| 56 | + arch: aarch64 |
| 57 | + - target: x86_64-apple-darwin |
| 58 | + arch: x64 |
| 59 | + env: |
| 60 | + TARGET: ${{ matrix.target }} |
| 61 | + ARCH: ${{ matrix.arch }} |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 64 | + with: |
| 65 | + persist-credentials: false |
| 66 | + |
| 67 | + - uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0 |
| 68 | + with: |
| 69 | + targets: ${{ matrix.target }} |
| 70 | + |
| 71 | + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 72 | + with: |
| 73 | + node-version: 24.14.1 |
| 74 | + package-manager-cache: false |
| 75 | + |
| 76 | + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 |
| 77 | + with: |
| 78 | + version: 11.4.0 |
| 79 | + |
| 80 | + - name: Install desktop dependencies |
| 81 | + run: pnpm install --frozen-lockfile |
| 82 | + |
| 83 | + - name: Set version |
| 84 | + if: github.event_name == 'workflow_dispatch' |
| 85 | + run: | |
| 86 | + [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::version must be plain x.y.z, got '$VERSION'"; exit 1; } |
| 87 | + # Fail in minutes, not after the builds, when a publish would be refused. |
| 88 | + [ "$PUBLISH" != true ] || python3 scripts/release-latest-json.py --check "$VERSION" "$BUZZ_UPDATER_ENDPOINT" |
| 89 | + cd desktop && node scripts/set-version-from-tag.mjs "$VERSION" |
| 90 | + cd src-tauri && cargo update --workspace |
| 91 | +
|
| 92 | + - name: Generate release config |
| 93 | + run: | |
| 94 | + python3 scripts/release-latest-json.py --selftest |
| 95 | + if [ "$PUBLISH" = true ]; then |
| 96 | + [ "$GITHUB_REF" = refs/heads/main ] || { echo "::error::publish only from main, not $GITHUB_REF"; exit 1; } |
| 97 | + [ "$HAS_UPDATER_KEY" = true ] || { echo "::error::publish needs the TAURI_SIGNING_PRIVATE_KEY secret"; exit 1; } |
| 98 | + fi |
| 99 | + [ "$HAS_UPDATER_KEY" = true ] || echo "::warning::no updater signing key on this run (only manual runs on main get it); building without updater artifacts" |
| 100 | + BUZZ_UPDATER_PUBLIC_KEY=$(cat desktop/src-tauri/dreamforge-updater.pub) |
| 101 | + export BUZZ_UPDATER_PUBLIC_KEY |
| 102 | + echo "BUZZ_UPDATER_PUBLIC_KEY=$BUZZ_UPDATER_PUBLIC_KEY" >> "$GITHUB_ENV" |
| 103 | + cd desktop && node scripts/build-release-config.mjs |
| 104 | + # Ad-hoc signature ("-"): Apple Silicon refuses to launch unsigned code. |
| 105 | + # Tauri refuses to build updater artifacts without the private key. |
| 106 | + node -e ' |
| 107 | + const fs = require("fs"), p = "src-tauri/tauri.release.conf.json"; |
| 108 | + const c = JSON.parse(fs.readFileSync(p, "utf8")); |
| 109 | + c.bundle.macOS.signingIdentity = "-"; |
| 110 | + c.bundle.createUpdaterArtifacts = process.env.HAS_UPDATER_KEY === "true"; |
| 111 | + fs.writeFileSync(p, JSON.stringify(c, null, 2) + "\n"); |
| 112 | + ' |
| 113 | + cat src-tauri/tauri.release.conf.json |
| 114 | +
|
| 115 | + - name: Build sidecars |
| 116 | + run: | |
| 117 | + cargo build --release --target "$TARGET" -p buzz-acp -p buzz-agent -p buzz-backend-kubernetes -p buzz-dev-mcp -p git-credential-nostr -p buzz-cli |
| 118 | + ./scripts/bundle-sidecars.sh "$TARGET" |
| 119 | +
|
| 120 | + - name: Build app and DMG |
| 121 | + run: cd desktop && pnpm tauri build --verbose --target "$TARGET" --bundles app,dmg --config src-tauri/tauri.release.conf.json |
| 122 | + env: |
| 123 | + TAURI_SIGNING_PRIVATE_KEY: ${{ env.HAS_UPDATER_KEY == 'true' && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }} |
| 124 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "" |
| 125 | + CMAKE_POLICY_VERSION_MINIMUM: "3.5" |
| 126 | + MACOSX_DEPLOYMENT_TARGET: "10.15" |
| 127 | + CMAKE_OSX_DEPLOYMENT_TARGET: "10.15" |
| 128 | + TAURI_BUNDLER_DMG_IGNORE_CI: "true" |
| 129 | + |
| 130 | + - name: Verify signature |
| 131 | + run: | |
| 132 | + APP="desktop/src-tauri/target/$TARGET/release/bundle/macos/Dreamforge.app" |
| 133 | + codesign --verify --deep --strict --verbose=2 "$APP" |
| 134 | + codesign -dv --verbose=4 "$APP" |
| 135 | +
|
| 136 | + - name: Stage release files |
| 137 | + run: | |
| 138 | + BUNDLE="desktop/src-tauri/target/$TARGET/release/bundle" |
| 139 | + mkdir out |
| 140 | + cp "$BUNDLE"/dmg/*.dmg out/ |
| 141 | + if [ "$HAS_UPDATER_KEY" = true ]; then |
| 142 | + # Versioned, so publishing never replaces a file the live latest.json points at. |
| 143 | + cp "$BUNDLE/macos/Dreamforge.app.tar.gz" "out/Dreamforge_${VERSION}_$ARCH.app.tar.gz" |
| 144 | + cp "$BUNDLE/macos/Dreamforge.app.tar.gz.sig" "out/Dreamforge_${VERSION}_$ARCH.app.tar.gz.sig" |
| 145 | + fi |
| 146 | + ls -l out |
| 147 | +
|
| 148 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 149 | + with: |
| 150 | + name: dreamforge-macos-${{ matrix.arch }} |
| 151 | + path: out/ |
| 152 | + if-no-files-found: error |
| 153 | + |
| 154 | + windows: |
| 155 | + name: Windows x64 |
| 156 | + if: github.repository == 'QuicksilverSlick/buzz' |
| 157 | + runs-on: windows-latest |
| 158 | + timeout-minutes: 90 |
| 159 | + defaults: |
| 160 | + run: |
| 161 | + shell: bash |
| 162 | + env: |
| 163 | + TARGET: x86_64-pc-windows-msvc |
| 164 | + steps: |
| 165 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 166 | + with: |
| 167 | + persist-credentials: false |
| 168 | + |
| 169 | + - uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0 |
| 170 | + with: |
| 171 | + targets: x86_64-pc-windows-msvc |
| 172 | + |
| 173 | + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 174 | + with: |
| 175 | + node-version: 24.14.1 |
| 176 | + package-manager-cache: false |
| 177 | + |
| 178 | + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 |
| 179 | + with: |
| 180 | + version: 11.4.0 |
| 181 | + |
| 182 | + - name: Install desktop dependencies |
| 183 | + run: pnpm install --frozen-lockfile |
| 184 | + |
| 185 | + - name: Set version |
| 186 | + if: github.event_name == 'workflow_dispatch' |
| 187 | + run: | |
| 188 | + [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::version must be plain x.y.z, got '$VERSION'"; exit 1; } |
| 189 | + cd desktop && node scripts/set-version-from-tag.mjs "$VERSION" |
| 190 | + cd src-tauri && cargo update --workspace |
| 191 | +
|
| 192 | + - name: Generate release config |
| 193 | + run: | |
| 194 | + if [ "$PUBLISH" = true ]; then |
| 195 | + [ "$GITHUB_REF" = refs/heads/main ] || { echo "::error::publish only from main, not $GITHUB_REF"; exit 1; } |
| 196 | + [ "$HAS_UPDATER_KEY" = true ] || { echo "::error::publish needs the TAURI_SIGNING_PRIVATE_KEY secret"; exit 1; } |
| 197 | + fi |
| 198 | + [ "$HAS_UPDATER_KEY" = true ] || echo "::warning::no updater signing key on this run (only manual runs on main get it); building without updater artifacts" |
| 199 | + BUZZ_UPDATER_PUBLIC_KEY=$(cat desktop/src-tauri/dreamforge-updater.pub) |
| 200 | + export BUZZ_UPDATER_PUBLIC_KEY |
| 201 | + echo "BUZZ_UPDATER_PUBLIC_KEY=$BUZZ_UPDATER_PUBLIC_KEY" >> "$GITHUB_ENV" |
| 202 | + cd desktop && node scripts/build-release-config.mjs |
| 203 | + # Tauri refuses to build updater artifacts without the private key. |
| 204 | + node -e ' |
| 205 | + const fs = require("fs"), p = "src-tauri/tauri.release.conf.json"; |
| 206 | + const c = JSON.parse(fs.readFileSync(p, "utf8")); |
| 207 | + c.bundle.createUpdaterArtifacts = process.env.HAS_UPDATER_KEY === "true"; |
| 208 | + fs.writeFileSync(p, JSON.stringify(c, null, 2) + "\n"); |
| 209 | + ' |
| 210 | + cat src-tauri/tauri.release.conf.json |
| 211 | +
|
| 212 | + - name: Build sidecars |
| 213 | + run: | |
| 214 | + cargo build --release --target "$TARGET" -p buzz-acp -p buzz-agent -p buzz-dev-mcp -p git-credential-nostr -p buzz-cli |
| 215 | + ./scripts/bundle-sidecars.sh "$TARGET" |
| 216 | +
|
| 217 | + - name: Build NSIS installer |
| 218 | + run: cd desktop && pnpm tauri build --verbose --target "$TARGET" --bundles nsis --config src-tauri/tauri.release.conf.json |
| 219 | + env: |
| 220 | + TAURI_SIGNING_PRIVATE_KEY: ${{ env.HAS_UPDATER_KEY == 'true' && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }} |
| 221 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "" |
| 222 | + CMAKE_POLICY_VERSION_MINIMUM: "3.5" |
| 223 | + |
| 224 | + - name: Stage release files |
| 225 | + run: | |
| 226 | + NSIS="desktop/src-tauri/target/$TARGET/release/bundle/nsis" |
| 227 | + mkdir out |
| 228 | + cp "$NSIS"/*-setup.exe out/ |
| 229 | + if [ "$HAS_UPDATER_KEY" = true ]; then |
| 230 | + cp "$NSIS"/*-setup.exe.sig out/ |
| 231 | + fi |
| 232 | + ls -l out |
| 233 | +
|
| 234 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 235 | + with: |
| 236 | + name: dreamforge-windows-x64 |
| 237 | + path: out/ |
| 238 | + if-no-files-found: error |
| 239 | + |
| 240 | + publish: |
| 241 | + name: Publish |
| 242 | + if: github.repository == 'QuicksilverSlick/buzz' && github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && inputs.publish |
| 243 | + needs: [macos, windows] |
| 244 | + runs-on: ubuntu-latest |
| 245 | + timeout-minutes: 30 |
| 246 | + concurrency: dreamforge-desktop-publish |
| 247 | + permissions: |
| 248 | + contents: write |
| 249 | + env: |
| 250 | + GH_TOKEN: ${{ github.token }} |
| 251 | + GH_REPO: ${{ github.repository }} |
| 252 | + TAG: dreamforge-desktop-latest |
| 253 | + steps: |
| 254 | + - name: Refuse without the updater signing key |
| 255 | + if: env.HAS_UPDATER_KEY != 'true' |
| 256 | + run: | |
| 257 | + echo "::error::TAURI_SIGNING_PRIVATE_KEY is not set; installed apps could not verify this release" |
| 258 | + exit 1 |
| 259 | +
|
| 260 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 261 | + with: |
| 262 | + persist-credentials: false |
| 263 | + |
| 264 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 265 | + with: |
| 266 | + pattern: dreamforge-* |
| 267 | + path: dist |
| 268 | + merge-multiple: true |
| 269 | + |
| 270 | + - name: Write latest.json |
| 271 | + run: | |
| 272 | + # Refuses a VERSION that is not plain x.y.z or not newer than the live feed. |
| 273 | + python3 scripts/release-latest-json.py --check "$VERSION" "$BUZZ_UPDATER_ENDPOINT" |
| 274 | + ls -l dist |
| 275 | + BASE="https://github.com/$GH_REPO/releases/download/$TAG" |
| 276 | + MAC="Dreamforge_${VERSION}" |
| 277 | + EXE="Dreamforge_${VERSION}_x64-setup.exe" |
| 278 | + for f in "${MAC}_aarch64.app.tar.gz" "${MAC}_x64.app.tar.gz" "$EXE"; do |
| 279 | + [ -s "dist/$f" ] || { echo "::error::missing dist/$f"; exit 1; } |
| 280 | + done |
| 281 | + # --pubkey refuses signatures from any key but the one installed apps trust. |
| 282 | + python3 scripts/release-latest-json.py --pubkey desktop/src-tauri/dreamforge-updater.pub "$VERSION" \ |
| 283 | + "darwin-aarch64=dist/${MAC}_aarch64.app.tar.gz.sig=$BASE/${MAC}_aarch64.app.tar.gz" \ |
| 284 | + "darwin-x86_64=dist/${MAC}_x64.app.tar.gz.sig=$BASE/${MAC}_x64.app.tar.gz" \ |
| 285 | + "windows-x86_64=dist/$EXE.sig=$BASE/$EXE" > latest.json |
| 286 | + cat latest.json |
| 287 | +
|
| 288 | + - name: Upload to the rolling release |
| 289 | + env: |
| 290 | + NOTES: | |
| 291 | + Dreamforge desktop installers. Take the newest version number. |
| 292 | +
|
| 293 | + **Windows:** download `Dreamforge_<version>_x64-setup.exe` and run it. If SmartScreen says "Windows protected your PC", click **More info**, then **Run anyway**. |
| 294 | +
|
| 295 | + **Mac:** download the DMG for your chip (`aarch64` for Apple Silicon, `x64` for Intel), open it and drag Dreamforge to Applications. The first launch is blocked because the app is not notarized: open **System Settings**, **Privacy & Security**, and click **Open Anyway**. |
| 296 | +
|
| 297 | + Installed apps update themselves from `latest.json` here. |
| 298 | + run: | |
| 299 | + gh release view "$TAG" > /dev/null 2>&1 || gh release create "$TAG" --target "$GITHUB_SHA" --title "Dreamforge desktop" --notes "$NOTES" |
| 300 | + gh release upload "$TAG" dist/*.dmg dist/*.app.tar.gz dist/*.exe dist/*.sig --clobber |
| 301 | + # latest.json last, so apps only see the new version once every file it names is uploaded. |
| 302 | + gh release upload "$TAG" latest.json --clobber |
0 commit comments