Skip to content

Commit 56e6893

Browse files
authored
Merge pull request #44 from StacklokLabs/sign-image
Sign the mkp image with cosign
2 parents 01045ff + 7090b23 commit 56e6893

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
permissions:
1313
contents: read
1414
packages: write
15+
id-token: write
1516
steps:
1617
- name: Checkout code
1718
uses: actions/checkout@v4
@@ -67,4 +68,20 @@ jobs:
6768
--platform=linux/amd64,linux/arm64 \
6869
--base-import-paths \
6970
--tags $VERSION,latest \
70-
./cmd/server
71+
./cmd/server
72+
73+
- name: Install Cosign
74+
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
75+
76+
- name: Sign Image with Cosign
77+
env:
78+
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/mkp
79+
run: |
80+
TAG=$(echo "${{ steps.tag.outputs.VERSION }}" | sed 's/+/_/g')
81+
# Sign the ko image
82+
cosign sign -y $KO_DOCKER_REPO:$TAG
83+
84+
# Sign the latest tag if building from a tag
85+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
86+
cosign sign -y $KO_DOCKER_REPO:latest
87+
fi

Taskfile.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ tasks:
4949
- go fmt ./...
5050
- golangci-lint run --fix
5151

52-
lint:
53-
desc: Lint the code
54-
cmds:
55-
- golangci-lint run
56-
5752
deps:
5853
desc: Update dependencies
5954
cmds:

0 commit comments

Comments
 (0)