From 2273201b06cb851157dee7188f1b7c1e9a9cf1a3 Mon Sep 17 00:00:00 2001 From: peefy Date: Tue, 17 Sep 2024 00:33:08 +0800 Subject: [PATCH] Revert "chore: bump version to v0.10.0-rc.2 and use zig cross compilation in the go releaser" This reverts commit c8e028639674cce886dad38908e59b60f9ad2b1a. --- .github/workflows/release.yaml | 9 +----- .goreleaser.yml | 59 +++++++--------------------------- VERSION | 2 +- go.mod | 8 +++-- go.sum | 8 ++--- pkg/version/version.go | 4 +-- 6 files changed, 25 insertions(+), 65 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 331e06f..1c45621 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -96,7 +96,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} binary: - runs-on: macos-12 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -106,12 +106,6 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.mod - - uses: korandoru/setup-zig@v1 - with: - zig-version: master - - name: Set output - id: macos_sdk - run: echo "path=$(xcrun --show-sdk-path)" >> $GITHUB_OUTPUT - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: @@ -119,5 +113,4 @@ jobs: version: latest args: release --clean env: - SDK_PATH: ${{ steps.macos_sdk.outputs.path }} GITHUB_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index a897e00..efc5f83 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,67 +8,32 @@ before: # .goreleaser.yml builds: - - id: goreleaser-zig-cross-compilation-macos + - id: default main: ./cmd/kcl/main.go binary: kcl goos: - darwin - goarch: - - amd64 - - arm64 - ldflags: - - "-X kcl-lang.io/cli/pkg/version.version={{.Version}}" - env: - - CGO_ENABLED=1 - - >- - {{- if eq .Os "darwin" }} - {{- if eq .Arch "amd64"}}CC=zig c++ -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }} - {{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }} - {{- end }} - - - id: goreleaser-zig-cross-compilation-linux - main: ./cmd/kcl/main.go - binary: kcl - goos: - linux + - windows goarch: - amd64 - arm64 + flags: + - -tags=rpc ldflags: - "-X kcl-lang.io/cli/pkg/version.version={{.Version}}" - env: - - CGO_ENABLED=1 - - >- - {{- if eq .Os "linux" }} - {{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-linux-musl{{- end }} - {{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-linux-musl{{- end }} - {{- end }} - - - id: goreleaser-zig-cross-compilation-windows - main: ./cmd/kcl/main.go - binary: kcl - goos: - - windows - goarch: - - amd64 - ldflags: - - "-X kcl-lang.io/cli/pkg/version.version={{.Version}}" - env: - - CGO_ENABLED=1 - - >- - {{- if eq .Os "windows" }} - {{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-windows-gnu{{- end }} - {{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-windows-gnu{{- end }} - {{- end }} archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of uname. + - id: default + builds: + - default name_template: "kcl-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" - # use zip for windows archives format_overrides: - - goos: windows - format: zip + - goos: windows + format: zip + # Put kcl-language-server binaries into add to the kcl archive. + # files: + # - ./bin/kcl-lsp-v{{ .Version }}-{{ .Os }}-{{ .Arch }}/* brews: - tap: diff --git a/VERSION b/VERSION index bb8f1d1..d8667cf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.0-rc.2 \ No newline at end of file +0.10.0-rc.1 \ No newline at end of file diff --git a/go.mod b/go.mod index 42a2b82..31d3298 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module kcl-lang.io/cli -go 1.23 +go 1.22.4 + +toolchain go1.22.5 require ( github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d @@ -8,7 +10,7 @@ require ( github.com/onsi/gomega v1.34.2 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - kcl-lang.io/kcl-go v0.10.0-rc.2 + kcl-lang.io/kcl-go v0.10.0-rc.1 kcl-lang.io/kcl-openapi v0.9.0 kcl-lang.io/kcl-plugin v0.6.0 kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb @@ -70,7 +72,7 @@ require ( google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - kcl-lang.io/lib v0.10.0-rc.2 // indirect + kcl-lang.io/lib v0.10.0-rc.1 // indirect ) require ( diff --git a/go.sum b/go.sum index 44f2a47..781f352 100644 --- a/go.sum +++ b/go.sum @@ -1692,16 +1692,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.10.0-rc.2 h1:14gXd+taLB64jQ4E0lMtMGi/Mg2rD3dA62etUGPQVJU= -kcl-lang.io/kcl-go v0.10.0-rc.2/go.mod h1:IiWdIo5X9eC+EXob39j7jPPytDaMdKhYau62toXNpEs= +kcl-lang.io/kcl-go v0.10.0-rc.1 h1:6jH1xSW/WsoXQLy++71prlL8DpkXflx0BKFN5Xyi2sI= +kcl-lang.io/kcl-go v0.10.0-rc.1/go.mod h1:7qUv6g/II7VmGUMXmwxdma1bR2UgLGNC3VopfDj0tSU= kcl-lang.io/kcl-openapi v0.9.0 h1:HUnc5pUGde83PI5CAe1ZvZhdbcxD9X2ABUp1tV+oYqw= kcl-lang.io/kcl-openapi v0.9.0/go.mod h1:kGCf0AZygrZyB+xpmMtiC3FYoiV/1rCLXuAq2QtuLf8= kcl-lang.io/kcl-plugin v0.6.0 h1:rBdoqKDPdOtojeOHCFnXoB/I7ltFjV61r0KkfOcL5sE= kcl-lang.io/kcl-plugin v0.6.0/go.mod h1:LoIouleHYRKAvFcdW30yUlhsMYH2W9zD5Ji1XHfbht4= kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb h1:3GxW+i4paPgzwegnQJDV1GU/e+0uBe1oGFNZVAteGR4= kcl-lang.io/kpm v0.10.0-rc.1.0.20240913073358-31d2c0f714fb/go.mod h1:zYz5oAEvg+cFjA12djw1Z6bErLd69L5dcYLkCOpcz68= -kcl-lang.io/lib v0.10.0-rc.2 h1:zMiwQVKzKqLD0gRPuKdDgX0MzbcWe8a+IlsXhhWeUvk= -kcl-lang.io/lib v0.10.0-rc.2/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs= +kcl-lang.io/lib v0.10.0-rc.1 h1:HRHMW2ane3mjKMVBUQQVvln9Z7FDkUJVXRWEVXPtP+w= +kcl-lang.io/lib v0.10.0-rc.1/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs= 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= diff --git a/pkg/version/version.go b/pkg/version/version.go index 343c464..842737e 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -32,9 +32,9 @@ func getVersion(version string) string { } const ( - VersionTypeLatest = Version_0_10_0_rc2 + VersionTypeLatest = Version_0_10_0_rc1 - Version_0_10_0_rc2 VersionType = "0.10.0-rc.2" + Version_0_10_0_rc1 VersionType = "0.10.0-rc.1" Version_0_9_8 VersionType = "0.9.8" Version_0_9_7 VersionType = "0.9.7"