Skip to content

Commit

Permalink
Rename GitHub Workflows (#3176)
Browse files Browse the repository at this point in the history
* Rename GitHub Workflows
* Renamed package.json name
* Remove name from CI Build
* Remove name from names
* Update Build and Package Scripts
* Improve install and start errors and workflow
* Update apps/zui/package.json
  • Loading branch information
jameskerr authored Feb 27, 2025
1 parent fefada6 commit dc63d5c
Show file tree
Hide file tree
Showing 18 changed files with 258 additions and 160 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build Zui
description: Build Zui for the current platform
name: Build App
description: Build app for the current platform
inputs:
cmd:
required: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Zui
description: Shared steps for setting up Zui in workflows
name: Setup App
description: Shared steps for setting up the app in workflows
runs:
using: 'composite'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/advance-zed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
ref: ${{ github.ref }}
# We need a token with permission to push.
token: ${{ secrets.ZQ_UPDATE_PAT }}
- uses: ./.github/actions/setup-zui
- uses: ./.github/actions/setup-app
- run: sudo apt-get -y install whois
- run: yarn workspace zui add zed@brimdata/zed#${{ env.zed_ref }}
- run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
ref: ${{ github.event.inputs.zui-branch }}

- name: Setup Zui
uses: ./.github/actions/setup-zui
uses: ./.github/actions/setup-app

- name: Inject package.json
run: yarn nx inject insiders ${{ needs.check_latest.outputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: actions/checkout@v4

- name: Setup Zui
uses: ./.github/actions/setup-zui
uses: ./.github/actions/setup-app

- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn nx package-zui zui
cmd: yarn nx package-app zui
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
ssl_com_username: ${{ secrets.WINDOWS_SIGNING_SSL_COM_USERNAME }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Zui CI
name: CI

on:
pull_request:
Expand All @@ -17,7 +17,7 @@ jobs:
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-zui
- uses: ./.github/actions/setup-app
- run: yarn lint
- run: yarn test
- name: Build and install package
Expand All @@ -28,7 +28,7 @@ jobs:
set -x
case ${{ runner.os }} in
Linux )
yarn nx package-zui zui --linux=deb --publish never
yarn nx package-app superdb-desktop --linux=deb --publish never
sudo apt install -y --no-install-recommends ./dist/apps/zui/*.deb
;;
esac
10 changes: 5 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:
type: choice
default: 'true'
options:
- 'true'
- 'false'
- 'true'
- 'false'
required: true
debug:
description: Playwright debug logging
type: choice
options:
- 'pw:api'
- ''
- 'pw:api'
- ''
always-upload:
description: Always upload artifacts even if tests don't fail?
type: boolean
Expand All @@ -42,7 +42,7 @@ jobs:
run: echo "${{ toJSON(inputs) }}"
shell: sh
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-zui
- uses: ./.github/actions/setup-app
- name: Install dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu-')
run: sudo apt-get -y install whois
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Zui
uses: ./.github/actions/setup-zui
uses: ./.github/actions/setup-app

- name: Inject package.json
run: yarn nx inject insiders ${{ needs.check_latest.outputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: actions/checkout@v4

- name: Setup Zui
uses: ./.github/actions/setup-zui
uses: ./.github/actions/setup-app

- name: Build Zui
uses: ./.github/actions/build-zui
with:
cmd: yarn nx release-zui zui
cmd: yarn nx release-app zui
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Windows
ssl_com_username: ${{ secrets.WINDOWS_SIGNING_SSL_COM_USERNAME }}
Expand Down
10 changes: 5 additions & 5 deletions apps/zui/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "zui",
"productName": "Zui",
"name": "superdb-desktop",
"productName": "SuperDB",
"private": true,
"description": "Zed User Interface",
"description": "SuperDB Desktop",
"repository": "https://github.com/brimdata/zui",
"license": "BSD-3-Clause",
"version": "1.18.0",
Expand All @@ -29,8 +29,8 @@
"tsc": "",
"postinstall": "node scripts/post-install.cjs",
"prepare": "husky install",
"package-zui": "electron-builder --publish never",
"release-zui": "electron-builder",
"package-app": "electron-builder --publish never",
"release-app": "electron-builder",
"package-insiders": "electron-builder --config electron-builder-insiders.json --publish never",
"release-insiders": "electron-builder --config electron-builder-insiders.json --publish always"
},
Expand Down
4 changes: 2 additions & 2 deletions apps/zui/scripts/clean.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs-extra")
const glob = require("glob")
import fs from "fs-extra"
import glob from "glob"

fs.removeSync("out")
fs.removeSync(".next")
Expand Down
8 changes: 6 additions & 2 deletions apps/zui/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ async function start() {
}

process.on("SIGINT", () => process.exit(0))

start()
try {
await start()
} catch (e) {
console.error(e)
process.exit(1)
}
7 changes: 6 additions & 1 deletion apps/zui/scripts/util/sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {spawn} from "child_process"

class Sub {
constructor(bin, args) {
this.bin = bin
this.args = args
this.p = spawn(bin, [args], {
shell: true,
})
Expand Down Expand Up @@ -32,8 +34,11 @@ class Sub {
if (debug) console.log(d.toString())
if (pattern.test(d.toString())) res()
})
this.p.stderr.on("data", (buffer) => {
console.log(buffer.toString())
})
this.p.on("close", () => {
rej("Process closed before receiving expected output: " + pattern)
rej("The process \"" + this.bin + " " + this.args + "\" closed before receiving expected output: " + pattern)
})
}).finally(() => {
this.waiting = false
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
},
"scripts": {
"build-affected": "nx affected --target=build",
"build-deps": "nx run-many -t build -p @brimdata/zed-js @brimdata/zed-node",
"build": "nx run-many -t build --all",
"lint": "nx run-many -t lint --all",
"test": "nx run-many -t test --all --exclude zui-player --skip-nx-cache",
"start": "nx start zui",
"start": "nx start superdb-desktop",
"clean": "nx run-many -t clean --all",
"e2e": "NODE_ENV=production nx test zui-player",
"e2e:ci": "NODE_ENV=production nx ci zui-player",
"artifact-path": "node tools/scripts/artifact-path.js"
"artifact-path": "node tools/scripts/artifact-path.js",
"postinstall": "yarn build-deps"
},
"devDependencies": {
"@swc/core": "^1.10.18",
Expand Down
4 changes: 3 additions & 1 deletion packages/zed-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"exports": "./dist/index.js",
"scripts": {
"test": "jest",
"build": "tsc"
"build": "tsc",
"clean": "rimraf dist"
},
"dependencies": {
"date-fns": "^3.6.0",
Expand All @@ -19,6 +20,7 @@
"@types/event-source-polyfill": "^1.0.1",
"@types/strftime": "^0.9.8",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"typescript": "5.1.5"
}
}
4 changes: 3 additions & 1 deletion packages/zed-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"exports": "./dist/index.js",
"scripts": {
"test": "jest",
"build": "tsc"
"build": "tsc",
"clean": "rimraf dist"
},
"dependencies": {
"@brimdata/zed-js": "workspace:*",
Expand All @@ -15,6 +16,7 @@
"devDependencies": {
"jest": "^29.7.0",
"node-fetch": "^2.6.1",
"rimraf": "^6.0.1",
"super": "github:brimdata/super#main",
"typescript": "5.1.5"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/zui-player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"scripts": {
"lint": "tsc",
"test": "playwright test -c playwright.config.js",
"ci": "playwright test -c ci.config.js"
"ci": "playwright test -c ci.config.js",
"clean": "rimraf run"
},
"dependencies": {
"@playwright/test": "1.44.0",
"fs-extra": "^11.3.0",
"playwright": "1.44.0",
"playwright-chromium": "1.44.0",
"rimraf": "^6.0.1",
"typescript": "5.1.5"
}
}
Loading

0 comments on commit dc63d5c

Please sign in to comment.