Skip to content

Commit b4ff192

Browse files
authored
chore: bump kcl lib 0.12.2 with musl (#505)
* chore: bump kcl lib 0.12.2 with musl Signed-off-by: Peefy <xpf6677@163.com> * ci: add macos-latest Signed-off-by: Peefy <xpf6677@163.com> --------- Signed-off-by: Peefy <xpf6677@163.com>
1 parent 279eeb2 commit b4ff192

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

.github/workflows/main_darwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# Note: The arch of macos-13-xlarge and macos-14 is arm64
1212
strategy:
1313
matrix:
14-
os: [ macos-13, macos-13-xlarge, macos-14 ]
14+
os: [ macos-13, macos-13-xlarge, macos-14, macos-latest ]
1515
cgo: [ '1', '0' ]
1616
runs-on: ${{ matrix.os }}
1717
steps:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build-and-test-linux-musl
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- "releases/*"
8+
jobs:
9+
build-and-test:
10+
# Ref: https://github.com/actions/runner-images/tree/main/images/macos
11+
strategy:
12+
matrix:
13+
include:
14+
# Alpine Linux container configurations
15+
- os: alpine-latest
16+
runner: ubuntu-latest # Host runner for the container
17+
container: golang:1.24-alpine
18+
cgo_enabled: 1
19+
20+
runs-on: ${{ matrix.runner }}
21+
container: ${{ matrix.container }}
22+
steps:
23+
- name: Git checkout
24+
uses: actions/checkout@v6
25+
26+
- name: Install musl dependencies (Alpine container)
27+
run: |
28+
apk add --no-cache \
29+
musl-dev \
30+
gcc \
31+
git \
32+
make
33+
34+
- name: Setup build tags for Alpine
35+
run: |
36+
echo "GO_BUILD_TAGS=musl netgo static osusergo" >> $GITHUB_ENV
37+
echo "GO_LDFLAGS=-linkmode external -extldflags '-static'" >> $GITHUB_ENV
38+
39+
- name: Go code test
40+
run: |
41+
BUILD_TAGS="$GO_BUILD_TAGS"
42+
EXTRA_LDFLAGS="$GO_LDFLAGS"
43+
44+
CGO_ENABLED=${{ matrix.cgo_enabled }} \
45+
go test ./... -v \
46+
-tags="${BUILD_TAGS}" \
47+
-ldflags="${EXTRA_LDFLAGS}"
48+
env:
49+
CGO_LDFLAGS: ${{ matrix.cgo_enabled == '1' && '-static' || '' }}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
google.golang.org/grpc v1.77.0
2323
google.golang.org/protobuf v1.36.10
2424
gopkg.in/yaml.v3 v3.0.1
25-
kcl-lang.io/lib v0.12.1
25+
kcl-lang.io/lib v0.12.2-rc.1
2626
)
2727

2828
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
119119
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
120120
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
121121
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
122-
kcl-lang.io/lib v0.12.1 h1:wxEI4Hkgg6nFJHNHfNdqvPg5Zf7UMWUL7zBVsnudo/8=
123-
kcl-lang.io/lib v0.12.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=
122+
kcl-lang.io/lib v0.12.2-rc.1 h1:Y14N24knnzgPHsOFiFFonuAPjs+6BqkA0nwoSwmz69o=
123+
kcl-lang.io/lib v0.12.2-rc.1/go.mod h1:kK/P1DUXQD+HpdRuPMb4/f7U7Njr2q5VrihmDHjKtnw=

0 commit comments

Comments
 (0)