Skip to content

Commit 58c26f4

Browse files
committed
cicd: don't checkout source on clairctl builds
The presence of a `.git` directory messes with the new go toolchain vcs tooling, and we don't actually want a source checkout, anyway. Signed-off-by: Hank Donnay <[email protected]>
1 parent 9d58dba commit 58c26f4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/cut-release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,22 @@ jobs:
125125
GOOS: ${{matrix.goos}}
126126
GOARCH: ${{matrix.goarch}}
127127
steps:
128-
- name: Checkout
129-
uses: actions/checkout@v3
130128
- name: Fetch Artifacts
131129
uses: actions/download-artifact@v3
132130
id: download
133131
with:
134132
name: release
135-
- uses: ./.github/actions/go-cache
136-
with:
137-
go: ${{ needs.config.outputs.build_go_version }}
138-
- name: Unpack and Build
133+
- name: Unpack
139134
run: |
140135
tar -xz -f ${{steps.download.outputs.download-path}}/clair-${{ needs.config.outputs.version }}.tar.gz --strip-components=1
136+
- uses: actions/setup-go@v4
137+
with:
138+
go-version: ${{ needs.config.outputs.build_go_version }}
139+
- name: Build
140+
# Build with path trimming, ELF debug stripping, and no VCS injection (should be done by the `git archive` process).
141+
run: |
141142
go build\
142-
-trimpath -ldflags="-s -w"\
143+
-trimpath -ldflags="-s -w" -buildvcs=false\
143144
-o "clairctl-${{matrix.goos}}-${{matrix.goarch}}"\
144145
./cmd/clairctl
145146
- name: Upload

0 commit comments

Comments
 (0)