Skip to content

Commit 3ce4cde

Browse files
authored
Merge pull request #284 from kcl-lang/chore-bump-kcl-0.12.2-with-musl
chore: bump kcl 0.12.2 with musl
2 parents 260ccb8 + 46aec71 commit 3ce4cde

File tree

9 files changed

+112
-14
lines changed

9 files changed

+112
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- main
1111

1212
jobs:
13-
Test:
13+
test:
1414
name: Unit tests with coverage
1515
runs-on: ubuntu-latest
1616
steps:
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
path-to-profile: coverage.out
4343

44-
build_image:
44+
build-image:
4545
name: build image
4646
runs-on: ubuntu-latest
4747
steps:

.github/workflows/example-e2e-tests.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,30 @@ jobs:
6969
scoop install kcl-lang/kcl
7070
kcl.exe .\examples\kubernetes.k
7171
.\examples\test.ps1
72+
73+
musl:
74+
runs-on: ubuntu-latest
75+
container: golang:1.24-alpine
76+
steps:
77+
- name: Git checkout
78+
uses: actions/checkout@v6
79+
80+
- name: Install musl dependencies (Alpine container)
81+
run: |
82+
apk add --no-cache \
83+
musl-dev \
84+
gcc \
85+
git \
86+
make \
87+
linux-headers
88+
89+
- name: KCL Installation
90+
run: |
91+
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
92+
mkdir -p $HOME/go/bin
93+
cp -f ./kcl $HOME/go/bin
94+
env:
95+
CGO_LDFLAGS: '-static'
96+
97+
- name: e2e tests
98+
run: PATH=$PATH:$HOME/go/bin kcl ./examples/kubernetes.k

.github/workflows/release.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,67 @@ jobs:
8080
args: release --clean
8181
env:
8282
GITHUB_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
83+
84+
musl-binary:
85+
needs: binary
86+
runs-on: ubuntu-latest
87+
container: golang:1.24-alpine
88+
steps:
89+
- name: Git checkout
90+
uses: actions/checkout@v6
91+
92+
- name: Install musl dependencies (Alpine container)
93+
run: |
94+
apk add --no-cache \
95+
musl-dev \
96+
gcc \
97+
git \
98+
make \
99+
linux-headers \
100+
tar
101+
102+
- name: Compile KCL (musl static build)
103+
run: |
104+
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
105+
env:
106+
CGO_LDFLAGS: '-static'
107+
108+
- name: Package musl binary with docs
109+
run: |
110+
TAG_NAME=${{ github.ref_name }}
111+
mkdir -p kcl-musl-package
112+
cp -f ./kcl ./kcl-musl-package/
113+
cp -f ./README.md ./kcl-musl-package/
114+
cp -f ./LICENSE ./kcl-musl-package/
115+
tar -czf kcl-${TAG_NAME}-linux-musl-amd64.tar.gz -C kcl-musl-package .
116+
ls -lh kcl-${TAG_NAME}-linux-musl-amd64.tar.gz
117+
echo "PACKAGE_NAME=kcl-${TAG_NAME}-linux-musl-amd64.tar.gz" >> $GITHUB_ENV
118+
119+
- name: Upload musl package to Artifact
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: kcl-musl-package
123+
path: ./${{ env.PACKAGE_NAME }}
124+
retention-days: 7
125+
126+
upload-musl-to-release:
127+
needs: [binary, musl-binary]
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Download musl package from Artifact
131+
uses: actions/download-artifact@v4
132+
with:
133+
name: kcl-musl-package
134+
path: ./
135+
136+
- name: Install GitHub CLI
137+
run: |
138+
sudo apt update && sudo apt install -y gh
139+
140+
- name: Upload to GitHub Release
141+
run: |
142+
echo "${{ secrets.DEPLOY_ACCESS_TOKEN }}" | gh auth login --with-token
143+
PACKAGE_NAME=$(ls ./kcl-*.tar.gz)
144+
gh release upload "${{ github.ref_name }}" "${PACKAGE_NAME}" --clobber
145+
env:
146+
GITHUB_API_URL: https://api.github.com

README-zh.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ export PATH=$KCL_INSTALLATION_PATH:$PATH
8080
### 从源代码构建
8181

8282
```shell
83-
git clone https://github.com/kcl-lang/cli
84-
cd cli && go build ./cmd/kcl/main.go -o kcl
83+
git clone https://github.com/kcl-lang/cli && cd cli
84+
# On Windows, MacOS and Linux
85+
go build ./cmd/kcl/
86+
# Build on Linux Musl
87+
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
8588
```
8689

