Skip to content

Commit c8e0286

Browse files
committed
chore: bump version to v0.10.0-rc.2 and use zig cross compilation in the go releaser
Signed-off-by: peefy <[email protected]>
1 parent 7b84d1e commit c8e0286

File tree

6 files changed

+65
-25
lines changed

6 files changed

+65
-25
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
labels: ${{ steps.meta.outputs.labels }}
9797

9898
binary:
99-
runs-on: ubuntu-latest
99+
runs-on: macos-12
100100
steps:
101101
- name: Checkout
102102
uses: actions/checkout@v4
@@ -106,11 +106,18 @@ jobs:
106106
uses: actions/setup-go@v5
107107
with:
108108
go-version-file: go.mod
109+
- uses: korandoru/setup-zig@v1
110+
with:
111+
zig-version: master
112+
- name: Set output
113+
id: macos_sdk
114+
run: echo "path=$(xcrun --show-sdk-path)" >> $GITHUB_OUTPUT
109115
- name: Run GoReleaser
110116
uses: goreleaser/goreleaser-action@v5
111117
with:
112118
distribution: goreleaser
113119
version: latest
114120
args: release --clean
115121
env:
122+
SDK_PATH: ${{ steps.macos_sdk.outputs.path }}
116123
GITHUB_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }}

.goreleaser.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,67 @@ before:
88

