Skip to content

Commit 561e786

Browse files
committed
Make version available to the code
1 parent e88deb3 commit 561e786

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

.travis.yml

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
11
language: node_js
22
node_js:
33
- 8.9.3
4+
env:
5+
- VERSION="1.31.0-$TRAVIS_BUILD_NUMBER"
46
matrix:
57
include:
68
- os: linux
79
dist: ubuntu
8-
env:
9-
- PLATFORM=linux
10-
- ARCH=x64
1110
- os: osx
12-
env:
13-
- PLATFORM=darwin
14-
- ARCH=x64
1511
before_install:
1612
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libxkbfile-dev
1713
libsecret-1-dev; fi
1814
script:
1915
- scripts/build.sh
2016
before_deploy:
21-
- export TRAVIS_TAG="1.31.0-$TRAVIS_BUILD_NUMBER"
22-
- echo "$TRAVIS_TAG" "$TRAVIS_COMMIT"
17+
- echo "$VERSION" "$TRAVIS_COMMIT"
2318
- git config --local user.name "$USER_NAME"
2419
- git config --local user.email "$USER_EMAIL"
25-
- git tag "$TRAVIS_TAG" "$TRAVIS_COMMIT"
26-
- yarn task package "$TRAVIS_TAG" "$PLATFORM-$ARCH"
20+
- git tag "$VERSION" "$TRAVIS_COMMIT"
21+
- yarn task package "$VERSION"
2722
deploy:
2823
provider: releases
2924
file_glob: true
3025
draft: true
31-
tag_name: $TRAVIS_TAG
32-
target_commitish: $TRAVIS_COMMIT
33-
name: $TRAVIS_TAG
26+
tag_name: "$VERSION"
27+
target_commitish: "$TRAVIS_COMMIT"
28+
name: "$VERSION"
3429
skip_cleanup: true
3530
api_key:
3631
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=

build/tasks.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -260,22 +260,19 @@ const ensurePatched = register("vscode:patch", async (runner) => {
260260
}
261261
});
262262

263-
register("package", async (runner, releaseTag, platform) => {
263+
register("package", async (runner, releaseTag) => {
264264
if (!releaseTag) {
265265
throw new Error("Please specify the release tag.");
266266
}
267-
if (!platform) {
268-
throw new Error("Please specify the platform.");
269-
}
270267

271-
const releasePath = path.resolve(__dirname, `../release`);
268+
const releasePath = path.resolve(__dirname, "../release");
272269

273-
const archiveName = `code-server-${releaseTag}-${platform}`;
270+
const archiveName = `code-server-${releaseTag}-${os.platform()}-${os.arch()}`;
274271
const archiveDir = path.join(releasePath, archiveName);
275272
fse.removeSync(archiveDir);
276273
fse.mkdirpSync(archiveDir);
277274

278-
const binaryPath = path.join(__dirname, `../packages/server/cli-${platform}`);
275+
const binaryPath = path.join(__dirname, `../packages/server/cli-${os.platform()}-${os.arch()}`);
279276
const binaryDestination = path.join(archiveDir, "code-server");
280277
fse.copySync(binaryPath, binaryDestination);
281278
fs.chmodSync(binaryDestination, "755");

packages/server/scripts/nexe.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fs.writeFileSync(shimPath, shimContent);
1414

1515
const nexe = require("nexe");
1616

17-
const target = `${process.env.PLATFORM || os.platform()}${process.env.ARCH ? `-${process.env.ARCH}` : ""}`;
17+
const target = `${os.platform()}-${os.arch()}`;
1818
nexe.compile({
1919
debugBundle: true,
2020
input: path.join(__dirname, "../out/cli.js"),

packages/server/src/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class Entry extends Command {
114114
}
115115
}
116116

117-
logger.info("\u001B[1mcode-server v1.0.0");
117+
logger.info(`\u001B[1mcode-server ${process.env.VERSION ? `v${process.env.VERSION}` : "development"}`);
118118
// TODO: fill in appropriate doc url
119119
logger.info("Additional documentation: http://github.com/codercom/code-server");
120120
logger.info("Initializing", field("data-dir", dataDir), field("working-dir", workingDir), field("log-dir", logDir));

packages/server/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = merge(
2424
},
2525
resolve: {
2626
alias: {
27-
"node-pty": "node-pty-prebuilt",
27+
"node-pty": "node-pty-prebuilt",
2828
},
2929
},
3030
externals: ["tslib", "trash"],

scripts/webpack.general.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ module.exports = (options = {}) => ({
118118
"process.env.NODE_ENV": `"${environment}"`,
119119
"process.env.LOG_LEVEL": `"${process.env.LOG_LEVEL || ""}"`,
120120
"process.env.SERVICE_URL": `"${process.env.SERVICE_URL || ""}"`,
121+
"process.env.VERSION": `"${process.env.VERSION || ""}"`,
121122
}),
122123
],
123124
stats: {

0 commit comments

Comments
 (0)