Skip to content

Commit 34f6812

Browse files
Merge pull request #2133 from rksharma95/systemd-release-ci
chore(CI): cross compile system monitor for systemd release
2 parents b9566a2 + ec9f99b commit 34f6812

File tree

6 files changed

+34
-9
lines changed

6 files changed

+34
-9
lines changed

.github/workflows/ci-systemd-release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ permissions: read-all
1616

1717
jobs:
1818
goreleaser:
19-
runs-on: ubuntu-22.04
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
include:
23+
- arch: amd64
24+
os: ubuntu-22.04
25+
- arch: arm64
26+
os: ubuntu-22.04-arm
2027
if: github.repository == 'kubearmor/kubearmor'
2128
permissions:
2229
id-token: write # requires for cosign keyless signing
@@ -97,6 +104,17 @@ jobs:
97104
git checkout "${RELEASE_TAG}"
98105
fi
99106
107+
- name: Install yq
108+
run: |
109+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${{ matrix.arch }} -O /usr/local/bin/yq &&\
110+
chmod +x /usr/local/bin/yq
111+
yq --version
112+
113+
- name: Patch goarch
114+
working-directory: KubeArmor
115+
run: |
116+
yq -i '.builds[0].goarch = ["${{ matrix.arch }}"]' /tmp/.goreleaser.yaml
117+
100118
- name: Run GoReleaser
101119
uses: goreleaser/goreleaser-action@v5
102120
with:
@@ -107,6 +125,7 @@ jobs:
107125
env:
108126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109127
GORELEASER_CURRENT_TAG: ${{ steps.vars.outputs.GORELEASER_CURRENT_TAG }}
128+
ARCH: ${{ matrix.arch }}
110129

111130
- name: Setup ORAS
112131
uses: oras-project/setup-oras@v1
@@ -116,5 +135,4 @@ jobs:
116135
- name: Publish release artifacts to Dockerhub
117136
working-directory: KubeArmor/dist
118137
run: |
119-
oras push docker.io/kubearmor/kubearmor-systemd:${{ steps.vars.outputs.tag }}_linux-amd64 kubearmor_${{ steps.vars.outputs.tag }}_linux-amd64.tar.gz
120-
oras push docker.io/kubearmor/kubearmor-systemd:${{ steps.vars.outputs.tag }}_linux-arm64 kubearmor_${{ steps.vars.outputs.tag }}_linux-arm64.tar.gz
138+
oras push docker.io/kubearmor/kubearmor-systemd:${{ steps.vars.outputs.tag }}_linux-${{ matrix.arch }} kubearmor_${{ steps.vars.outputs.tag }}_linux-${{ matrix.arch }}.tar.gz

.github/workflows/ci-test-ginkgo.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ jobs:
249249
if: ${{ always() }}
250250
run: |
251251
ls -l
252-
go tool cover -func coverage_k8s_${{ matrix.os }}_${{ matrix.runtime }}.out
252+
if [ -f coverage_k8s_${{ matrix.os }}_${{ matrix.runtime }}.out ]; then
253+
go tool cover -func coverage_k8s_${{ matrix.os }}_${{ matrix.runtime }}.out
254+
else
255+
echo "Coverage file not found, skipping coverage report."
256+
fi
253257
working-directory: KubeArmor
254258
env:
255259
GOPATH: /home/runner/go

KubeArmor/.goreleaser.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ builds:
77
- linux
88
goarch:
99
- amd64
10-
- arm64
1110
env:
1211
- CGO_ENABLED=0
1312
ldflags:
@@ -21,6 +20,10 @@ release:
2120
mode: replace
2221
make_latest: false
2322

23+
# to handle checksum name conflict
24+
checksum:
25+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Env.ARCH }}_checksums.txt"
26+
2427
signs:
2528
- cmd: cosign
2629
certificate: '${artifact}.cert'

KubeArmor/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ ifeq (, $(shell which goreleaser))
126126
endif
127127
cd $(CURDIR)/BPF; make clean
128128
cd $(CURDIR)/BPF; make
129-
cd $(CURDIR); VERSION=$(shell git describe --tags --always --dirty) goreleaser release --clean --skip=publish,sign,validate --snapshot
129+
cd $(CURDIR);ARCH=$(shell go env GOARCH) VERSION=$(shell git describe --tags --always --dirty) goreleaser release --clean --skip=publish,sign,validate --snapshot
130130

131131
.PHONY: scan
132132
scan:

contribution/self-managed-k8s/crio/install_crio.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ OS="x${NAME}_${VERSION_ID}"
1515
VERSION=$(curl -w '%{url_effective}' -L -s -S https://update.k3s.io/v1-release/channels/stable -o /dev/null | sed -e 's|.*/||' | cut -d '.' -f1,2)
1616
echo "Installing CRI-O version $VERSION"
1717

18-
curl -fsSL https://pkgs.k8s.io/addons:/cri-o://stable:/$VERSION/deb/Release.key |
18+
curl -fsSL https://download.opensuse.org/repositories/isv:/cri-o:/stable:/$VERSION/deb/Release.key |
1919
sudo gpg --dearmor -o /etc/apt/keyrings/cri-o-apt-keyring.gpg
2020

21-
echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://pkgs.k8s.io/addons:/cri-o:/stable:/$VERSION/deb/ /" |
21+
echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://download.opensuse.org/repositories/isv:/cri-o:/stable:/$VERSION/deb/ /" |
2222
sudo tee /etc/apt/sources.list.d/cri-o.list
2323

2424
# install

tests/k8s_env/blockposture/block_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var _ = Describe("Posture", func() {
6969
Expect(err).To(BeNil())
7070

7171
// wait for policy creation, added due to flaky behaviour
72-
time.Sleep(5 * time.Second)
72+
time.Sleep(10 * time.Second)
7373

7474
// Start Kubearmor Logs
7575
err = KarmorLogStart("policy", "wordpress-mysql", "File", wp)

0 commit comments

Comments
 (0)