Skip to content

Commit 4d5b7b2

Browse files
committed
ci: add docker image release
Signed-off-by: peefy <xpf6677@163.com>
1 parent b053b87 commit 4d5b7b2

File tree

4 files changed

+49
-41
lines changed

4 files changed

+49
-41
lines changed

.github/workflows/cla.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Reference from:
2+
# https://goreleaser.com/ci/actions/
3+
name: Release
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
permissions:
9+
contents: write
10+
jobs:
11+
image-amd64:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: 1.22
22+
23+
- name: Setup Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
with:
26+
version: v0.11.2
27+
install: true
28+
29+
# <--- Login, build and push image to Docker Hub --->
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ secrets.DOCKER_USERNAME }}
34+
password: ${{ secrets.DOCKER_PASSWORD }}
35+
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: kcllang/kustomize-kcl
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
platforms: linux/amd64
46+
push: ${{ github.event_name != 'pull_request' }}
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ FROM kcllang/kcl
1414
WORKDIR /app
1515
COPY --from=builder /app/kustomize-kcl .
1616

17-
ENV KCL_GO_DISABLE_ARTIFACT=on
18-
1917
CMD ["/app/kustomize-kcl"]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.2.1
1+
0.9.0

0 commit comments

Comments
 (0)