Skip to content

Commit 2d552c0

Browse files
authored
Merge pull request #96 from lubronzhan/topic/lubron/fix-95
Add VERSION variable to publish and release job
2 parents 3b3a4a4 + c00645a commit 2d552c0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Docker Buildx
1616
uses: docker/setup-buildx-action@v3
1717
- name: Login to DockerHub
18-
uses: docker/login-action@v3
18+
uses: docker/login-action@v3
1919
with:
2020
username: kubevip
2121
password: ${{ secrets.DOCKERHUB_KUBEVIP_TOKEN }}
@@ -37,5 +37,7 @@ jobs:
3737
kubevip/kube-vip-cloud-provider:latest,
3838
ghcr.io/kube-vip/kube-vip-cloud-provider:${{ github.ref_name }},
3939
ghcr.io/kube-vip/kube-vip-cloud-provider:latest
40+
build-args: |
41+
VERSION=${{ github.ref_name }}
4042
- name: Image digest
4143
run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/root/.local/share/golang \
1111

1212
ARG VERSION
1313

14-
ENV LD_FLAGS="-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=$VERSION -s"
14+
ENV LD_FLAGS="-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=$VERSION"
1515
RUN --mount=type=cache,target=/root/.cache/go-build \
1616
--mount=type=cache,target=/go/pkg/mod \
1717
--mount=type=cache,target=/root/.local/share/golang \

0 commit comments

Comments
 (0)