@@ -18,24 +18,16 @@ jobs:
18
18
uses : actions/setup-go@v5
19
19
with :
20
20
go-version : ' 1.22.5'
21
- - name : Install Cosign
22
- uses : sigstore/cosign-installer@v3
23
- with :
24
- cosign-release : ' v2.2.4'
25
- - name : Store Cosign private key in a file
26
- run : ' echo "$COSIGN_KEY" > /tmp/cosign.key'
27
- shell : bash
28
- env :
29
- COSIGN_KEY : ${{secrets.COSIGN_KEY}}
30
21
- name : Set up QEMU
31
22
uses : docker/setup-qemu-action@v3
32
23
- name : Set up Docker Buildx
33
24
uses : docker/setup-buildx-action@v3
34
- - name : Login to DockerHub
25
+ - name : Login to GitHub Container Registry
35
26
uses : docker/login-action@v3
36
27
with :
37
- username : ${{secrets.DOCKER_USERNAME}}
38
- password : ${{secrets.DOCKER_PASSWORD}}
28
+ registry : ghcr.io
29
+ username : ${{ github.repository_owner }}
30
+ password : ${{ secrets.GITHUB_TOKEN }}
39
31
- name : Generate SBOM
40
32
uses : CycloneDX/gh-gomod-generate-sbom@v2
41
33
with :
@@ -45,33 +37,18 @@ jobs:
45
37
uses : docker/metadata-action@v5
46
38
id : meta
47
39
with :
48
- images : securego /gosec
40
+ images : ghcr.io/${{ github.repository_owner }} /gosec
49
41
flavor : |
50
42
latest=true
51
43
tags : |
52
44
type=sha,format=long
53
45
type=semver,pattern={{version}}
54
- - name : Release Binaries
55
- uses : goreleaser/goreleaser-action@v6
56
- with :
57
- version : latest
58
- args : release --clean
59
- env :
60
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
61
- COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
62
46
- name : Release Docker Image
63
47
uses : docker/build-push-action@v6
64
48
id : relimage
65
49
with :
66
50
platforms : linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le
67
- tags : ${{steps.meta.outputs.tags}}
68
- labels : ${{steps.meta.outputs.labels}}
51
+ tags : ${{ steps.meta.outputs.tags }}
52
+ labels : ${{ steps.meta.outputs.labels }}
69
53
push : true
70
54
build-args : GO_VERSION=1.22
71
- - name : Sign Docker Image
72
- run : cosign sign --yes --key /tmp/cosign.key ${DIGEST}
73
- env :
74
- TAGS : ${{steps.meta.outputs.tags}}
75
- COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
76
- COSIGN_PRIVATE_KEY : /tmp/cosign.key
77
- DIGEST : ${{steps.relimage.outputs.digest}}
0 commit comments