File tree Expand file tree Collapse file tree 3 files changed +62
-5
lines changed Expand file tree Collapse file tree 3 files changed +62
-5
lines changed Original file line number Diff line number Diff line change 12
12
jobs :
13
13
release :
14
14
runs-on : ubuntu-latest
15
+
16
+ permissions :
17
+ contents : read
18
+ packages : write
19
+ id-token : write
20
+
15
21
steps :
22
+
16
23
- name : Check out code into the Go module directory
17
24
uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
18
25
with :
@@ -23,18 +30,46 @@ jobs:
23
30
with :
24
31
go-version-file : go.mod
25
32
check-latest : true
33
+
34
+ - name : Install cosign
35
+ uses : sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
36
+
37
+ - name : Install crane
38
+ uses : uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3
39
+
26
40
- name : Login to dockerhub to push the image
27
41
run : echo "${{ secrets.DockerHubToken }}" | docker login --username ${DOCKER_USER} --password-stdin
28
42
env :
29
43
DOCKER_USER : ${{ secrets.DockerHubUser }}
44
+
45
+ - name : Login to DockerHub
46
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
47
+ with :
48
+ username : ${{ secrets.DockerHubUser }}
49
+ password : ${{ secrets.DockerHubToken }}
50
+
51
+ - name : Login to GitHub Docker Registry
52
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
53
+ with :
54
+ registry : ghcr.io
55
+ username : ${{ github.repository_owner }}
56
+ password : ${{ secrets.GITHUB_TOKEN }}
57
+
30
58
- name : Publish Docker Image
31
59
env :
32
60
VERSION : ${{ github.event.inputs.tag }}
33
61
run : make ci publish
62
+
63
+ - name : Sign Image and copy to ghcr.io
64
+ env :
65
+ VERSION : ${{ github.event.inputs.tag }}
66
+ run : make sign copy-ghcr
67
+
34
68
- name : run make bump-version
35
69
run : make bump-version
36
70
env :
37
71
NEW_VERSION : ${{ github.event.inputs.tag }}
72
+
38
73
- name : commit manifests
39
74
uses : EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 # v9.1.3
40
75
with :
Original file line number Diff line number Diff line change 29
29
30
30
release-dev-image :
31
31
runs-on : ubuntu-latest
32
+
33
+ permissions :
34
+ contents : read
35
+ packages : write
36
+ id-token : write
37
+
32
38
needs : test
33
39
if : github.ref == 'refs/heads/master'
34
40
steps :
@@ -43,10 +49,19 @@ jobs:
43
49
go-version-file : go.mod
44
50
check-latest : true
45
51
46
- - name : Login to dockerhub to push the image
47
- run : echo "${{ secrets.DockerHubToken }}" | docker login --username ${DOCKER_USER} --password-stdin
48
- env :
49
- DOCKER_USER : ${{ secrets.DockerHubUser }}
52
+ - name : Login to DockerHub
53
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
54
+ with :
55
+ username : ${{ secrets.DockerHubUser }}
56
+ password : ${{ secrets.DockerHubToken }}
57
+
58
+ - name : Login to GitHub Docker Registry
59
+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
60
+ with :
61
+ registry : ghcr.io
62
+ username : ${{ github.repository_owner }}
63
+ password : ${{ secrets.GITHUB_TOKEN }}
64
+
50
65
- name : build and push new CCM dev image
51
66
run : |
52
- VERSION=dev make publish
67
+ VERSION=dev make publish sign copy-ghcr
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ COMMIT ?= $(shell git rev-parse HEAD)
23
23
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
24
24
VERSION ?= $(shell cat VERSION)
25
25
REGISTRY ?= digitalocean
26
+ REGISTRY_GHCR ?= ghcr.io/digitalocean
26
27
GO_VERSION ?= $(shell go mod edit -print | grep -E '^go [[:digit:].]* ' | cut -d' ' -f2)
27
28
28
29
LDFLAGS ?= -X github.com/digitalocean/digitalocean-cloud-controller-manager/cloud-controller-manager/do.version=$(VERSION ) -X github.com/digitalocean/digitalocean-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.gitVersion=$(VERSION ) -X github.com/digitalocean/digitalocean-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.gitCommit=$(COMMIT ) -X github.com/digitalocean/digitalocean-cloud-controller-manager/vendor/k8s.io/kubernetes/pkg/version.gitTreeState=$(GIT_TREE_STATE )
89
90
@echo "==> Your image is now available at $(REGISTRY)/digitalocean-cloud-controller-manager:$(VERSION)"
90
91
endif
91
92
93
+ sign :
94
+ @cosign sign --yes $(REGISTRY ) /digitalocean-cloud-controller-manager@$(shell crane digest $(REGISTRY ) /digitalocean-cloud-controller-manager:$(VERSION ) )
95
+
96
+ copy-ghcr :
97
+ @cosign copy $(REGISTRY ) /digitalocean-cloud-controller-manager:$(VERSION ) $(REGISTRY_GHCR ) /digitalocean-cloud-controller-manager:$(VERSION )
98
+
92
99
.PHONY : govet
93
100
govet :
94
101
@go vet $(shell go list ./... | grep -v vendor)
You can’t perform that action at this time.
0 commit comments