Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .github/workflows/zz_generated.create_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/0df8c5e633bb1e4fd17c35525a7b382395526f22/pkg/gen/input/workflows/internal/file/create_release.yaml.template
# https://github.com/giantswarm/devctl/blob/c4c2f6f84e7bc84f838669bce868465c16ae53fb/pkg/gen/input/workflows/internal/file/create_release.yaml.template
#
name: Create Release

Expand All @@ -22,7 +22,6 @@ jobs:
create-release:
uses: giantswarm/github-workflows/.github/workflows/create-release.yaml@main
with:
build-release-artifacts: false
fetch-deep-gitlog-for-build: true
secrets:
TAYLORBOT_GITHUB_ACTION: ${{ secrets.TAYLORBOT_GITHUB_ACTION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.create_release_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
# https://github.com/giantswarm/devctl/blob/ce1c399b27e6055f53983b1fe953fe950416d15d/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
#
name: Create Release PR
on:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/zz_generated.fix_vulnerabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/6ff4d7652142f59436c1d1ef925f8d687e1ac671/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
# https://github.com/giantswarm/devctl/blob/8d8b9dbd820fc286616891556b0ed5299130ee30/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
#

name: Fix Go vulnerabilities
Expand All @@ -14,11 +14,12 @@ on:
inputs:
branch:
description: Branch on which to fix vulnerabilities
default: main
required: true
type: string
log_level:
description: Log Level (info / error / debug)
default: "info"
default: info
type: string

permissions: {}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/zz_generated.semantic_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DO NOT EDIT. Generated with:
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/814a91071850fc945ec1d58f92b761156ad7edb4/pkg/gen/input/workflows/internal/file/semantic_pull_request.yaml.template
#
name: semantic-pull-request

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions: {}

jobs:
semantic-pull-request:
uses: giantswarm/github-workflows/.github/workflows/semantic-pull-request.yaml@main
permissions:
pull-requests: read
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default
rules:
comments:
min-spaces-from-content: 1
document-start: disable
line-length:
max: 200
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/6a704f7e2a8b0f09e82b5bab88f17971af849711/pkg/gen/input/makefile/internal/file/Makefile.template
# https://github.com/giantswarm/devctl/blob/b540873228e4a6d285984243a906c636ba70e0be/pkg/gen/input/makefile/internal/file/Makefile.template
#

include Makefile.*.mk
Expand Down
21 changes: 12 additions & 9 deletions Makefile.gen.go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/bf7f386ac6a4e807dde959892df1369fee6d789f/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template
# https://github.com/giantswarm/devctl/blob/0a4b91f4aa7d4eceff967a333eadac0286a526b3/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template
#

APPLICATION := $(shell go list -m | cut -d '/' -f 3)
BUILDTIMESTAMP := $(shell date -u '+%FT%TZ')
GITSHA1 := $(shell git rev-parse --verify HEAD)
MODULE := $(shell go list -m)
# main() is usually in `main.go`, but sometimes in `cmd/main.go` (for example in newer kubebuilder projects)
MAIN_SOURCE := $(shell if test -e cmd/main.go; then echo cmd/main.go; else echo main.go; fi)
OS := $(shell go env GOOS)
SOURCES := $(shell find . -name '*.go')
VERSION := $(shell architect project version)
VERSION := $(shell gitsemver get)
ifeq ($(OS), linux)
EXTLDFLAGS := -static
endif
LDFLAGS ?= -w -linkmode 'auto' -extldflags '$(EXTLDFLAGS)' \
-X '$(shell go list -m)/pkg/project.buildTimestamp=${BUILDTIMESTAMP}' \
-X '$(shell go list -m)/pkg/project.gitSHA=${GITSHA1}'
-X '$(MODULE)/pkg/project.version=$(VERSION)' \
-X '$(MODULE)/pkg/project.buildTimestamp=$(BUILDTIMESTAMP)' \
-X '$(MODULE)/pkg/project.gitSHA=$(GITSHA1)'

.DEFAULT_GOAL := build

Expand Down Expand Up @@ -63,25 +66,25 @@ $(APPLICATION)-windows-amd64.exe: $(APPLICATION)-v$(VERSION)-windows-amd64.exe

$(APPLICATION)-v$(VERSION)-%-amd64: $(SOURCES)
@echo "====> $@"
CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ .
CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)"

$(APPLICATION)-v$(VERSION)-%-arm64: $(SOURCES)
@echo "====> $@"
CGO_ENABLED=0 GOOS=$* GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ .
CGO_ENABLED=0 GOOS=$* GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)"

$(APPLICATION)-v$(VERSION)-windows-amd64.exe: $(SOURCES)
@echo "====> $@"
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ "$(MAIN_SOURCE)"

.PHONY: install
install: ## Install the application.
@echo "====> $@"
go install -ldflags "$(LDFLAGS)" .
go build -ldflags "$(LDFLAGS)" -o "$(shell go env GOPATH)/bin/$(APPLICATION)" "$(MAIN_SOURCE)"

.PHONY: run
run: ## Runs go run main.go.
@echo "====> $@"
go run -ldflags "$(LDFLAGS)" -race .
go run -ldflags "$(LDFLAGS)" -race "$(MAIN_SOURCE)"

.PHONY: clean
clean: ## Cleans the binary.
Expand Down
Loading