Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb87096b

Browse files
authored
chore: split release workflow so the majority happens on Linux (#2092)
1 parentb4645b2 commitb87096b

File tree

7 files changed

+381
-120
lines changed

7 files changed

+381
-120
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
before:
2+
hooks:
3+
-go mod tidy
4+
-rm -f site/out/bin/coder*
5+
6+
archives:
7+
-id:coder-darwin
8+
builds:[coder-darwin]
9+
format:zip
10+
11+
builds:
12+
-id:coder-slim
13+
dir:cmd/coder
14+
ldflags:["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
15+
env:[CGO_ENABLED=0]
16+
goos:[darwin, linux, windows]
17+
goarch:[amd64, arm, arm64]
18+
goarm:["7"]
19+
# Only build arm 7 for Linux
20+
ignore:
21+
-goos:windows
22+
goarm:"7"
23+
-goos:darwin
24+
goarm:"7"
25+
hooks:
26+
# The "trimprefix" appends ".exe" on Windows.
27+
post:|
28+
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ trimprefix .Name "coder" }}
29+
30+
-id:coder-darwin
31+
dir:cmd/coder
32+
flags:[-tags=embed]
33+
ldflags:["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
34+
env:[CGO_ENABLED=0]
35+
goos:[darwin]
36+
goarch:[amd64, arm64]
37+
hooks:
38+
# This signs the binary that will be located inside the zip. MacOS
39+
# requires the binary to be signed for notarization.
40+
post:|
41+
sh -c 'codesign -s {{.Env.AC_APPLICATION_IDENTITY}} -f -v --timestamp --options runtime {{.Path}}'
42+
43+
env:
44+
# Apple identity for signing!
45+
-AC_APPLICATION_IDENTITY=BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
46+
47+
signs:
48+
-ids:[coder-darwin]
49+
artifacts:archive
50+
cmd:./scripts/sign_macos.sh
51+
args:["${artifact}"]
52+
output:true
53+
54+
release:
55+
ids:[coder-darwin]
56+
57+
snapshot:
58+
name_template:"{{ .Version }}-devel+{{ .ShortCommit }}"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
before:
2+
hooks:
3+
-go mod tidy
4+
-rm -f site/out/bin/coder*
5+
6+
archives:
7+
-id:coder-linux
8+
builds:[coder-linux]
9+
format:tar.gz
10+
11+
-id:coder-windows
12+
builds:[coder-windows]
13+
format:zip
14+
15+
builds:
16+
-id:coder-slim
17+
dir:cmd/coder
18+
ldflags:["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
19+
env:[CGO_ENABLED=0]
20+
goos:[darwin, linux, windows]
21+
goarch:[amd64, arm, arm64]
22+
goarm:["7"]
23+
# Only build arm 7 for Linux
24+
ignore:
25+
-goos:windows
26+
goarm:"7"
27+
-goos:darwin
28+
goarm:"7"
29+
hooks:
30+
# The "trimprefix" appends ".exe" on Windows.
31+
post:|
32+
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ trimprefix .Name "coder" }}
33+
34+
-id:coder-linux
35+
dir:cmd/coder
36+
flags:[-tags=embed]
37+
ldflags:["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
38+
env:[CGO_ENABLED=0]
39+
goos:[linux]
40+
goarch:[amd64, arm, arm64]
41+
goarm:["7"]
42+
43+
-id:coder-windows
44+
dir:cmd/coder
45+
flags:[-tags=embed]
46+
ldflags:["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
47+
env:[CGO_ENABLED=0]
48+
goos:[windows]
49+
goarch:[amd64, arm64]
50+
51+
release:
52+
ids:[coder-windows, coder-linux]
53+
54+
snapshot:
55+
name_template:"{{ .Version }}-devel+{{ .ShortCommit }}"

‎.github/.goreleaser-release.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# This goreleaser config file requires GoReleaser Pro as it uses the prebuilt
2+
# builder type.
3+
4+
archives:
5+
-id:coder-linux
6+
builds:[release-prebuilt-linux]
7+
format:tar.gz
8+
9+
builds:
10+
-id:release-prebuilt-linux
11+
builder:prebuilt
12+
goos:[linux]
13+
goarch:[amd64, arm, arm64]
14+
goarm:["7"]
15+
prebuilt:
16+
path:artifacts/coder-linux_{{.Os}}_{{.Arch}}{{ with .Arm }}_{{ . }}{{ end }}/coder
17+
18+
# This section is also contained in .goreleaser.yaml.
19+
nfpms:
20+
-id:packages
21+
vendor:Coder
22+
homepage:https://coder.com
23+
maintainer:Coder <support@coder.com>
24+
description:|
25+
Provision development environments with infrastructure with code
26+
formats:
27+
-apk
28+
-deb
29+
-rpm
30+
suggests:
31+
-postgresql
32+
builds:
33+
-release-prebuilt-linux
34+
bindir:/usr/bin
35+
contents:
36+
-src:coder.env
37+
dst:/etc/coder.d/coder.env
38+
type:"config|noreplace"
39+
-src:coder.service
40+
dst:/usr/lib/systemd/system/coder.service
41+
42+
# Image templates are empty on snapshots to avoid lengthy builds for
43+
# development.
44+
dockers:
45+
-image_templates:["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-amd64{{ end }}"]
46+
id:release-prebuilt-linux
47+
dockerfile:Dockerfile
48+
use:buildx
49+
build_flag_templates:
50+
---platform=linux/amd64
51+
---label=org.opencontainers.image.title=Coder
52+
---label=org.opencontainers.image.description=A tool for provisioning self-hosted development environments with Terraform.
53+
---label=org.opencontainers.image.url=https://github.com/coder/coder
54+
---label=org.opencontainers.image.source=https://github.com/coder/coder
55+
---label=org.opencontainers.image.version={{ .Version }}
56+
---label=org.opencontainers.image.revision={{ .FullCommit }}
57+
---label=org.opencontainers.image.licenses=AGPL-3.0
58+
-image_templates:["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-arm64{{ end }}"]
59+
goarch:arm64
60+
dockerfile:Dockerfile
61+
use:buildx
62+
build_flag_templates:
63+
---platform=linux/arm64/v8
64+
---label=org.opencontainers.image.title=coder
65+
---label=org.opencontainers.image.description=A tool for provisioning self-hosted development environments with Terraform.
66+
---label=org.opencontainers.image.url=https://github.com/coder/coder
67+
---label=org.opencontainers.image.source=https://github.com/coder/coder
68+
---label=org.opencontainers.image.version={{ .Tag }}
69+
---label=org.opencontainers.image.revision={{ .FullCommit }}
70+
---label=org.opencontainers.image.licenses=AGPL-3.0
71+
-image_templates:["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-armv7{{ end }}"]
72+
goarch:arm
73+
goarm:"7"
74+
dockerfile:Dockerfile
75+
use:buildx
76+
build_flag_templates:
77+
---platform=linux/arm/v7
78+
---label=org.opencontainers.image.title=Coder
79+
---label=org.opencontainers.image.description=A tool for provisioning self-hosted development environments with Terraform.
80+
---label=org.opencontainers.image.url=https://github.com/coder/coder
81+
---label=org.opencontainers.image.source=https://github.com/coder/coder
82+
---label=org.opencontainers.image.version={{ .Tag }}
83+
---label=org.opencontainers.image.revision={{ .FullCommit }}
84+
---label=org.opencontainers.image.licenses=AGPL-3.0
85+
86+
docker_manifests:
87+
-name_template:ghcr.io/coder/coder:{{ .Tag }}
88+
image_templates:
89+
-ghcr.io/coder/coder:{{ .Tag }}-amd64
90+
-ghcr.io/coder/coder:{{ .Tag }}-arm64
91+
-ghcr.io/coder/coder:{{ .Tag }}-armv7
92+
93+
release:
94+
ids:[release-prebuilt-linux, packages]
95+
footer:|
96+
## Container Image
97+
- `docker pull ghcr.io/coder/coder:{{ .Tag }}`
98+
# All non-Linux files should just be used as is. We have to import the Linux
99+
# builds so that the docker images get built and package creation works.
100+
extra_files:
101+
-glob:./artifacts/coder_*_darwin_*.zip
102+
-glob:./artifacts/coder_*_windows_*.zip
103+
104+
snapshot:
105+
name_template:"{{ .Version }}-devel+{{ .ShortCommit }}"

‎.github/workflows/coder.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
token:${{ secrets.CODECOV_TOKEN }}
227227
files:./gotests.coverage
228228
flags:unittest-go-${{ matrix.os }}
229-
# this flakes and sometimes fails the build
229+
# this flakes and sometimes fails the build
230230
fail_ci_if_error:false
231231

232232
test-go-postgres:
@@ -310,7 +310,7 @@ jobs:
310310
token:${{ secrets.CODECOV_TOKEN }}
311311
files:./gotests.coverage
312312
flags:unittest-go-postgres-${{ matrix.os }}
313-
# this flakes and sometimes fails the build
313+
# this flakes and sometimes fails the build
314314
fail_ci_if_error:false
315315

316316
deploy:
@@ -437,7 +437,7 @@ jobs:
437437
token:${{ secrets.CODECOV_TOKEN }}
438438
files:./site/coverage/lcov.info
439439
flags:unittest-js
440-
# this flakes and sometimes fails the build
440+
# this flakes and sometimes fails the build
441441
fail_ci_if_error:false
442442

443443
-name:Upload DataDog Trace

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp