diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 6a32d6babc1aa..2e2714ec7a1ff 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -353,10 +353,6 @@ jobs: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ runner.os }}-release-go-mod-${{ hashFiles('**/go.sum') }} - - uses: goreleaser/goreleaser-action@v3 - with: - install-only: true - - name: Cache Node id: cache-node uses: actions/cache@v3 @@ -364,10 +360,14 @@ jobs: path: | **/node_modules .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} + key: js-${{ runner.os }}-release-node-${{ hashFiles('**/yarn.lock') }} restore-keys: | js-${{ runner.os }}- + - uses: goreleaser/goreleaser-action@v3 + with: + install-only: true + - name: Build site run: make -B site/out/index.html @@ -377,18 +377,6 @@ jobs: version: latest args: release --snapshot --rm-dist --skip-sign - - uses: actions/upload-artifact@v3 - with: - name: coder_windows_amd64.zip - path: ./dist/coder_*_windows_amd64.zip - retention-days: 7 - - - uses: actions/upload-artifact@v3 - with: - name: coder_linux_amd64.tar.gz - path: ./dist/coder_*_linux_amd64.tar.gz - retention-days: 7 - - name: Install Release run: | gcloud config set project coder-dogfood @@ -400,6 +388,14 @@ jobs: - name: Start run: gcloud compute ssh coder -- sudo service coder restart + - uses: actions/upload-artifact@v3 + with: + name: coder + path: | + ./dist/coder_*_linux_amd64.tar.gz + ./dist/coder_*_windows_amd64.zip + retention-days: 7 + test-js: name: "test/js" runs-on: ubuntu-latest diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d02c23906a4bd..7bcedf5087db5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -94,8 +94,9 @@ nfpms: - src: coder.service dst: /usr/lib/systemd/system/coder.service +# Image templates are empty on snapshots to avoid lengthy builds for development. dockers: - - image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-amd64"] + - image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-amd64{{ end }}"] id: coder-linux dockerfile: Dockerfile use: buildx @@ -108,7 +109,7 @@ dockers: - --label=org.opencontainers.image.version={{ .Version }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=AGPL-3.0 - - image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-arm64"] + - image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-arm64{{ end }}"] goarch: arm64 dockerfile: Dockerfile use: buildx @@ -121,7 +122,7 @@ dockers: - --label=org.opencontainers.image.version={{ .Tag }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=AGPL-3.0 - - image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-armv7"] + - image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-armv7{{ end }}"] goarch: arm goarm: "7" dockerfile: Dockerfile diff --git a/site/webpack.common.ts b/site/webpack.common.ts index aaf494b0e3efb..e595a1d2cc8e7 100644 --- a/site/webpack.common.ts +++ b/site/webpack.common.ts @@ -38,7 +38,7 @@ const dashboardHTMLPluginConfig = new HtmlWebpackPlugin({ template: path.join(templatePath, "index.html"), }) -export const commonWebpackConfig: Configuration = { +export const createCommonWebpackConfig = (options?: { skipTypecheck: boolean }): Configuration => ({ // entry defines each "page" or "chunk". In v1, we have two "pages": // dashboard and terminal. This is desired because the terminal has the xterm // vendor, and it is undesireable to load all of xterm on a dashboard @@ -78,6 +78,7 @@ export const commonWebpackConfig: Configuration = { loader: "ts-loader", options: { configFile: "tsconfig.prod.json", + transpileOnly: options?.skipTypecheck, }, }, ], @@ -106,4 +107,4 @@ export const commonWebpackConfig: Configuration = { // plugins customize the build process plugins: [environmentPlugin, dashboardHTMLPluginConfig], -} +}) diff --git a/site/webpack.dev.ts b/site/webpack.dev.ts index 8a981e2330444..c51658e8e670d 100644 --- a/site/webpack.dev.ts +++ b/site/webpack.dev.ts @@ -5,14 +5,16 @@ import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin" import { Configuration } from "webpack" import "webpack-dev-server" -import { commonWebpackConfig } from "./webpack.common" +import { createCommonWebpackConfig } from "./webpack.common" + +const commonWebpackConfig = createCommonWebpackConfig() const commonPlugins = commonWebpackConfig.plugins || [] const commonRules = commonWebpackConfig.module?.rules || [] const config: Configuration = { - ...commonWebpackConfig, + ...createCommonWebpackConfig, // devtool controls how source maps are generated. In development, we want // more details (less optimized) for more readability and an easier time diff --git a/site/webpack.prod.ts b/site/webpack.prod.ts index 354f680384790..8b4a4e88dc43b 100644 --- a/site/webpack.prod.ts +++ b/site/webpack.prod.ts @@ -6,7 +6,13 @@ import CopyWebpackPlugin from "copy-webpack-plugin" import CSSMinimizerPlugin from "css-minimizer-webpack-plugin" import MiniCSSExtractPlugin from "mini-css-extract-plugin" import { Configuration } from "webpack" -import { commonWebpackConfig } from "./webpack.common" +import { createCommonWebpackConfig } from "./webpack.common" + +const commonWebpackConfig = createCommonWebpackConfig({ + // This decreases compilation time when publishing releases. + // The "test/js" step will already catch any TypeScript compilation errors. + skipTypecheck: true, +}) const commonPlugins = commonWebpackConfig.plugins || []