Skip to content

Commit 97e2fa3

Browse files
committed
Added release workflow
1 parent 6a62270 commit 97e2fa3

File tree

8 files changed

+113
-8
lines changed

8 files changed

+113
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131
- name: Setup Go
32-
uses: actions/setup-go@v3
32+
uses: actions/setup-go@v4
3333
with:
3434
go-version: '1.20'
3535
check-latest: true

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: release
16+
on:
17+
push:
18+
tags:
19+
- "v*"
20+
21+
jobs:
22+
goreleaser:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Unshallow
28+
run: git fetch --prune --unshallow
29+
- name: Set up Go
30+
uses: actions/setup-go@v4
31+
with:
32+
go-version: '1.20'
33+
check-latest: true
34+
- name: GHCR Login
35+
uses: docker/login-action@v1
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Run GoReleaser
41+
uses: goreleaser/goreleaser-action@v5
42+
with:
43+
version: latest
44+
args: release --clean
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
before:
16+
hooks:
17+
- go mod tidy
18+
builds:
19+
- id: kube-startup-cpu-boost
20+
main: ./cmd
21+
binary: manager
22+
env:
23+
- CGO_ENABLED=0
24+
mod_timestamp: "{{ .CommitTimestamp }}"
25+
flags:
26+
- -trimpath
27+
ldflags:
28+
- "-s -w"
29+
goos:
30+
- linux
31+
goarch:
32+
- amd64
33+
hooks:
34+
pre:
35+
- cmd: make manifests generate
36+
post:
37+
- cmd: make release IMG=ghcr.io/google/{{ .ProjectName }}:{{ .Tag }} MANIFESTS=manifests.yaml
38+
dockers:
39+
- goos: linux
40+
goarch: amd64
41+
dockerfile: goreleaser.dockerfile
42+
image_templates:
43+
- "ghcr.io/google/{{ .ProjectName }}:latest"
44+
- "ghcr.io/google/{{ .ProjectName }}:{{ .Tag }}"
45+
- "ghcr.io/google/{{ .ProjectName }}:{{ .ShortCommit }}"
46+
archives:
47+
- format: zip
48+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
49+
builds:
50+
- kube-startup-cpu-boost
51+
files:
52+
- LICENSE*
53+
- README*
54+
checksum:
55+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
56+
algorithm: sha256
57+
release:
58+
# If you want to manually examine the release before its live, uncomment this line:
59+
# draft: true
60+
extra_files:
61+
- glob: ./manifests.yaml
62+
changelog:
63+
skip: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
151151

152152
## Tool Versions
153153
KUSTOMIZE_VERSION ?= v5.0.0
154-
CONTROLLER_TOOLS_VERSION ?= v0.11.3
154+
CONTROLLER_TOOLS_VERSION ?= v0.13.0
155155

156156
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
157157
.PHONY: kustomize

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/autoscaling.x-k8s.io_startupcpuboosts.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
87
name: startupcpuboosts.autoscaling.x-k8s.io
98
spec:
109
group: autoscaling.x-k8s.io

config/rbac/role.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
creationTimestamp: null
65
name: manager-role
76
rules:
87
- apiGroups:

config/webhook/manifests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
apiVersion: admissionregistration.k8s.io/v1
33
kind: MutatingWebhookConfiguration
44
metadata:
5-
creationTimestamp: null
65
name: mutating-webhook-configuration
76
webhooks:
87
- admissionReviewVersions:

0 commit comments

Comments
 (0)