Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 50 additions & 42 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- "src/**"
- "test/**"
npm:
- "package-lock.json"
- "test/package-lock.json"
- "pnpm-lock.yaml"
- "test/pnpm-lock.yaml"
vscode:
- "lib/**"
- "patches/**"
Expand All @@ -58,15 +58,16 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npx prettier --check .
pnpm-lock.yaml
test/pnpm-lock.yaml
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- run: pnpm exec prettier --check .

doctoc:
name: Doctoc markdown files
Expand All @@ -75,15 +76,16 @@ jobs:
if: needs.changes.outputs.docs == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npm run doctoc
pnpm-lock.yaml
test/pnpm-lock.yaml
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- run: pnpm run doctoc

lint-helm:
name: Lint Helm chart
Expand All @@ -109,15 +111,16 @@ jobs:
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.npm == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npm run lint:ts
pnpm-lock.yaml
test/pnpm-lock.yaml
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- run: pnpm run lint:ts

lint-actions:
name: Lint GitHub Actions
Expand All @@ -140,15 +143,16 @@ jobs:
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.npm == 'true'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npm run test:unit
pnpm-lock.yaml
test/pnpm-lock.yaml
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- run: pnpm run test:unit

build:
name: linux-x64
Expand All @@ -173,13 +177,14 @@ jobs:
with:
submodules: true
- run: quilt push -a
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
pnpm-lock.yaml
test/pnpm-lock.yaml

# Get Code's git hash. When this changes it means the content is
# different and we need to rebuild.
Expand All @@ -200,22 +205,22 @@ jobs:
if: steps.cache-vscode.outputs.cache-hit != 'true'
run: |
cd lib/vscode/build
npm ci
pnpm install --frozen-lockfile
cd ..
source ./build/azure-pipelines/linux/setup-env.sh
# Run preinstall script before root dependencies are installed
# so that v8 headers are patched correctly for native modules.
node build/npm/preinstall.ts
npm ci
pnpm run preinstall
pnpm install --frozen-lockfile
cd ../..
npm run build:vscode
pnpm run build:vscode

# Build the code-server wrapper.
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npm run build
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- run: pnpm run build

# Push up an artifact containing the linux-x64 release.
- run: KEEP_MODULES=1 npm run release
- run: KEEP_MODULES=1 pnpm run release
- run: tar -czf package.tar.gz release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
Expand All @@ -232,14 +237,16 @@ jobs:

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
pnpm-lock.yaml
test/pnpm-lock.yaml

- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- name: Install Playwright OS dependencies
run: |
./test/node_modules/.bin/playwright install-deps
Expand All @@ -250,7 +257,7 @@ jobs:
name: linux-x64-package
- run: tar -xzf package.tar.gz

- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
- run: CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
if: always()
with:
Expand Down Expand Up @@ -282,14 +289,15 @@ jobs:
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
pnpm-lock.yaml
test/pnpm-lock.yaml
- run: SKIP_SUBMODULE_DEPS=1 pnpm install --frozen-lockfile
- name: Install Playwright OS dependencies
run: |
./test/node_modules/.bin/playwright install-deps
Expand All @@ -301,7 +309,7 @@ jobs:
- run: tar -xzf package.tar.gz

- run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
- run: CODE_SERVER_TEST_ENTRY=./release pnpm run test:e2e:proxy
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
if: always()
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
fileName: "*.rpm"
out-file-path: "release-packages"

- run: npm run publish:docker
- run: ./ci/steps/docker-buildx-push.sh

repo:
runs-on: ubuntu-latest
Expand Down
77 changes: 43 additions & 34 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ jobs:
VSCODE_ARCH: ${{ matrix.vscode_arch }}
npm_config_arch: ${{ matrix.npm_arch }}
# Ensure native modules are built from source to avoid prebuilds and use
# the correct version of glibc.
# the correct version of glibc. Although we use pnpm, this npm flag
# appears to still work for argon2, and VS Code has its own configuration
# for building from source.
npm_config_build_from_source: true
# Gulp target name.
# TODO: Pull from VSCODE_ARCH instead.
Expand All @@ -161,38 +163,39 @@ jobs:
# A merged update/ PR starts a release through pull_request_target.
allow-unsafe-pr-checkout: true
- run: quilt push -a
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
pnpm-lock.yaml
test/pnpm-lock.yaml

- name: Build
run: |
cd lib/vscode/build
npm ci
pnpm install --frozen-lockfile
cd ..
source ./build/azure-pipelines/linux/setup-env.sh
# Run preinstall script before root dependencies are installed
# so that v8 headers are patched correctly for native modules.
node build/npm/preinstall.ts
pnpm run preinstall
cd ../..
npm ci
npm run build
npm run build:vscode
pnpm install --frozen-lockfile
pnpm run build
pnpm run build:vscode

