Skip to content

Commit 9ea486c

Browse files
committed
Add NPM package, debs, rpms and refactor CI/build process
Closes many issues that I'll prune after adding more docs for users.
1 parent a64f80d commit 9ea486c

40 files changed

+787
-598
lines changed

.dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
**
2-
!release
2+
!release-github

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
*.tsbuildinfo
22
.cache
3-
build
43
dist*
54
out*
65
release/
7-
release-upload/
6+
release-static/
7+
release-github/
8+
release-gcp/
89
node_modules
9-
binaries

.travis.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,24 @@ jobs:
44
include:
55
- name: Test
66
if: tag IS blank
7-
script: ./ci/image/run.sh "yarn && git submodule update --init && yarn vscode:patch && ./ci/ci.sh"
7+
script: ./ci/container/exec.sh ./ci/steps/test.sh
88
deploy: null
9-
- name: Linux Release
10-
if: tag IS present
11-
script:
12-
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh"
13-
- ./ci/release-image/push.sh
9+
- name: Linux AMD64 Release #if: tag IS present
10+
script: |
11+
./ci/steps/linux-release.sh || exit 1
12+
# We do not use the travis npm deploy integration as it does not allow us to
13+
# deploy a subpath and and v2 which should, just errors out that the src does not exist
14+
./ci/container/exec.sh npm publish release || exit 1
1415
- name: Linux ARM64 Release
1516
if: tag IS present
16-
script:
17-
- ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh"
18-
- ./ci/release-image/push.sh
17+
script: ./ci/steps/linux-release.sh
1918
arch: arm64
2019
- name: MacOS Release
2120
if: tag IS present
2221
os: osx
2322
language: node_js
2423
node_js: 12
25-
script: yarn && yarn vscode && travis_wait 60 ci/release.sh && ./ci/build-test.sh
24+
script: ./ci/steps/static-release.sh
2625

2726
before_deploy:
2827
- echo "$JSON_KEY" | base64 --decode > ./ci/key.json
@@ -36,16 +35,17 @@ deploy:
3635
target_commitish: $TRAVIS_COMMIT
3736
name: $TRAVIS_TAG
3837
file:
39-
- release/*.tar.gz
40-
- release/*.zip
41-
on:
42-
tags: true
38+
- release-github/*.tar.gz
39+
- release-github/*.zip
40+
- release-github/*.deb
41+
- release-github/*.rpm
42+
on: #tags: true
4343
- provider: gcs
4444
edge: true
4545
bucket: "codesrv-ci.cdr.sh"
4646
upload_dir: "releases"
4747
key_file: ./ci/key.json
48-
local_dir: release-upload
48+
local_dir: ./release-gcp
4949
on:
5050
tags: true
5151
# TODO: The gcs provider fails to install on arm64.

ci/README.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# ci
2+
3+
This directory contains scripts used for code-server's continuous integration infrastructure.
4+
5+
Many of these scripts contain more detailed documentation and options in comments at the top.
6+
7+
Any file and directory added into this tree should be documented here.
8+
9+
## dev
10+
11+
This directory contains scripts used for the development of code-server.
12+
13+
- [./dev/container](./dev/container)
14+
- See [CONTRIBUTING.md](../doc/CONTRIBUTING.md) for docs on the development container
15+
- [./dev/ci.sh](./dev/ci.sh) (`yarn ci`)
16+
- Runs formatters, linters and tests
17+
- [./dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
18+
- Runs formatters
19+
- [./dev/lint.sh](./dev/lint.sh) (`yarn lint`)
20+
- Runs linters
21+
- [./dev/test.sh](./dev/test.sh) (`yarn test`)
22+
- Runs tests
23+
- [./dev/vscode.sh](./dev/vscode.sh) (`yarn vscode`)
24+
- Ensures `lib/vscode` is cloned, patched and dependencies are installed
25+
- [./dev/vscode.patch](./dev/vscode.patch)
26+
- Our patch of VS Code to enable remote browser access
27+
- Generate it with `yarn vscode:diff` and apply with `yarn vscode:patch`
28+
- [./dev/watch.ts](./dev/watch.ts) (`yarn watch`)
29+
- Starts a process to build and launch code-server and restart on any code changes
30+
- Example usage in [CONTRIBUTING.md](../doc/CONTRIBUTING.md)
31+
32+
## build
33+
34+
This directory contains the scripts used to build code-server.
35+
36+
- [./build/build-code-server.sh](./build/build-code-server.sh) (`yarn build`)
37+
- Builds code-server into ./out and bundles the frontend into ./dist.
38+
- [./build/build-vscode.sh](./build/build-vscode.sh) (`yarn build`)
39+
- Builds vscode into ./lib/vscode/out-vscode.
40+
- [./build/build-release.sh](./build/build-release.sh) (`yarn release`)
41+
- Bundles the output of the above two scripts into a single node module at ./release.
42+
- Will build a static release with node/node_modules into `./release-static`
43+
if `STATIC=1` is set.
44+
- [./build/clean.sh](./build/clean.sh) (`yarn clean`)
45+
- Removes all git ignored files like build artifacts.
46+
- Will also `git reset --hard lib/vscode`
47+
- Useful to do a clean build.
48+
- [./build/code-server.sh](./build/code-server.sh)
49+
- Copied into static releases to run code-server with the bundled node binary.
50+
- [./build/archive-static-release.sh](./build/archive-static-release.sh)
51+
- Archives `./release-static` into a tar/zip for CI with the proper directory name scheme
52+
- [./build/test-release.sh](./build/test-static-release.sh)
53+
- Ensures code-server in the `./release-static` directory runs
54+
- [./build/build-static-pkgs.sh](./build/build-static-pkgs.sh) (`yarn pkg`)
55+
- Uses [nfpm](https://github.com/goreleaser/nfpm) to generate .deb and .rpm from a static release
56+
- [./build/nfpm.yaml](./build/nfpm.yaml)
57+
- Used to configure [nfpm](https://github.com/goreleaser/nfpm) to generate .deb and .rpm
58+
- [./build/code-server-nfpm.sh](./build/code-server-nfpm.sh)
59+
- Entrypoint script for code-server for .deb and .rpm
60+
61+
## release-container
62+
63+
This directory contains the release docker container.
64+
65+
## container
66+
67+
This directory contains the container for CI.
68+
69+
## steps
70+
71+
This directory contains a few scripts used in CI. Just helps avoid clobbering .travis.yml.
72+
73+
- [./steps/test.sh](./steps/test.sh)
74+
- Runs `yarn ci` after ensuring VS Code is patched
75+
- [./steps/static-release.sh](./steps/static-release.sh)
76+
- Runs the full static build process for CI
77+
- [./steps/linux-release.sh](./steps/linux-release.sh)
78+
- Runs the full static build process for CI
79+
- Packages the release into a .deb and .rpm
80+
- Builds and pushes a docker release

0 commit comments

Comments
 (0)