Skip to content

Commit 75f19b5

Browse files
committed
Merge branch 'main' of github.com:coder/coder into bq/feat-3251
2 parents 901c5f2 + 8196221 commit 75f19b5

File tree

262 files changed

+9375
-4741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+9375
-4741
lines changed

.envrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
site/ @coder/frontend
2-
docs/ @ammario
2+
docs/ @coder/docs
3+
README.md @coder/docs
4+
ADOPTERS.md @coder/docs

.github/workflows/coder.yaml

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ jobs:
193193
- name: Install node_modules
194194
run: ./scripts/yarn_install.sh
195195

196-
- name: Install Protoc
197-
uses: arduino/setup-protoc@v1
198-
with:
199-
version: "3.20.0"
200196
- uses: actions/setup-go@v3
201197
with:
202198
go-version: "~1.19"
@@ -229,6 +225,18 @@ jobs:
229225
- name: Install goimports
230226
run: go install golang.org/x/tools/cmd/goimports@latest
231227

228+
- name: Install Protoc
229+
run: |
230+
# protoc must be in lockstep with our dogfood Dockerfile
231+
# or the version in the comments will differ.
232+
set -x
233+
cd dogfood
234+
DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
235+
protoc_path=/usr/local/bin/protoc
236+
docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
237+
chmod +x $protoc_path
238+
protoc --version
239+
232240
- name: make gen
233241
run: "make --output-sync -j -B gen"
234242

@@ -484,41 +492,29 @@ jobs:
484492
restore-keys: |
485493
js-${{ runner.os }}-
486494
495+
- name: Install goimports
496+
run: go install golang.org/x/tools/cmd/goimports@latest
487497
- name: Install nfpm
488498
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
489499

490500
- name: Install zstd
491501
run: sudo apt-get install -y zstd
492502

