Skip to content

Commit a48494d

Browse files
chore: align files according to platform standards
1 parent 4591edb commit a48494d

10 files changed

Lines changed: 83 additions & 29 deletions

.github/workflows/zz_generated.add-team-labels.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
| jq -r '.content' \
2222
| base64 -d > artifacts/users.yaml
2323
- name: Upload Artifact
24-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
24+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2525
with:
2626
name: users
2727
path: artifacts/users.yaml
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
needs: build_user_list
3434
steps:
35-
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
35+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
3636
id: download-users
3737
with:
3838
name: users
@@ -51,7 +51,7 @@ jobs:
5151
echo "EOF" >> $GITHUB_ENV
5252
- name: Apply label to issue
5353
if: ${{ env.LABEL != '' && env.LABEL != 'null' && env.LABEL != null }}
54-
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 # v1.1.3
54+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3
5555
with:
5656
github_token: ${{ secrets.ISSUE_AUTOMATION }}
5757
labels: |

.github/workflows/zz_generated.add-to-project-board.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
| jq -r '.content' \
2424
| base64 -d > artifacts/users.yaml
2525
- name: Upload Artifact
26-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
26+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2727
with:
2828
name: users
2929
path: artifacts/users.yaml
@@ -38,7 +38,7 @@ jobs:
3838
| jq -r '.content' \
3939
| base64 -d > artifacts/labels.yaml
4040
- name: Upload Artifact
41-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
41+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4242
with:
4343
name: labels
4444
path: artifacts/labels.yaml
@@ -50,7 +50,7 @@ jobs:
5050
needs: build_user_list
5151
if: github.event.action == 'assigned'
5252
steps:
53-
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
53+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
5454
id: download-users
5555
with:
5656
name: users
@@ -65,7 +65,7 @@ jobs:
6565
echo "BOARD=${BOARD}" >> $GITHUB_ENV
6666
- name: Add issue to personal board
6767
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
68-
uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
68+
uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0
6969
with:
7070
project-url: ${{ env.BOARD }}
7171
github-token: ${{ secrets.ISSUE_AUTOMATION }}
@@ -76,7 +76,7 @@ jobs:
7676
needs: build_user_list
7777
if: github.event.action == 'labeled'
7878
steps:
79-
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
79+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
8080
id: download-labels
8181
with:
8282
name: labels
@@ -91,7 +91,7 @@ jobs:
9191
echo "BOARD=${BOARD}" >> $GITHUB_ENV
9292
- name: Add issue to team board
9393
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
94-
uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
94+
uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0
9595
with:
9696
project-url: ${{ env.BOARD }}
9797
github-token: ${{ secrets.ISSUE_AUTOMATION }}

.github/workflows/zz_generated.create_release.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/0df8c5e633bb1e4fd17c35525a7b382395526f22/pkg/gen/input/workflows/internal/file/create_release.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/c4c2f6f84e7bc84f838669bce868465c16ae53fb/pkg/gen/input/workflows/internal/file/create_release.yaml.template
66
#
77
name: Create Release
88

@@ -22,7 +22,6 @@ jobs:
2222
create-release:
2323
uses: giantswarm/github-workflows/.github/workflows/create-release.yaml@main
2424
with:
25-
build-release-artifacts: false
2625
fetch-deep-gitlog-for-build: true
2726
secrets:
2827
TAYLORBOT_GITHUB_ACTION: ${{ secrets.TAYLORBOT_GITHUB_ACTION }}

.github/workflows/zz_generated.create_release_pr.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/9731fd539b9bb5903efde223d34137756dab107f/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
66
#
77
name: Create Release PR
88
on:
@@ -13,14 +13,29 @@ on:
1313
- 'main#release#major'
1414
- 'main#release#minor'
1515
- 'main#release#patch'
16+
- 'main#release#major-rc'
17+
- 'main#release#minor-rc'
18+
- 'main#release#patch-rc'
19+
- 'main#release#rc'
20+
- 'main#release#rc-release'
1621
- 'master#release#v*.*.*'
1722
- 'master#release#major'
1823
- 'master#release#minor'
1924
- 'master#release#patch'
25+
- 'master#release#major-rc'
26+
- 'master#release#minor-rc'
27+
- 'master#release#patch-rc'
28+
- 'master#release#rc'
29+
- 'master#release#rc-release'
2030
- 'release#v*.*.*'
2131
- 'release#major'
2232
- 'release#minor'
2333
- 'release#patch'
34+
- 'release#major-rc'
35+
- 'release#minor-rc'
36+
- 'release#patch-rc'
37+
- 'release#rc'
38+
- 'release#rc-release'
2439
- 'release-v*.*.x#release#v*.*.*'
2540
# "!" negates previous positive patterns so it has to be at the end.
2641
- '!release-v*.x.x#release#v*.*.*'

.github/workflows/zz_generated.fix_vulnerabilities.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/6ff4d7652142f59436c1d1ef925f8d687e1ac671/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/8d8b9dbd820fc286616891556b0ed5299130ee30/pkg/gen/input/workflows/internal/file/fix_vulnerabilities.yaml.template
66
#
77

