Skip to content

Commit

Permalink
feat(ci): use task instead of makefile
Browse files Browse the repository at this point in the history
- Easier to use cross platform (Windows)
- Self documenting / less confusing
- Better structure as we can use separate task files to organize by
  functionality.
  • Loading branch information
evan-buss committed Oct 29, 2022
1 parent 1366f9c commit a8184a5
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ openbooks
!openbooks/
*.DS_Store
**/dist
.task/
# end persist


Expand Down
52 changes: 52 additions & 0 deletions Taskfile.Development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# https://taskfile.dev

version: "3"

tasks:
go-update:
desc: Update Golang dependencies.
cmds:
- go get -u ./..
- go mod tidy

npm-update:
desc: Update Node.JS client side dependencies.
dir: server/app
cmds:
- npx npm-check-updates -i
interactive: true

npm-install:
desc: Install Node.JS client side dependencies.
dir: server/app
cmds:
- npm install
sources:
- package.json
- package-lock.json

mock:
desc: Start Mock Server for Development
dir: cmd/mock_server
cmds:
- go run .

cli:
desc: Run OpenBooks in CLI Mode.
dir: cmd/openbooks
cmds:
- go build
- ./openbooks cli --server localhost:6667

server:
desc: Run OpenBooks in Server Mode.
dir: cmd/openbooks
cmds:
- go build
- ./openbooks server --tls=false --server localhost:6667

client:
desc: Run OpenBooks React Client Application in Development Mode.
dir: server/app
cmds:
- npm run dev
22 changes: 22 additions & 0 deletions Taskfile.Release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://taskfile.dev

version: "3"

tasks:
npm-build:
internal: true
dir: server/app
cmds:
- npm ci
- npm run build

build:
desc: Build OpenBooks binaries for all supported platforms.
dir: cmd/openbooks
cmds:
- go get ./..
- env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./../../build/openbooks.exe
- env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./../../build/openbooks_mac
- env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./../../build/openbooks_mac_arm
- env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./../../build/openbooks_linux
- env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./../../build/openbooks_linux_arm
7 changes: 7 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://taskfile.dev

version: "3"

includes:
dev: Taskfile.Development.yaml
release: Taskfile.Release.yaml
36 changes: 0 additions & 36 deletions makefile

This file was deleted.

0 comments on commit a8184a5

Please sign in to comment.