-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
71 lines (58 loc) · 2.45 KB
/
Copy pathmise.toml
File metadata and controls
71 lines (58 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Developer toolchain — install everything with `mise install`
[tools]
# Build
go = "1.26"
# Lint
golangci-lint = "latest"
# Used by the template-creation workflow in README.md
jq = "latest"
upctl = "latest"
# Tasks — run with `mise run <task>` (list them with `mise tasks`).
# Version metadata comes from scripts/ldflags.sh.
[tasks.build]
description = "Build the plugin binary into bin/ (ad-hoc signs it on macOS)"
run = """
go build -ldflags "$(scripts/ldflags.sh)" -o bin/fleeting-plugin-upcloud .
[ "$(uname -s)" != "Darwin" ] || codesign --sign - bin/fleeting-plugin-upcloud
"""
[tasks.deploy]
description = "Build, sign, and install to /usr/local/bin (where config.toml finds it by name)"
depends = ["build"]
run = "sudo install -m 0755 bin/fleeting-plugin-upcloud /usr/local/bin/fleeting-plugin-upcloud"
[tasks.build-linux]
description = "Build for Linux (amd64 and arm64) into bin/linux-<arch>/"
run = """
GOOS=linux GOARCH=amd64 go build -ldflags "$(scripts/ldflags.sh)" -o bin/linux-amd64/fleeting-plugin-upcloud .
GOOS=linux GOARCH=arm64 go build -ldflags "$(scripts/ldflags.sh)" -o bin/linux-arm64/fleeting-plugin-upcloud .
"""
[tasks.build-mac]
description = "Build for macOS (amd64 and arm64) into bin/darwin-<arch>/ (ad-hoc signs on a macOS host)"
run = """
GOOS=darwin GOARCH=amd64 go build -ldflags "$(scripts/ldflags.sh)" -o bin/darwin-amd64/fleeting-plugin-upcloud .
GOOS=darwin GOARCH=arm64 go build -ldflags "$(scripts/ldflags.sh)" -o bin/darwin-arm64/fleeting-plugin-upcloud .
[ "$(uname -s)" != "Darwin" ] || codesign --sign - bin/darwin-amd64/fleeting-plugin-upcloud
[ "$(uname -s)" != "Darwin" ] || codesign --sign - bin/darwin-arm64/fleeting-plugin-upcloud
"""
[tasks.build-all]
description = "Build for all common platforms into bin/<os>-<arch>/"
depends = ["build-linux", "build-mac"]
# Built with an explicit -o: `go install` would name the binary after the
# module path (gitlab-fleeting-plugin-upcloud), breaking runner discovery,
# which requires the fleeting-plugin-<name> convention.
[tasks.install]
description = "Install the binary to $GOPATH/bin (makes it available on $PATH)"
run = """
go build -ldflags "$(scripts/ldflags.sh)" -o "$(go env GOPATH)/bin/fleeting-plugin-upcloud" .
"""
[tasks.test]
description = "Run tests"
run = "go test ./..."
[tasks.vet]
description = "Run go vet"
run = "go vet ./..."
[tasks.lint]
description = "Run golangci-lint"
run = "golangci-lint run ./..."
[tasks.clean]
description = "Remove build artifacts"
run = "rm -rf bin/"