Skip to content

Commit 9adaad5

Browse files
committed
生成多平台编译配置
1 parent 57ab2d8 commit 9adaad5

6 files changed

Lines changed: 198 additions & 0 deletions

File tree

.slsa-goreleaser/darwin-amd64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "darwin"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "amd64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

.slsa-goreleaser/darwin-arm64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "darwin"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "arm64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

.slsa-goreleaser/linux-amd64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "linux"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "amd64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

.slsa-goreleaser/linux-arm64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "linux"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "arm64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

.slsa-goreleaser/windows-amd64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "windows"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "amd64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

.slsa-goreleaser/windows-arm64.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Version for this file.
2+
version: 1
3+
4+
# (Optional) List of env variables used during compilation.
5+
env:
6+
- GO111MODULE=on
7+
- CGO_ENABLED=0
8+
9+
# (Optional) Flags for the compiler.
10+
flags:
11+
- -trimpath
12+
- -tags=netgo
13+
14+
# The OS to compile for. `GOOS` env variable will be set to this value.
15+
goos: "windows"
16+
17+
# The architecture to compile for. `GOARCH` env variable will be set to this value.
18+
goarch: "arm64"
19+
20+
# (Optional) Entrypoint to compile.
21+
main: ./cmd/lcode-hub
22+
23+
# (Optional) Working directory. (default: root of the project)
24+
# dir: ./relative/path/to/dir
25+
26+
# Binary output name.
27+
# {{ .Os }} will be replaced by goos field in the config file.
28+
# {{ .Arch }} will be replaced by goarch field in the config file.
29+
binary: lcode-hub-{{ .Os }}-{{ .Arch }}
30+
31+
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
32+
ldflags:
33+
- "-X main.Version={{ .Env.VERSION }}"

0 commit comments

Comments
 (0)