-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 1.1 KB
/
Makefile
File metadata and controls
35 lines (26 loc) · 1.1 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
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 The plugin-template Authors
.PHONY: build test lint coverage release build-all-platforms clean
PLUGIN_NAME ?= plugin
DIST_DIR ?= dist
build:
mkdir -p bin
go build -o bin/$(PLUGIN_NAME) ./cmd/plugin
test:
go test -v ./...
lint:
golangci-lint run
coverage:
go test -cover ./...
build-all-platforms:
mkdir -p $(DIST_DIR)
GOOS=linux GOARCH=amd64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-linux-amd64 ./cmd/plugin
GOOS=linux GOARCH=arm64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-linux-arm64 ./cmd/plugin
GOOS=darwin GOARCH=amd64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-darwin-amd64 ./cmd/plugin
GOOS=darwin GOARCH=arm64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-darwin-arm64 ./cmd/plugin
GOOS=windows GOARCH=amd64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-windows-amd64.exe ./cmd/plugin
GOOS=windows GOARCH=arm64 go build -o $(DIST_DIR)/$(PLUGIN_NAME)-windows-arm64.exe ./cmd/plugin
release:
@echo "Build all release artifacts locally with 'make build-all-platforms' and push a v*.*.* tag to trigger .github/workflows/release.yml"
clean:
go clean