@@ -65,52 +65,54 @@ jobs:
6565 restore-keys : |
6666 js-${{ runner.os }}-
6767
68+ - name : Install protoc-gen-go
69+ run :
go install google.golang.org/protobuf/cmd/[email protected] 70+ - name : Install protoc-gen-go-drpc
71+ run :
go install storj.io/drpc/cmd/[email protected] 72+ - name : Install goimports
73+ run : go install golang.org/x/tools/cmd/goimports@latest
74+
75+ - name : Install Protoc
76+ run : |
77+ # protoc must be in lockstep with our dogfood Dockerfile
78+ # or the version in the comments will differ.
79+ set -x
80+ cd dogfood
81+ DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
82+ protoc_path=/usr/local/bin/protoc
83+ docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
84+ chmod +x $protoc_path
85+ protoc --version
86+
6887 - name : Install nfpm
6988 run :
go install github.com/goreleaser/nfpm/v2/cmd/[email protected] 7089
7190 - name : Install zstd
7291 run : sudo apt-get install -y zstd
7392
74- - name : Build Site
75- run : make site/out/index.html
76-
7793 - name : Build Linux and Windows Binaries
7894 run : |
7995 set -euo pipefail
8096 go mod download
8197
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
98+ version="$(./scripts/version.sh)"
99+ make -j \
100+ -W coderd/database/querier.go \
101+ build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
102+ build/coder_"$version"_windows_{amd64,arm64}.zip \
98103
99104 - name : Build Linux Docker images
100105 run : |
101106 set -euxo pipefail
102107
103108 # 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
109+ version="$(./scripts/version.sh)"
110+ push=""
111+ if [[ "$CODER_RELEASE" == *t* ]]; then
112+ push="push/"
113+ fi
114+ make -j \
115+ "$push"build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
114116
115117 # we can't build multi-arch if the images aren't pushed, so quit now
116118 # if dry-running
@@ -120,14 +122,13 @@ jobs:
120122 fi
121123
122124 # build and push multi-arch manifest
123- ./scripts/build_docker_multiarch.sh \
124- --push \
125- "${images[@]}"
125+ make -j push/build/coder_"$version"_linux.tag
126126
127127 # if the current version is equal to the highest (according to semver)
128128 # version in the repo, also create a multi-arch image as ":latest" and
129129 # push it
130130 if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
131+ make -j push/build/coder_"$version"_linux.tag
131132 ./scripts/build_docker_multiarch.sh \
132133 --push \
133134 --target "$(./scripts/image_tag.sh --version latest)" \
@@ -139,11 +140,11 @@ jobs:
139140 with :
140141 name : linux
141142 path : |
142- dist /*.zip
143- dist /*.tar.gz
144- dist /*.apk
145- dist /*.deb
146- dist /*.rpm
143+ ./build /*.zip
144+ ./build /*.tar.gz
145+ ./build /*.apk
146+ ./build /*.deb
147+ ./build /*.rpm
147148
148149 # The mac binaries get built on mac runners because they need to be signed,
149150 # and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -184,6 +185,18 @@ jobs:
184185 restore-keys : |
185186 js-${{ runner.os }}-
186187
188+ - name : Install protoc-gen-go
189+ run :
go install google.golang.org/protobuf/cmd/[email protected] 190+ - name : Install protoc-gen-go-drpc
191+ run :
go install storj.io/drpc/cmd/[email protected] 192+ - name : Install goimports
193+ run : go install golang.org/x/tools/cmd/goimports@latest
194+
195+ - name : Install Protoc
196+ uses : arduino/setup-protoc@v1
197+ with :
198+ version : ' 3.x'
199+
187200 - name : Install dependencies
188201 run : |
189202 set -euo pipefail
@@ -213,22 +226,11 @@ jobs:
213226 set -euo pipefail
214227 go mod download
215228
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
229+ version="$(./scripts/version.sh)"
230+ make -j \
231+ build/coder_"$version"_darwin_{amd64,arm64}.zip
231232 env :
233+ CODER_SIGN_DARWIN : " 1"
232234 AC_USERNAME : ${{ secrets.AC_USERNAME }}
233235 AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
234236 AC_APPLICATION_IDENTITY : BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -237,7 +239,7 @@ jobs:
237239 uses : actions/upload-artifact@v3
238240 with :
239241 name : darwin
240- path : ./dist/coder_ *.zip
242+ path : ./build/ *.zip
241243
242244 publish :
243245 runs-on : ubuntu-latest
@@ -278,8 +280,11 @@ jobs:
278280 - name : Publish Helm
279281 run : |
280282 set -euxo pipefail
281- ./scripts/helm.sh --push
282- mv ./dist/*.tgz ./artifacts/
283+
284+ version="$(./scripts/version.sh)"
285+ make -j \
286+ build/coder_helm_"$version".tgz
287+ mv ./build/*.tgz ./artifacts/
283288
284289 - name : Publish Release
285290 run : |
0 commit comments