493-
- name: Build site
494-
run: make -B site/out/index.html
495-
496503
- name: Build Release
497504
run: |
498505
set -euo pipefail
499506
go mod download
500507
501-
mkdir -p ./dist
502-
# build slim binaries
503-
./scripts/build_go_slim.sh \
504-
--output ./dist/ \
505-
--compress 22 \
506-
linux:amd64,armv7,arm64 \
507-
windows:amd64,arm64 \
508-
darwin:amd64,arm64
509-
510-
# build linux amd64 packages
511-
./scripts/build_go_matrix.sh \
512-
--output ./dist/ \
513-
--package-linux \
514-
linux:amd64 \
515-
windows:amd64
508+
version="$(./scripts/version.sh)"
509+
make -j \
510+
build/coder_"$version"_windows_amd64.zip \
511+
build/coder_"$version"_linux_amd64.{tar.gz,deb}
516512
517513
- name: Install Release
518514
run: |
519515
gcloud config set project coder-dogfood
520516
gcloud config set compute/zone us-central1-a
521-
gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
517+
gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb
522518
gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb
523519
gcloud compute ssh coder -- sudo systemctl daemon-reload
524520
@@ -529,12 +525,9 @@ jobs:
529525
with:
530526
name: coder
531527
path: |
532-
./dist/*.zip
533-
./dist/*.exe
534-
./dist/*.tar.gz
535-
./dist/*.apk
536-
./dist/*.deb
537-
./dist/*.rpm
528+
./build/*.zip
529+
./build/*.tar.gz
530+
./build/*.deb
538531
retention-days: 7
539532

540533
test-js:

.github/workflows/release.yaml

Lines changed: 39 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ on:
2121
type: boolean
2222
required: true
2323

24+
permissions:
25+
# Required to publish a release
26+
contents: write
27+
# Necessary to push docker images to ghcr.io.
28+
packages: write
29+
2430
env:
2531
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
2632

@@ -47,12 +53,12 @@ jobs:
4753
uses: docker/login-action@v2
4854
with:
4955
registry: ghcr.io
50-
username: ${{ github.repository_owner }}
56+
username: ${{ github.actor }}
5157
password: ${{ secrets.GITHUB_TOKEN }}
5258

5359
- uses: actions/setup-go@v3
5460
with:
55-
go-version: "~1.18"
61+
go-version: "~1.19"
5662

5763
- name: Cache Node
5864
id: cache-node
@@ -67,50 +73,28 @@ jobs:
6773
6874
- name: Install nfpm
6975
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
70-
7176
- name: Install zstd
7277
run: sudo apt-get install -y zstd
7378

74-
- name: Build Site
75-
run: make site/out/index.html
76-
7779
- name: Build Linux and Windows Binaries
7880
run: |
7981
set -euo pipefail
8082
go mod download
8183
82-
mkdir -p ./dist
83-
# build slim binaries
84-
./scripts/build_go_slim.sh \
85-
--output ./dist/ \
86-
--compress 22 \
87-
linux:amd64,armv7,arm64 \
88-
windows:amd64,arm64 \
89-
darwin:amd64,arm64
90-
91-
# build linux and windows binaries
92-
./scripts/build_go_matrix.sh \
93-
--output ./dist/ \
94-
--archive \
95-
--package-linux \
96-
linux:amd64,armv7,arm64 \
97-
windows:amd64,arm64
84+
version="$(./scripts/version.sh)"
85+
make gen/mark-fresh
86+
make -j \
87+
-W coderd/database/querier.go \
88+
build/coder_"$version"_linux_{amd64,arm64,armv7}.{tar.gz,apk,deb,rpm} \
89+
build/coder_"$version"_windows_{amd64,arm64}.zip \
9890
9991
- name: Build Linux Docker images
10092
run: |
10193
set -euxo pipefail
10294
103-
# build and (maybe) push Docker images for each architecture
104-
images=()
105-
for arch in amd64 armv7 arm64; do
106-
img="$(
107-
./scripts/build_docker.sh \
108-
${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && '--push' || '' }} \
109-
--arch "$arch" \
110-
./dist/coder_*_linux_"$arch"
111-
)"
112-
images+=("$img")
113-
done
95+
# build Docker images for each architecture
96+
version="$(./scripts/version.sh)"
97+
make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
11498
11599
# we can't build multi-arch if the images aren't pushed, so quit now
116100
# if dry-running
@@ -119,31 +103,30 @@ jobs:
119103
exit 0
120104
fi
121105
122-
# build and push multi-arch manifest
123-
./scripts/build_docker_multiarch.sh \
124-
--push \
125-
"${images[@]}"
106+
# build and push multi-arch manifest, this depends on the other images
107+
# being pushed so will automatically push them.
108+
make -j push/build/coder_"$version"_linux.tag
126109
127110
# if the current version is equal to the highest (according to semver)
128111
# version in the repo, also create a multi-arch image as ":latest" and
129112
# push it
130113
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
131114
./scripts/build_docker_multiarch.sh \
132-
--push \
133115
--target "$(./scripts/image_tag.sh --version latest)" \
134-
"${images[@]}"
116+
--push \
117+
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
135118
fi
136119
137120
- name: Upload binary artifacts
138121
uses: actions/upload-artifact@v3
139122
with:
140123
name: linux
141124
path: |
142-
dist/*.zip
143-
dist/*.tar.gz
144-
dist/*.apk
145-
dist/*.deb
146-
dist/*.rpm
125+
./build/*.zip
126+
./build/*.tar.gz
127+
./build/*.apk
128+
./build/*.deb
129+
./build/*.rpm
147130
148131
# The mac binaries get built on mac runners because they need to be signed,
149132
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -165,7 +148,7 @@ jobs:
165148

166149
- uses: actions/setup-go@v3
167150
with:
168-
go-version: "~1.18"
151+
go-version: "~1.19"
169152

170153
- name: Import Signing Certificates
171154
uses: Apple-Actions/import-codesign-certs@v1
@@ -205,30 +188,17 @@ jobs:
205188
# Used for compressing embedded slim binaries
206189
brew install zstd
207190
208-
- name: Build Site
209-
run: make site/out/index.html
210-
211191
- name: Build darwin Binaries (with signatures)
212192
run: |
213193
set -euo pipefail
214194
go mod download
215195
216-
mkdir -p ./dist
217-
# build slim binaries
218-
./scripts/build_go_slim.sh \
219-
--output ./dist/ \
220-
--compress 22 \
221-
linux:amd64,armv7,arm64 \
222-
windows:amd64,arm64 \
223-
darwin:amd64,arm64
224-
225-
# build darwin binaries
226-
./scripts/build_go_matrix.sh \
227-
--output ./dist/ \
228-
--archive \
229-
--sign-darwin \
230-
darwin:amd64,arm64
196+
version="$(./scripts/version.sh)"
197+
make gen/mark-fresh
198+
make -j \
199+
build/coder_"$version"_darwin_{amd64,arm64}.zip
231200
env:
201+
CODER_SIGN_DARWIN: "1"
232202
AC_USERNAME: ${{ secrets.AC_USERNAME }}
233203
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
234204
AC_APPLICATION_IDENTITY: BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -237,7 +207,7 @@ jobs:
237207
uses: actions/upload-artifact@v3
238208
with:
239209
name: darwin
240-
path: ./dist/coder_*.zip
210+
path: ./build/*.zip
241211

242212
publish:
243213
runs-on: ubuntu-latest
@@ -278,8 +248,11 @@ jobs:
278248
- name: Publish Helm
279249
run: |
280250
set -euxo pipefail
281-
./scripts/helm.sh --push
282-
mv ./dist/*.tgz ./artifacts/
251+
252+
version="$(./scripts/version.sh)"
253+
make -j \
254+
build/coder_helm_"$version".tgz
255+
mv ./build/*.tgz ./artifacts/
283256
284257
- name: Publish Release
285258
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ site/**/*.typegen.ts
3030
site/build-storybook.log
3131

3232
# Build
33+
build/
3334
dist/
3435
site/out/
3536

@@ -42,3 +43,4 @@ site/out/
4243
.vscode/*.log
4344
**/*.swp
4445
.coderv2/*
46+
**/__debug_bin

0 commit comments

Comments
 (0)