failed the script when bundle:default fails and cleanup "alpha" (#8580)

This commit is contained in:
Lifei Zhou
2026-04-16 15:51:23 +10:00
committed by GitHub
parent a5a497b341
commit 625f2d75fe
5 changed files with 9 additions and 37 deletions
+3 -15
View File
@@ -140,14 +140,13 @@ run-ui-only:
@echo "Running UI..." @echo "Running UI..."
cd ui/desktop && pnpm install && pnpm run start-gui cd ui/desktop && pnpm install && pnpm run start-gui
debug-ui *alpha: debug-ui:
@echo "🚀 Starting goose frontend in external backend mode{{ if alpha == "alpha" { " with alpha features enabled" } else { "" } }}" @echo "🚀 Starting goose frontend in external backend mode"
cd ui/desktop && \ cd ui/desktop && \
export GOOSE_EXTERNAL_BACKEND=true && \ export GOOSE_EXTERNAL_BACKEND=true && \
export GOOSE_SERVER__SECRET_KEY="${GOOSE_SERVER__SECRET_KEY:-test}" && \ export GOOSE_SERVER__SECRET_KEY="${GOOSE_SERVER__SECRET_KEY:-test}" && \
{{ if alpha == "alpha" { "export ALPHA=true &&" } else { "" } }} \
pnpm install && \ pnpm install && \
pnpm run {{ if alpha == "alpha" { "start-alpha-gui" } else { "start-gui" } }} pnpm run start-gui
# Run UI with main process debugging enabled # Run UI with main process debugging enabled
# To debug main process: # To debug main process:
@@ -173,12 +172,6 @@ package-ui:
codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
@echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app" @echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app"
# Run UI with alpha changes
run-ui-alpha:
@just release-binary
@echo "Running UI with alpha features..."
cd ui/desktop && pnpm install && ALPHA=true pnpm run start-alpha-gui
# Run UI with latest (Windows version) # Run UI with latest (Windows version)
run-ui-windows: run-ui-windows:
@just release-windows @just release-windows
@@ -254,11 +247,6 @@ make-ui:
@just release-binary @just release-binary
cd ui/desktop && pnpm run bundle:default cd ui/desktop && pnpm run bundle:default
# make GUI with latest binary and alpha features enabled
make-ui-alpha:
@just release-binary
cd ui/desktop && pnpm run bundle:alpha
# make GUI with latest Windows binary # make GUI with latest Windows binary
make-ui-windows: make-ui-windows:
@just release-windows @just release-windows
+1 -3
View File
@@ -17,8 +17,7 @@
"start:test-error": "GOOSE_TEST_ERROR=true electron-forge start", "start:test-error": "GOOSE_TEST_ERROR=true electron-forge start",
"package": "pnpm run i18n:compile && electron-forge package", "package": "pnpm run i18n:compile && electron-forge package",
"make": "pnpm run i18n:compile && electron-forge make", "make": "pnpm run i18n:compile && electron-forge make",
"bundle:default": "node scripts/prepare-platform-binaries.js && pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}.zip\") || echo \"${APP_BUNDLE} not found; either the binary is not built or you are not on macOS\"", "bundle:default": "node scripts/prepare-platform-binaries.js && pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}.zip\")",
"bundle:alpha": "ALPHA=true node scripts/prepare-platform-binaries.js && ALPHA=true pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}_alpha.zip\") || echo \"${APP_BUNDLE} not found; either the binary is not built or you are not on macOS\"",
"bundle:intel": "node scripts/prepare-platform-binaries.js && pnpm run make --arch=x64 && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-x64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}_intel_mac.zip\")", "bundle:intel": "node scripts/prepare-platform-binaries.js && pnpm run make --arch=x64 && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-x64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}_intel_mac.zip\")",
"debug": "echo 'run --remote-debugging-port=8315' && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && lldb \"out/${BUNDLE_NAME}-darwin-arm64/${BUNDLE_NAME}.app\"", "debug": "echo 'run --remote-debugging-port=8315' && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && lldb \"out/${BUNDLE_NAME}-darwin-arm64/${BUNDLE_NAME}.app\"",
"test-e2e": "pnpm run generate-api && playwright test", "test-e2e": "pnpm run generate-api && playwright test",
@@ -38,7 +37,6 @@
"test:integration": "vitest run --config vitest.integration.config.ts", "test:integration": "vitest run --config vitest.integration.config.ts",
"test:integration:watch": "vitest --config vitest.integration.config.ts", "test:integration:watch": "vitest --config vitest.integration.config.ts",
"test:integration:debug": "DEBUG=1 vitest run --config vitest.integration.config.ts", "test:integration:debug": "DEBUG=1 vitest run --config vitest.integration.config.ts",
"start-alpha-gui": "ALPHA=true pnpm run start-gui",
"i18n:extract": "formatjs extract 'src/**/*.{ts,tsx}' --out-file src/i18n/messages/en.json --flatten && pnpm run i18n:compile", "i18n:extract": "formatjs extract 'src/**/*.{ts,tsx}' --out-file src/i18n/messages/en.json --flatten && pnpm run i18n:compile",
"i18n:check": "node scripts/i18n-check.js", "i18n:check": "node scripts/i18n-check.js",
"i18n:compile": "node scripts/i18n-compile.js" "i18n:compile": "node scripts/i18n-compile.js"
@@ -3,10 +3,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/Tooltip';
import { defineMessages, useIntl } from '../../i18n'; import { defineMessages, useIntl } from '../../i18n';
const i18n = defineMessages({ const i18n = defineMessages({
alpha: {
id: 'environmentBadge.alpha',
defaultMessage: 'Alpha',
},
dev: { dev: {
id: 'environmentBadge.dev', id: 'environmentBadge.dev',
defaultMessage: 'Dev', defaultMessage: 'Dev',
@@ -19,18 +15,13 @@ interface EnvironmentBadgeProps {
const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) => { const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) => {
const intl = useIntl(); const intl = useIntl();
const isAlpha = process.env.ALPHA;
const isDevelopment = import.meta.env.DEV; const isDevelopment = import.meta.env.DEV;
// Don't show badge in production if (!isDevelopment) {
if (!isDevelopment && !isAlpha) {
return null; return null;
} }
const tooltipText = isAlpha const tooltipText = intl.formatMessage(i18n.dev);
? intl.formatMessage(i18n.alpha)
: intl.formatMessage(i18n.dev);
const bgColor = isAlpha ? 'bg-purple-600' : 'bg-orange-400';
return ( return (
<Tooltip> <Tooltip>
@@ -41,13 +32,13 @@ const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) =
aria-label={tooltipText} aria-label={tooltipText}
> >
<div className="absolute -inset-1" /> <div className="absolute -inset-1" />
<div className={`${bgColor} w-2 h-2 rounded-full`} /> <div className="bg-orange-400 w-2 h-2 rounded-full" />
</div> </div>
</TooltipTrigger> </TooltipTrigger>
<TooltipContent <TooltipContent
side="bottom" side="bottom"
className={bgColor} className="bg-orange-400"
arrowClassName={isAlpha ? 'fill-purple-600 bg-purple-600' : 'fill-orange-400 bg-orange-400'} arrowClassName="fill-orange-400 bg-orange-400"
> >
{tooltipText} {tooltipText}
</TooltipContent> </TooltipContent>
-3
View File
@@ -932,9 +932,6 @@
"envVarsSection.variableName": { "envVarsSection.variableName": {
"defaultMessage": "Variable name" "defaultMessage": "Variable name"
}, },
"environmentBadge.alpha": {
"defaultMessage": "Alpha"
},
"environmentBadge.dev": { "environmentBadge.dev": {
"defaultMessage": "Dev" "defaultMessage": "Dev"
}, },
-2
View File
@@ -4,8 +4,6 @@ import tailwindcss from '@tailwindcss/vite';
// https://vitejs.dev/config // https://vitejs.dev/config
export default defineConfig({ export default defineConfig({
define: { define: {
// This replaces process.env.ALPHA with a literal at build time
'process.env.ALPHA': JSON.stringify(process.env.ALPHA === 'true'),
'process.env.GOOSE_TUNNEL': JSON.stringify(process.env.GOOSE_TUNNEL !== 'no' && process.env.GOOSE_TUNNEL !== 'none'), 'process.env.GOOSE_TUNNEL': JSON.stringify(process.env.GOOSE_TUNNEL !== 'no' && process.env.GOOSE_TUNNEL !== 'none'),
}, },