diff --git a/.github/workflows/release-ui.yml b/.github/workflows/release-ui.yml index c13785ab..2f13e7e7 100644 --- a/.github/workflows/release-ui.yml +++ b/.github/workflows/release-ui.yml @@ -1,7 +1,7 @@ +name: Release UI + on: - push: - branches: - - main + workflow_call: {} workflow_dispatch: {} permissions: @@ -12,7 +12,8 @@ env: jobs: release-ui: - if: ${{ github.ref == 'refs/heads/main' }} + # Automated via reusable call (main releases); manual runs allowed on dev. + if: ${{ github.event_name == 'workflow_call' || github.ref == 'refs/heads/dev' }} runs-on: ubuntu-24.04 steps: - name: Checkout @@ -27,6 +28,9 @@ jobs: - name: Install dependencies run: npm ci --workspaces --include=optional + - name: Ensure rollup native binary + run: npm install @rollup/rollup-linux-x64-gnu --no-save + - name: Install Cloudflare worker deps run: npm ci working-directory: packages/cloudflare diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 026fd8f3..2f6da125 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -69,6 +69,13 @@ jobs: release_name: ${{ needs.prepare-release.outputs.release_name }} secrets: inherit + release-ui: + needs: prepare-release + permissions: + contents: read + uses: ./.github/workflows/release-ui.yml + secrets: inherit + publish-server: needs: - prepare-release diff --git a/package-lock.json b/package-lock.json index 0d381657..21102305 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codenomad-workspace", - "version": "0.7.6", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codenomad-workspace", - "version": "0.7.6", + "version": "0.8.0", "dependencies": { "7zip-bin": "^5.2.0", "google-auth-library": "^10.5.0" @@ -7384,7 +7384,7 @@ }, "packages/electron-app": { "name": "@neuralnomads/codenomad-electron-app", - "version": "0.7.6", + "version": "0.8.0", "dependencies": { "@codenomad/ui": "file:../ui", "@neuralnomads/codenomad": "file:../server" @@ -7418,7 +7418,7 @@ }, "packages/server": { "name": "@neuralnomads/codenomad", - "version": "0.7.6", + "version": "0.8.0", "dependencies": { "@fastify/cors": "^8.5.0", "@fastify/reply-from": "^9.8.0", @@ -7455,14 +7455,14 @@ }, "packages/tauri-app": { "name": "@codenomad/tauri-app", - "version": "0.7.6", + "version": "0.8.0", "devDependencies": { "@tauri-apps/cli": "^2.9.4" } }, "packages/ui": { "name": "@codenomad/ui", - "version": "0.7.6", + "version": "0.8.0", "dependencies": { "@git-diff-view/solid": "^0.0.8", "@kobalte/core": "0.13.11", diff --git a/package.json b/package.json index 20b5ae29..2031d88a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codenomad-workspace", - "version": "0.7.6", + "version": "0.8.0", "private": true, "description": "CodeNomad monorepo workspace", "workspaces": { diff --git a/packages/cloudflare/scripts/build-manifest.mjs b/packages/cloudflare/scripts/build-manifest.mjs index 582bc34c..945e2af9 100644 --- a/packages/cloudflare/scripts/build-manifest.mjs +++ b/packages/cloudflare/scripts/build-manifest.mjs @@ -72,4 +72,12 @@ const manifest = { fs.mkdirSync(distDir, { recursive: true }) fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8") +const headersPath = path.join(distDir, "_headers") +fs.writeFileSync( + headersPath, + "/version.json\n Cache-Control: no-cache\n Content-Type: application/json; charset=utf-8\n", + "utf-8", +) + console.log(`Wrote ${manifestPath}`) +console.log(`Wrote ${headersPath}`) diff --git a/packages/cloudflare/src/index.ts b/packages/cloudflare/src/index.ts index 46831ae9..fad560cf 100644 --- a/packages/cloudflare/src/index.ts +++ b/packages/cloudflare/src/index.ts @@ -2,28 +2,8 @@ export interface Env { ASSETS: { fetch: (request: Request) => Promise } } -function withHeader(response: Response, key: string, value: string): Response { - const headers = new Headers(response.headers) - headers.set(key, value) - return new Response(response.body, { - status: response.status, - statusText: response.statusText, - headers, - }) -} - export default { async fetch(request: Request, env: Env): Promise { - const url = new URL(request.url) - - if (url.pathname === "/version.json") { - const assetResponse = await env.ASSETS.fetch(request) - - // Ensure this stays fresh; the server uses it on startup. - const withCache = withHeader(assetResponse, "Cache-Control", "no-cache") - return withHeader(withCache, "Content-Type", "application/json; charset=utf-8") - } - - return new Response("Not found", { status: 404 }) + return env.ASSETS.fetch(request) }, } diff --git a/packages/cloudflare/wrangler.toml b/packages/cloudflare/wrangler.toml index fa9d7f2f..e9e6e3b0 100644 --- a/packages/cloudflare/wrangler.toml +++ b/packages/cloudflare/wrangler.toml @@ -12,4 +12,3 @@ custom_domain = true directory = "./dist" binding = "ASSETS" not_found_handling = "404-page" -run_worker_first = ["/version.json"] diff --git a/packages/electron-app/package.json b/packages/electron-app/package.json index 05e986c7..b1dbcddc 100644 --- a/packages/electron-app/package.json +++ b/packages/electron-app/package.json @@ -1,6 +1,6 @@ { "name": "@neuralnomads/codenomad-electron-app", - "version": "0.7.6", + "version": "0.8.0", "description": "CodeNomad - AI coding assistant", "author": { "name": "Neural Nomads", diff --git a/packages/server/package-lock.json b/packages/server/package-lock.json index 96fd85cf..07e5f492 100644 --- a/packages/server/package-lock.json +++ b/packages/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "@neuralnomads/codenomad", - "version": "0.7.6", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@neuralnomads/codenomad", - "version": "0.7.6", + "version": "0.8.0", "dependencies": { "@fastify/cors": "^8.5.0", "@fastify/reply-from": "^9.8.0", diff --git a/packages/server/package.json b/packages/server/package.json index c3dbdd4e..25108e7a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@neuralnomads/codenomad", - "version": "0.7.6", + "version": "0.8.0", "description": "CodeNomad Server", "author": { "name": "Neural Nomads", diff --git a/packages/tauri-app/package.json b/packages/tauri-app/package.json index 8fab3752..3d056d5c 100644 --- a/packages/tauri-app/package.json +++ b/packages/tauri-app/package.json @@ -1,6 +1,6 @@ { "name": "@codenomad/tauri-app", - "version": "0.7.6", + "version": "0.8.0", "private": true, "scripts": { "dev": "tauri dev", diff --git a/packages/ui/package.json b/packages/ui/package.json index acbd42f6..c603d24d 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@codenomad/ui", - "version": "0.7.6", + "version": "0.8.0", "private": true, "type": "module", "scripts": {