99
# .goreleaser.yml
1010
builds:
11-
- id: default
11+
- id: goreleaser-zig-cross-compilation-macos
1212
main: ./cmd/kcl/main.go
1313
binary: kcl
1414
goos:
1515
- darwin
16+
goarch:
17+
- amd64
18+
- arm64
19+
ldflags:
20+
- "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"
21+
env:
22+
- CGO_ENABLED=1
23+
- >-
24+
{{- if eq .Os "darwin" }}
25+
{{- if eq .Arch "amd64"}}CC=zig c++ -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
26+
{{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
27+
{{- end }}
28+
29+
- id: goreleaser-zig-cross-compilation-linux
30+
main: ./cmd/kcl/main.go
31+
binary: kcl
32+
goos:
1633
- linux
17-
- windows
1834
goarch:
1935
- amd64
2036
- arm64
21-
flags:
22-
- -tags=rpc
2337
ldflags:
2438
- "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"
39+
env:
40+
- CGO_ENABLED=1
41+
- >-
42+
{{- if eq .Os "linux" }}
43+
{{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-linux-musl{{- end }}
44+
{{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-linux-musl{{- end }}
45+
{{- end }}
46+
47+
- id: goreleaser-zig-cross-compilation-windows
48+
main: ./cmd/kcl/main.go
49+
binary: kcl
50+
goos:
51+
- windows
52+
goarch:
53+
- amd64
54+
ldflags:
55+
- "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"
56+
env:
57+
- CGO_ENABLED=1
58+
- >-
59+
{{- if eq .Os "windows" }}
60+
{{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-windows-gnu{{- end }}
61+
{{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-windows-gnu{{- end }}
62+
{{- end }}
2563
2664
archives:
27-
- id: default
28-
builds:
29-
- default
65+
- format: tar.gz
66+
# this name template makes the OS and Arch compatible with the results of uname.
3067
name_template: "kcl-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
68+
# use zip for windows archives
3169
format_overrides:
32-
- goos: windows
33-
format: zip
34-
# Put kcl-language-server binaries into add to the kcl archive.
35-
# files:
36-
# - ./bin/kcl-lsp-v{{ .Version }}-{{ .Os }}-{{ .Arch }}/*
70+
- goos: windows
71+
format: zip
3772

3873
brews:
3974
- tap:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.0-rc.1
1+
0.10.0-rc.2

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
module kcl-lang.io/cli
22

3-
go 1.22.4
4-
5-
toolchain go1.22.5
3+
go 1.23
64

75
require (
86
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
97
github.com/onsi/ginkgo/v2 v2.20.2
108
github.com/onsi/gomega v1.34.2
119
github.com/spf13/cobra v1.8.1
1210
github.com/stretchr/testify v1.9.0
13-
kcl-lang.io/kcl-go v0.10.0-rc.1
11+
kcl-lang.io/kcl-go v0.10.0-rc.2
1412
kcl-lang.io/kcl-openapi v0.9.0
1513
kcl-lang.io/kcl-plugin v0.6.0
1614
kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb
@@ -72,7 +70,7 @@ require (
7270
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
7371
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect
7472
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
75-
kcl-lang.io/lib v0.10.0-rc.1 // indirect
73+
kcl-lang.io/lib v0.10.0-rc.2 // indirect
7674
)
7775

7876
require (

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,16 +1692,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
16921692
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
16931693
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
16941694
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
1695-
kcl-lang.io/kcl-go v0.10.0-rc.1 h1:6jH1xSW/WsoXQLy++71prlL8DpkXflx0BKFN5Xyi2sI=
1696-
kcl-lang.io/kcl-go v0.10.0-rc.1/go.mod h1:7qUv6g/II7VmGUMXmwxdma1bR2UgLGNC3VopfDj0tSU=
1695+
kcl-lang.io/kcl-go v0.10.0-rc.2 h1:14gXd+taLB64jQ4E0lMtMGi/Mg2rD3dA62etUGPQVJU=
1696+
kcl-lang.io/kcl-go v0.10.0-rc.2/go.mod h1:IiWdIo5X9eC+EXob39j7jPPytDaMdKhYau62toXNpEs=
16971697
kcl-lang.io/kcl-openapi v0.9.0 h1:HUnc5pUGde83PI5CAe1ZvZhdbcxD9X2ABUp1tV+oYqw=
16981698
kcl-lang.io/kcl-openapi v0.9.0/go.mod h1:kGCf0AZygrZyB+xpmMtiC3FYoiV/1rCLXuAq2QtuLf8=
16991699
kcl-lang.io/kcl-plugin v0.6.0 h1:rBdoqKDPdOtojeOHCFnXoB/I7ltFjV61r0KkfOcL5sE=
17001700
kcl-lang.io/kcl-plugin v0.6.0/go.mod h1:LoIouleHYRKAvFcdW30yUlhsMYH2W9zD5Ji1XHfbht4=
17011701
kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb h1:3GxW+i4paPgzwegnQJDV1GU/e+0uBe1oGFNZVAteGR4=
17021702
kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb/go.mod h1:zYz5oAEvg+cFjA12djw1Z6bErLd69L5dcYLkCOpcz68=
1703-
kcl-lang.io/lib v0.10.0-rc.1 h1:HRHMW2ane3mjKMVBUQQVvln9Z7FDkUJVXRWEVXPtP+w=
1704-
kcl-lang.io/lib v0.10.0-rc.1/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs=
1703+
kcl-lang.io/lib v0.10.0-rc.2 h1:zMiwQVKzKqLD0gRPuKdDgX0MzbcWe8a+IlsXhhWeUvk=
1704+
kcl-lang.io/lib v0.10.0-rc.2/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs=
17051705
oras.land/oras-go v1.2.6 h1:z8cmxQXBU8yZ4mkytWqXfo6tZcamPwjsuxYU81xJ8Lk=
17061706
oras.land/oras-go v1.2.6/go.mod h1:OVPc1PegSEe/K8YiLfosrlqlqTN9PUyFvOw5Y9gwrT8=
17071707
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=

pkg/version/version.go

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

3434
const (
35-
VersionTypeLatest = Version_0_10_0_rc1
35+
VersionTypeLatest = Version_0_10_0_rc2
3636

37-
Version_0_10_0_rc1 VersionType = "0.10.0-rc.1"
37+
Version_0_10_0_rc2 VersionType = "0.10.0-rc.2"
3838

3939
Version_0_9_8 VersionType = "0.9.8"
4040
Version_0_9_7 VersionType = "0.9.7"

0 commit comments

Comments
 (0)