Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce rebuilding in Taskfile #1306

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 28 additions & 29 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ tasks:

build:server:
desc: Build the wavesrv component.
cmds:
- task: build:server:linux
- task: build:server:macos
- task: build:server:windows
deps:
- go:mod:tidy
- generate
- build:server:linux
- build:server:macos
- build:server:windows
sources:
- "cmd/server/*.go"
- "pkg/**/*.go"
generates:
- dist/bin/wavesrv.*

build:server:macos:
desc: Build the wavesrv component for macOS (Darwin) platforms (generates artifacts for both arm64 and amd64).
Expand Down Expand Up @@ -159,13 +166,6 @@ tasks:
var: ARCHS
split: ","
as: GOARCH
sources:
- "cmd/server/*.go"
- "pkg/**/*.go"
generates:
- dist/bin/wavesrv.*{{exeExt}}
deps:
- go:mod:tidy
internal: true

build:wsh:
Expand Down Expand Up @@ -198,19 +198,13 @@ tasks:
GOOS: windows
GOARCH: arm64
deps:
- go:mod:tidy
- generate

dev:installwsh:
desc: quick shortcut to rebuild wsh and install for macos arm64
requires:
vars:
- VERSION
cmds:
- task: build:wsh:internal
vars:
GOOS: darwin
GOARCH: arm64
- cp dist/bin/wsh-{{.VERSION}}-darwin.arm64 ~/Library/Application\ Support/waveterm-dev/bin/wsh
sources:
- "cmd/wsh/**/*.go"
- "pkg/**/*.go"
generates:
- dist/bin/wsh-*

build:wsh:internal:
vars:
Expand All @@ -223,14 +217,7 @@ tasks:
- GOOS
- GOARCH
- VERSION
sources:
- "cmd/wsh/**/*.go"
- "pkg/**/*.go"
generates:
- dist/bin/wsh-{{.VERSION}}-{{.GOOS}}.{{.NORMALIZEDARCH}}{{.EXT}}
cmd: (CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -ldflags="-s -w -X main.BuildTime=$({{.DATE}} +'%Y%m%d%H%M') -X main.WaveVersion={{.VERSION}}" -o dist/bin/wsh-{{.VERSION}}-{{.GOOS}}.{{.NORMALIZEDARCH}}{{.EXT}} cmd/wsh/main-wsh.go)
deps:
- go:mod:tidy
internal: true

generate:
Expand Down Expand Up @@ -300,6 +287,18 @@ tasks:
cmd: |
wingetcreate update {{.WINGET_PACKAGE}} -s -v {{.UP_VERSION}} -u "https://{{.RELEASES_BUCKET}}/{{.APP_NAME}}-win32-x64-{{.UP_VERSION}}.msi" -t $env:GITHUB_TOKEN

dev:installwsh:
desc: quick shortcut to rebuild wsh and install for macos arm64
requires:
vars:
- VERSION
cmds:
- task: build:wsh:internal
vars:
GOOS: darwin
GOARCH: arm64
- cp dist/bin/wsh-{{.VERSION}}-darwin.arm64 ~/Library/Application\ Support/waveterm-dev/bin/wsh

yarn:
desc: Runs `yarn`
internal: true
Expand Down
Loading