Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- main

jobs:
Test:
test:
name: Unit tests with coverage
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
with:
path-to-profile: coverage.out

build_image:
build-image:
name: build image
runs-on: ubuntu-latest
steps:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/example-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,30 @@ jobs:
scoop install kcl-lang/kcl
kcl.exe .\examples\kubernetes.k
.\examples\test.ps1

musl:
runs-on: ubuntu-latest
container: golang:1.24-alpine
steps:
- name: Git checkout
uses: actions/checkout@v6

- name: Install musl dependencies (Alpine container)
run: |
apk add --no-cache \
musl-dev \
gcc \
git \
make \
linux-headers

- name: KCL Installation
run: |
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
mkdir -p $HOME/go/bin
cp -f ./kcl $HOME/go/bin
env:
CGO_LDFLAGS: '-static'

- name: e2e tests
run: PATH=$PATH:$HOME/go/bin kcl ./examples/kubernetes.k
64 changes: 64 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,67 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }}

musl-binary:
needs: binary
runs-on: ubuntu-latest
container: golang:1.24-alpine
steps:
- name: Git checkout
uses: actions/checkout@v6

- name: Install musl dependencies (Alpine container)
run: |
apk add --no-cache \
musl-dev \
gcc \
git \
make \
linux-headers \
tar

- name: Compile KCL (musl static build)
run: |
CGO_ENABLED=1 go build -tags="musl netgo static osusergo" -ldflags="-linkmode external -extldflags '-static'" ./cmd/kcl
env:
CGO_LDFLAGS: '-static'

- name: Package musl binary with docs
run: |
TAG_NAME=${{ github.ref_name }}
mkdir -p kcl-musl-package
cp -f ./kcl ./kcl-musl-package/
cp -f ./README.md ./kcl-musl-package/
cp -f ./LICENSE ./kcl-musl-package/
tar -czf kcl-${TAG_NAME}-linux-musl-amd64.tar.gz -C kcl-musl-package .
ls -lh kcl-${TAG_NAME}-linux-musl-amd64.tar.gz
echo "PACKAGE_NAME=kcl-${TAG_NAME}-linux-musl-amd64.tar.gz" >> $GITHUB_ENV

- name: Upload musl package to Artifact
uses: actions/upload-artifact@v4
with:
name: kcl-musl-package
path: ./${{ env.PACKAGE_NAME }}
retention-days: 7

upload-musl-to-release:
needs: [binary, musl-binary]
runs-on: ubuntu-latest
steps:
- name: Download musl package from Artifact
uses: actions/download-artifact@v4
with:
name: kcl-musl-package
path: ./

- name: Install GitHub CLI
run: |
sudo apt update && sudo apt install -y gh

- name: Upload to GitHub Release
run: |
echo "${{ secrets.DEPLOY_ACCESS_TOKEN }}" | gh auth login --with-token
PACKAGE_NAME=$(ls ./kcl-*.tar.gz)
gh release upload "${{ github.ref_name }}" "${PACKAGE_NAME}" --clobber
env:
GITHUB_API_URL: https://api.github.com
7 changes: 5 additions & 2 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ export PATH=$KCL_INSTALLATION_PATH:$PATH
### 从源代码构建

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

请使用以下命令以确保您成功安装了 `kcl`。
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ docker run -it kcllang/kcl-arm64
### Build from Source Code

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

Use the following command to ensure that you install `kcl` successfully.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.12.2
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/onsi/gomega v1.38.2
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
kcl-lang.io/kcl-go v0.12.1
kcl-lang.io/kcl-go v0.12.2-rc.2
kcl-lang.io/kcl-openapi v0.10.0
kcl-lang.io/kcl-plugin v0.11.0
kcl-lang.io/kpm v0.12.1
Expand Down Expand Up @@ -95,7 +95,7 @@ require (
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
kcl-lang.io/lib v0.12.1 // indirect
kcl-lang.io/lib v0.12.2-rc.1 // indirect
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1407,16 +1407,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kcl-lang.io/kcl-go v0.12.1 h1:yJsh7zxZj1sxfQ8GiGw0ROydzHDpHFsLjMK9R+cpsfM=
kcl-lang.io/kcl-go v0.12.1/go.mod h1:S9nodh+GW4Lu1IMomUTZhgN3sIoyotxOK3YsHf1+isI=
kcl-lang.io/kcl-go v0.12.2-rc.2 h1:b91SZsVTiSv6Nge7WtvJSIAmR/J6Bkjsn3PH3SWt6i4=
kcl-lang.io/kcl-go v0.12.2-rc.2/go.mod h1:XonsxHac93yVt5iZYrfVVQvCvzfYDDpPapsOuA9KS18=
kcl-lang.io/kcl-openapi v0.10.0 h1:yetZMSnn/HHaMcfiLt1P2zhCF06O33jxkjtHrm08VR8=
kcl-lang.io/kcl-openapi v0.10.0/go.mod h1:kGCf0AZygrZyB+xpmMtiC3FYoiV/1rCLXuAq2QtuLf8=
kcl-lang.io/kcl-plugin v0.11.0 h1:Get9hvYhQDS180GOqhdhKwxRcZGKUGvPkQkqEOfcwtk=
kcl-lang.io/kcl-plugin v0.11.0/go.mod h1:0H6hJEYMyPUm0zJQP0bgTuNrqktwgA21EcUvQTiZIb4=
kcl-lang.io/kpm v0.12.1 h1:2KWm7w6U5kius7y7LO0ntGYrSDpEwHhCMI6Z/DeVMx4=
kcl-lang.io/kpm v0.12.1/go.mod h1:UqA172uQzxJeDDuaVZ9VchmNzN8s6syPOngz7hRHE4A=
kcl-lang.io/lib v0.12.1 h1:wxEI4Hkgg6nFJHNHfNdqvPg5Zf7UMWUL7zBVsnudo/8=
kcl-lang.io/lib v0.12.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=
kcl-lang.io/lib v0.12.2-rc.1 h1:Y14N24knnzgPHsOFiFFonuAPjs+6BqkA0nwoSwmz69o=
kcl-lang.io/lib v0.12.2-rc.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=
oras.land/oras-go v1.2.6 h1:z8cmxQXBU8yZ4mkytWqXfo6tZcamPwjsuxYU81xJ8Lk=
oras.land/oras-go v1.2.6/go.mod h1:OVPc1PegSEe/K8YiLfosrlqlqTN9PUyFvOw5Y9gwrT8=
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=
Expand Down
3 changes: 2 additions & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ func getVersion(version string) string {
}

const (
VersionTypeLatest = Version_0_12_1
VersionTypeLatest = Version_0_12_2

Version_0_12_2 VersionType = "0.12.2"
Version_0_12_1 VersionType = "0.12.1"
Version_0_12_0 VersionType = "0.12.0"
Version_0_11_2 VersionType = "0.11.2"
Expand Down
Loading