8790
请使用以下命令以确保您成功安装了 `kcl`

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ docker run -it kcllang/kcl-arm64
9393
### Build from Source Code
9494

9595
```shell
96-
git clone https://github.com/kcl-lang/cli
97-
cd cli && go build ./cmd/kcl/main.go -o kcl
96+
git clone https://github.com/kcl-lang/cli && cd cli
97+
# On Windows, MacOS and Linux
98+
go build ./cmd/kcl/
99+
# Build on Linux Musl
100+
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
98101
```
99102

100103
Use the following command to ensure that you install `kcl` successfully.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.1
1+
0.12.2

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/onsi/gomega v1.38.2
99
github.com/spf13/cobra v1.10.1
1010
github.com/stretchr/testify v1.11.1
11-
kcl-lang.io/kcl-go v0.12.1
11+
kcl-lang.io/kcl-go v0.12.2-rc.2
1212
kcl-lang.io/kcl-openapi v0.10.0
1313
kcl-lang.io/kcl-plugin v0.11.0
1414
kcl-lang.io/kpm v0.12.1
@@ -95,7 +95,7 @@ require (
9595
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
9696
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
9797
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
98-
kcl-lang.io/lib v0.12.1 // indirect
98+
kcl-lang.io/lib v0.12.2-rc.1 // indirect
9999
)
100100

101101
require (

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,16 +1407,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
14071407
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
14081408
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
14091409
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
1410-
kcl-lang.io/kcl-go v0.12.1 h1:yJsh7zxZj1sxfQ8GiGw0ROydzHDpHFsLjMK9R+cpsfM=
1411-
kcl-lang.io/kcl-go v0.12.1/go.mod h1:S9nodh+GW4Lu1IMomUTZhgN3sIoyotxOK3YsHf1+isI=
1410+
kcl-lang.io/kcl-go v0.12.2-rc.2 h1:b91SZsVTiSv6Nge7WtvJSIAmR/J6Bkjsn3PH3SWt6i4=
1411+
kcl-lang.io/kcl-go v0.12.2-rc.2/go.mod h1:XonsxHac93yVt5iZYrfVVQvCvzfYDDpPapsOuA9KS18=
14121412
kcl-lang.io/kcl-openapi v0.10.0 h1:yetZMSnn/HHaMcfiLt1P2zhCF06O33jxkjtHrm08VR8=
14131413
kcl-lang.io/kcl-openapi v0.10.0/go.mod h1:kGCf0AZygrZyB+xpmMtiC3FYoiV/1rCLXuAq2QtuLf8=
14141414
kcl-lang.io/kcl-plugin v0.11.0 h1:Get9hvYhQDS180GOqhdhKwxRcZGKUGvPkQkqEOfcwtk=
14151415
kcl-lang.io/kcl-plugin v0.11.0/go.mod h1:0H6hJEYMyPUm0zJQP0bgTuNrqktwgA21EcUvQTiZIb4=
14161416
kcl-lang.io/kpm v0.12.1 h1:2KWm7w6U5kius7y7LO0ntGYrSDpEwHhCMI6Z/DeVMx4=
14171417
kcl-lang.io/kpm v0.12.1/go.mod h1:UqA172uQzxJeDDuaVZ9VchmNzN8s6syPOngz7hRHE4A=
1418-
kcl-lang.io/lib v0.12.1 h1:wxEI4Hkgg6nFJHNHfNdqvPg5Zf7UMWUL7zBVsnudo/8=
1419-
kcl-lang.io/lib v0.12.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=
1418+
kcl-lang.io/lib v0.12.2-rc.1 h1:Y14N24knnzgPHsOFiFFonuAPjs+6BqkA0nwoSwmz69o=
1419+
kcl-lang.io/lib v0.12.2-rc.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=
14201420
oras.land/oras-go v1.2.6 h1:z8cmxQXBU8yZ4mkytWqXfo6tZcamPwjsuxYU81xJ8Lk=
14211421
oras.land/oras-go v1.2.6/go.mod h1:OVPc1PegSEe/K8YiLfosrlqlqTN9PUyFvOw5Y9gwrT8=
14221422
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=

pkg/version/version.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ func getVersion(version string) string {
3232
}
3333

3434
const (
35-
VersionTypeLatest = Version_0_12_1
35+
VersionTypeLatest = Version_0_12_2
3636

37+
Version_0_12_2 VersionType = "0.12.2"
3738
Version_0_12_1 VersionType = "0.12.1"
3839
Version_0_12_0 VersionType = "0.12.0"
3940
Version_0_11_2 VersionType = "0.11.2"

0 commit comments

Comments
 (0)