okay let's see what happens

This commit is contained in:
Evan Simkowitz 2024-03-01 17:58:59 -08:00
parent 07f176ea53
commit 95d7f72456
No known key found for this signature in database
5 changed files with 57 additions and 45 deletions

View File

@ -11,15 +11,13 @@ jobs:
matrix: matrix:
include: include:
- platform: "darwin" - platform: "darwin"
arch: "x64" arch: "universal"
runner: "macos-latest"
scripthaus: "build-package"
- platform: "darwin"
arch: "arm64"
runner: "macos-latest-xlarge" runner: "macos-latest-xlarge"
scripthaus: "build-package" scripthaus: "build-package"
- platform: "linux" - platform: "linux"
arch: "x64" arch:
- "amd64"
- "arm64"
runner: "ubuntu-latest" runner: "ubuntu-latest"
scripthaus: "build-package-linux" scripthaus: "build-package-linux"
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
@ -58,8 +56,9 @@ jobs:
echo "WAVETERM_VERSION=${VERSION}" >> "$GITHUB_OUTPUT" echo "WAVETERM_VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Install Yarn Dependencies - name: Install Yarn Dependencies
run: yarn --frozen-lockfile run: yarn --frozen-lockfile
- name: Build - name: Build ${{ matrix.platform }} ${{ matrix.arch }}
run: ./scripthaus/scripthaus run ${{ matrix.scripthaus }} run: |
GOARCH=${{ matrix.arch}} ./scripthaus/scripthaus run ${{ matrix.scripthaus }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: waveterm-build-${{ matrix.platform }}-${{ matrix.arch }} name: waveterm-build-${{ matrix.platform }}-${{ matrix.arch }}

View File

@ -25,16 +25,17 @@ const config = {
to: "./bin", to: "./bin",
filter: ["**/*"], filter: ["**/*"],
}, },
{
from: "./node_modules",
to: "./node_modules",
filter: ["monaco-editor/min/*"],
},
{ {
from: ".", from: ".",
to: ".", to: ".",
filter: ["package.json"], filter: ["package.json"],
}, },
"!**/node_modules/**${/*}", // Ignore node_modules by default
{
from: "./node_modules",
to: "./node_modules",
filter: ["monaco-editor/min/**/*"], // This is the only module we want to include
},
], ],
directories: { directories: {
output: "buildres/builder", output: "buildres/builder",
@ -55,12 +56,11 @@ const config = {
executableName: pkg.productName, executableName: pkg.productName,
category: "TerminalEmulator", category: "TerminalEmulator",
icon: "public/waveterm.icns", icon: "public/waveterm.icns",
target: ["zip", "rpm", "deb", "flatpak", "pacman"], target: ["zip", "deb"],
asar: false,
desktop: { desktop: {
Name: pkg.productName, Name: pkg.productName,
Comment: pkg.description, Comment: pkg.description,
Exec: pkg.productName,
Icon: pkg.build.appId,
Keywords: "developer;terminal;emulator;", Keywords: "developer;terminal;emulator;",
category: "Development;Utility;", category: "Development;Utility;",
}, },

View File

@ -1,14 +1,14 @@
{ {
"name": "waveterm", "name": "waveterm",
"author": "Command Line Inc", "author": {
"name": "Command Line Inc",
"email": "info@commandline.dev"
},
"productName": "Wave", "productName": "Wave",
"description": "An open-source, cross-platform, AI-integrated, modern terminal for seamless workflows.", "description": "An open-source, cross-platform, AI-integrated, modern terminal for seamless workflows.",
"version": "0.6.1", "version": "0.6.1",
"main": "dist/emain.js", "main": "dist/emain.js",
"license": "Apache-2.0", "license": "Apache-2.0",
"maintainers": [
"Command Line Inc"
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/wavetermdev/waveterm" "url": "https://github.com/wavetermdev/waveterm"

View File

@ -44,13 +44,21 @@ rm -rf bin/
rm -rf build/ rm -rf build/
node_modules/.bin/webpack --env prod node_modules/.bin/webpack --env prod
WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))') WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))')
WAVESHELL_VERSION=v0.4
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go) function buildWaveShell {
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go) (cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go) }
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go) function buildWaveSrv {
(cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M') -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv ./cmd) (cd wavesrv; CGO_ENABLED=1 GOARCH=$1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M') -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv.$1 ./cmd)
yarn run electron-builder -c electron-builder.config.js }
buildWaveShell darwin amd64
buildWaveShell darwin arm64
buildWaveShell linux amd64
buildWaveShell linux arm64
buildWaveSrv arm64
buildWaveSrv amd64
yarn run electron-builder -c electron-builder.config.js -m
``` ```
```bash ```bash
@ -61,38 +69,43 @@ rm -rf bin/
rm -rf build/ rm -rf build/
node_modules/.bin/webpack --env prod node_modules/.bin/webpack --env prod
WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))') WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))')
WAVESHELL_VERSION=v0.4
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go) function buildWaveShell {
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go) (cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go) }
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go) function buildWaveSrv {
# adds -extldflags=-static, *only* on linux (macos does not support fully static binaries) to avoid a glibc dependency # adds -extldflags=-static, *only* on linux (macos does not support fully static binaries) to avoid a glibc dependency
(cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-linkmode 'external' -extldflags=-static $GO_LDFLAGS -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv ./cmd) (cd wavesrv; CGO_ENABLED=1 GOARCH=$1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-linkmode 'external' -extldflags=-static $GO_LDFLAGS -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv.$1 ./cmd)
node_modules/.bin/electron-forge make }
``` buildWaveShell darwin amd64
buildWaveShell darwin arm64
```bash buildWaveShell linux amd64
# @scripthaus command open-electron-package buildWaveShell linux arm64
# @scripthaus cd :playbook buildWaveSrv $GOARCH
open out/Wave-darwin-x64/Wave.app yarn run electron-builder -c electron-builder.config.js -l
``` ```
```bash ```bash
# @scripthaus command build-wavesrv # @scripthaus command build-wavesrv
WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))') WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))')
cd wavesrv cd wavesrv
CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M') -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv ./cmd CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M') -X main.WaveVersion=$WAVESRV_VERSION" -o ../bin/wavesrv.$GOARCH ./cmd
``` ```
```bash ```bash
# @scripthaus command fullbuild-waveshell # @scripthaus command fullbuild-waveshell
set -e set -e
cd waveshell cd waveshell
WAVESHELL_VERSION=v0.4
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go function buildWaveShell {
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go (cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go }
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go buildWaveShell darwin amd64
buildWaveShell darwin arm64
buildWaveShell linux amd64
buildWaveShell linux arm64
``` ```
```bash ```bash

View File

@ -160,7 +160,7 @@ function getBaseHostPort(): string {
} }
function getWaveSrvPath(): string { function getWaveSrvPath(): string {
return path.join(getGoAppBasePath(), "bin", "wavesrv"); return path.join(getGoAppBasePath(), "bin", `wavesrv.${unameArch}`);
} }
function getWaveSrvCmd(): string { function getWaveSrvCmd(): string {