Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
106 changes: 0 additions & 106 deletions .eslintrc

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ dist/
node_modules/
thumbs.db
.idea/
app/
app/
build/bin
snippets/
.task/
39 changes: 0 additions & 39 deletions .yarnclean

This file was deleted.

129 changes: 129 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# https://taskfile.dev

# TODO: Expand on this using Wails v3 as a reference

version: '3'

vars:
BINARY_NAME: BetterDiscord-Installer

tasks:
default:
deps: [dev]

clean:
desc: Clean build artifacts
cmds:
- rm -rf build
- rm -rf frontend/build
- rm -rf frontend/node_modules

frontend:install:
desc: Install frontend dependencies
dir: frontend
sources:
- package.json
- bun.lock
cmds:
- bun install

frontend:build:
desc: Build the Sveltekit frontend
deps: [frontend:install]
dir: frontend
sources:
- "frontend/src/**/*"
- "frontend/*.config.*"
generates:
- "frontend/build/**/*"
- "frontend/.svelte-kit/**/*"
cmds:
- bun run build

frontend:dev:
desc: Start the Sveltekit development server
deps: [frontend:install]
dir: frontend
cmds:
- bun run dev

dev:
desc: Start development server
deps: [frontend:build]
vars:
REVISION: "$(git rev-parse --short HEAD)"
cmds:
# -s skips the frontend build step since it is a dep of the dev task
- wails dev -s -ldflags="-X main.version={{.REVISION}}"

build:
desc: Build the application
deps: [frontend:build]
vars:
VERSION: "$(git describe --tags --abbrev=0)"
sources:
- "frontend/src/**/*"
- "frontend/*.config.*"
- "**/*.go"
generates:
- "build/{{.BINARY_NAME}}*"
cmds:
# -s skips the frontend build step since it is a dep of the build task
- wails build -s -ldflags="-X main.version={{.VERSION}}"

# TODO: Rewrite task in tandem with github actions
build-all:
desc: Build for all platforms
deps: [frontend:build]
cmds:
# -s skips the frontend build step since it is a dep of the build task
- wails build -s -platform windows/amd64 -o {{.BINARY_NAME}}-windows-amd64.exe
- wails build -s -platform windows/arm64 -o {{.BINARY_NAME}}-windows-arm64.exe
- wails build -s -platform darwin/universal -o {{.BINARY_NAME}}-darwin-universal
- wails build -s -platform linux/amd64 -o {{.BINARY_NAME}}-linux-amd64
- wails build -s -platform linux/arm64 -o {{.BINARY_NAME}}-linux-arm64

test:
desc: Run tests
cmds:
- go test -v ./...

lint:
desc: Run linters
cmds:
- task: lint:frontend
- task: lint:go

lint:go:
desc: Run Go linters
cmds:
- golangci-lint run

lint:frontend:
desc: Run frontend linters
dir: frontend
cmds:
- bun run lint

# Requires version to be set in the format vX.Y.Z
release:*:
desc: Create a new release
deps: [test, build-all]
vars:
NEW_VERSION: "{{index .MATCH 0}}"
cmds:
- task: generate-changelog
vars: { VERSION: "{{.NEW_VERSION}}" }
- git tag {{.NEW_VERSION}}
- git push origin {{.NEW_VERSION}}

generate-changelog:
desc: Generate changelog since last release
silent: true
vars:
VERSION: "$(git describe --tags --abbrev=0)"
cmds:
- |
echo "## [{{.VERSION}}] - $(date +%Y-%m-%d)" > CHANGELOG.md
echo "" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:'- %s' >> CHANGELOG.md
Loading