88
name: Fix Go vulnerabilities
@@ -14,11 +14,12 @@ on:
1414
inputs:
1515
branch:
1616
description: Branch on which to fix vulnerabilities
17+
default: main
1718
required: true
1819
type: string
1920
log_level:
2021
description: Log Level (info / error / debug)
21-
default: "info"
22+
default: info
2223
type: string
2324

2425
permissions: {}

.github/workflows/zz_generated.gitleaks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/87f30fd3b955a0daf6017834a776c222d93a207c/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
5+
# https://github.com/giantswarm/devctl/blob/3dc3a7c589ba8beeac28039d88572be2aaa07319/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
66
#
77
name: gitleaks
88

99
on:
1010
- pull_request
11+
- merge_group
1112

1213
permissions: {}
1314

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# DO NOT EDIT. Generated with:
2+
#
3+
# devctl
4+
#
5+
# https://github.com/giantswarm/devctl/blob/814a91071850fc945ec1d58f92b761156ad7edb4/pkg/gen/input/workflows/internal/file/semantic_pull_request.yaml.template
6+
#
7+
name: semantic-pull-request
8+
9+
on:
10+
pull_request:
11+
types:
12+
- opened
13+
- edited
14+
- synchronize
15+
16+
permissions: {}
17+
18+
jobs:
19+
semantic-pull-request:
20+
uses: giantswarm/github-workflows/.github/workflows/semantic-pull-request.yaml@main
21+
permissions:
22+
pull-requests: read

.yamllint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
extends: default
3+
rules:
4+
comments:
5+
min-spaces-from-content: 1
6+
document-start: disable
7+
line-length:
8+
max: 200

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/6a704f7e2a8b0f09e82b5bab88f17971af849711/pkg/gen/input/makefile/internal/file/Makefile.template
5+
# https://github.com/giantswarm/devctl/blob/c0a255e412bf450e122f71e563d74a9bd9f9cddf/pkg/gen/input/makefile/internal/file/Makefile.template
66
#
77

88
include Makefile.*.mk
@@ -22,4 +22,4 @@ include Makefile.*.mk
2222

2323
.PHONY: help
2424
help: ## Display this help.
25-
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z%\\\/_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
25+
@awk 'BEGIN {FS = ":.*##"; n = 0; w = 0} /^[a-zA-Z%\\\/_0-9-]+:.*?##/ { order[n] = "t"; targets[n] = $$1; descs[n] = $$2; if (length($$1) > w) w = length($$1); n++ } /^##@/ { order[n] = "c"; cats[n] = substr($$0, 5); n++ } END { printf "\nUsage:\n make \033[36m<target>\033[0m\n"; for (i = 0; i < n; i++) { if (order[i] == "c") printf "\n\033[1m%s\033[0m\n", cats[i]; else printf " \033[36m%-*s\033[0m %s\n", w, targets[i], descs[i] } }' $(MAKEFILE_LIST)

Makefile.gen.go.mk

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22
#
33
# devctl
44
#
5-
# https://github.com/giantswarm/devctl/blob/bf7f386ac6a4e807dde959892df1369fee6d789f/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template
5+
# https://github.com/giantswarm/devctl/blob/0ec3e49745962245bdd6d5c282d4272c40faec37/pkg/gen/input/makefile/internal/file/Makefile.gen.go.mk.template
66
#
77

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

2225
.DEFAULT_GOAL := build
2326

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

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

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

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

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

8184
.PHONY: run
8285
run: ## Runs go run main.go.
8386
@echo "====> $@"
84-
go run -ldflags "$(LDFLAGS)" -race .
87+
go run -ldflags "$(LDFLAGS)" -race "$(MAIN_SOURCE)"
8588

8689
.PHONY: clean
8790
clean: ## Cleans the binary.
@@ -110,12 +113,17 @@ vet: ## Run go vet against code.
110113
.PHONY: nancy
111114
nancy: ## Runs nancy (requires v1.0.37 or newer).
112115
@echo "====> $@"
113-
CGO_ENABLED=0 go list -json -deps ./... | nancy sleuth --skip-update-check --quiet --exclude-vulnerability-file ./.nancy-ignore --additional-exclude-vulnerability-files ./.nancy-ignore.generated
116+
CGO_ENABLED=0 go list -json -m all | nancy sleuth --skip-update-check --quiet --exclude-vulnerability-file ./.nancy-ignore --additional-exclude-vulnerability-files ./.nancy-ignore.generated
117+
118+
# Race detector needs a C toolchain. The architect CI image has none and runs
119+
# with CGO_ENABLED=0, so degrade to cgo-free there; everywhere a compiler exists
120+
# (laptops, coding agents, GitHub Actions, any cgo-capable runner) keeps -race.
121+
RACE := $(shell { [ "$${CGO_ENABLED:-1}" != "0" ] && { command -v gcc || command -v clang; } >/dev/null 2>&1; } && echo -race)
114122

115123
.PHONY: test
116-
test: ## Runs go test with default values.
124+
test: ## Runs go test with default values (race detector when a C toolchain is available).
117125
@echo "====> $@"
118-
go test -ldflags "$(LDFLAGS)" -race ./...
126+
go test -ldflags "$(LDFLAGS)" $(RACE) ./...
119127

120128
.PHONY: build-docker
121129
build-docker: build-linux ## Builds docker image to registry.

0 commit comments

Comments
 (0)