# Platform-agnostic NPM package.
- run: npm run release
- run: pnpm run release
if: ${{ matrix.vscode_arch == 'x64' }}
# Into release-packages with the platform packages, so the artifact is one flat directory.
- run: mkdir -p release-packages && tar -czf release-packages/package.tar.gz release
if: ${{ matrix.vscode_arch == 'x64' }}

# Platform-specific release.
- run: KEEP_MODULES=1 npm run release
- run: npm run package
- run: KEEP_MODULES=1 pnpm run release
- run: pnpm run package

# The approve job and publish.yaml check every file against these.
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
Expand Down Expand Up @@ -224,6 +227,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.prepare.outputs.version }}
# Ensure native modules are built from source to avoid prebuilds.
# Although we use pnpm, this npm flag appears to still work for argon2,
# and VS Code has its own configuration for building from source.
npm_config_build_from_source: true

steps:
Expand All @@ -247,21 +252,22 @@ jobs:
# A merged update/ PR starts a release through pull_request_target.
allow-unsafe-pr-checkout: true
- run: quilt push -a
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
pnpm-lock.yaml
test/pnpm-lock.yaml

- run: npm ci
- run: npm run build
- run: npm run build:vscode
- run: KEEP_MODULES=1 npm run release
- run: npm run test:native
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run build:vscode
- run: KEEP_MODULES=1 pnpm run release
- run: pnpm run test:native

- run: npm run package
- run: pnpm run package

# The approve job and publish.yaml check every file against these.
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
Expand Down Expand Up @@ -291,6 +297,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.prepare.outputs.version }}
# Ensure native modules are built from source to avoid prebuilds.
# Although we use pnpm, this npm flag appears to still work for argon2,
# and VS Code has its own configuration for building from source.
npm_config_build_from_source: true
OS: windows

Expand Down Expand Up @@ -320,20 +328,21 @@ jobs:
git apply --whitespace=nowarn "patches/$patch"
done < patches/series

- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version-file: .node-version
cache: npm
cache: pnpm
cache-dependency-path: |
package-lock.json
test/package-lock.json
pnpm-lock.yaml
test/pnpm-lock.yaml

# npm hands every script it runs to cmd, which cannot run the shell
# pnpm hands every script it runs to cmd, which cannot run the shell
# scripts this repository is built out of. Point it at the same bash
# the steps here use rather than at a path, which moves between
# images.
- name: Let npm run shell scripts
run: echo "npm_config_script_shell=$(cygpath -w "$(command -v bash)")" >> $GITHUB_ENV
- name: Let pnpm run shell scripts
run: echo "pnpm_config_script_shell=$(cygpath -w "$(command -v bash)")" >> $GITHUB_ENV

# The build merges json by handing jq a process substitution, which
# bash presents as a file under /dev/fd. The jq on this image is a
Expand Down Expand Up @@ -381,10 +390,10 @@ jobs:
run: C:\msys64\usr\bin\pacman -Sy --noconfirm --needed rsync

# Only rsync crosses over. Putting msys2's /usr/bin in front instead
# breaks the release step: npm on the path is a shell script whose
# breaks the release step: pnpm on the path is a shell script whose
# shebang reads /usr/bin/env bash, so with msys2 first it is msys2's
# bash that runs it, and crossing into a second msys runtime does not
# carry the environment. npm then sees no script-shell and falls back
# carry the environment. pnpm then sees no script-shell and falls back
# to cmd, which cannot run ./ci/build/build-release.sh, and
# KEEP_MODULES is dropped on the way. A forwarder avoids the whole
# class: rsync is a native exe that loads its runtime from beside
Expand All @@ -397,10 +406,10 @@ jobs:
SHIM
chmod +x "$RUNNER_TEMP/shim/rsync"

- run: npm ci
- run: npm run build
- run: npm run build:vscode
- run: KEEP_MODULES=1 npm run release
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run build:vscode
- run: KEEP_MODULES=1 pnpm run release

# Of the two tars on this image it is git bash's GNU one that can
# rename the tree's top directory as it archives; the windows bsdtar
Expand All @@ -412,7 +421,7 @@ jobs:
*GNU*) ;;
*) echo "expected GNU tar for --transform, got $(tar --version | head -1)" >&2; exit 1 ;;
esac
npm run package
pnpm run package

# The approve job and publish.yaml check every file against these.
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
Expand Down
Loading
Loading