mirror of https://git.tuxpa.in/a/code-server.git
Rename static releases to binary releases
More clear as discussed in PR.
This commit is contained in:
parent
665ca017a1
commit
fa45fd0e31
|
@ -4,7 +4,7 @@ dist*
|
||||||
out*
|
out*
|
||||||
release/
|
release/
|
||||||
release-npm-package/
|
release-npm-package/
|
||||||
release-static/
|
release-binary/
|
||||||
release-packages/
|
release-packages/
|
||||||
release-gcp/
|
release-gcp/
|
||||||
release-images/
|
release-images/
|
||||||
|
|
16
ci/README.md
16
ci/README.md
|
@ -75,19 +75,19 @@ You can disable minification by setting `MINIFY=`.
|
||||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||||
- [./ci/build/build-static-release.sh](./build/build-static-release.sh) (`yarn release:static`)
|
- [./ci/build/build-binary-release.sh](./build/build-binary-release.sh) (`yarn release:binary`)
|
||||||
- Requires a node module already built into `./release` with the above script.
|
- Requires a node module already built into `./release` with the above script.
|
||||||
- Will build a static release with node and node_modules bundled into `./release-static`.
|
- Will build a binary release with node and node_modules bundled into `./release-binary`.
|
||||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
||||||
- Removes all build artifacts.
|
- Removes all build artifacts.
|
||||||
- Will also `git reset --hard lib/vscode`.
|
- Will also `git reset --hard lib/vscode`.
|
||||||
- Useful to do a clean build.
|
- Useful to do a clean build.
|
||||||
- [./ci/build/code-server.sh](./build/code-server.sh)
|
- [./ci/build/code-server.sh](./build/code-server.sh)
|
||||||
- Copied into static releases to run code-server with the bundled node binary.
|
- Copied into binary releases to run code-server with the bundled node binary.
|
||||||
- [./ci/build/test-static-release.sh](./build/test-static-release.sh) (`yarn test:static-release`)
|
- [./ci/build/test-binary-release.sh](./build/test-binary-release.sh) (`yarn test:binary-release`)
|
||||||
- Ensures code-server in the `./release-static` directory works by installing an extension.
|
- Ensures code-server in the `./release-binary` directory works by installing an extension.
|
||||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
|
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
|
||||||
- Packages `./release-static` into a `.tar.gz` archive in `./release-packages`.
|
- Packages `./release-binary` into a `.tar.gz` archive in `./release-packages`.
|
||||||
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
||||||
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
||||||
- Used to configure [nfpm](https://github.com/goreleaser/nfpm) to generate `.deb` and `.rpm`.
|
- Used to configure [nfpm](https://github.com/goreleaser/nfpm) to generate `.deb` and `.rpm`.
|
||||||
|
@ -131,8 +131,8 @@ Helps avoid clobbering the CI configuration.
|
||||||
- [./steps/release.sh](./steps/release.sh)
|
- [./steps/release.sh](./steps/release.sh)
|
||||||
- Runs the release process.
|
- Runs the release process.
|
||||||
- Generates the npm package at `./release`.
|
- Generates the npm package at `./release`.
|
||||||
- [./steps/release-static.sh](./steps/release-static.sh)
|
- [./steps/release-binary.sh](./steps/release-binary.sh)
|
||||||
- Takes the output of the previous script and generates a static release and
|
- Takes the output of the previous script and generates a binary release and
|
||||||
release packages into `release-packages`.
|
release packages into `release-packages`.
|
||||||
- [./steps/publish-npm.sh](./steps/publish-npm.sh)
|
- [./steps/publish-npm.sh](./steps/publish-npm.sh)
|
||||||
- Grabs the `npm-package` release artifact for the current commit and publishes it on npm.
|
- Grabs the `npm-package` release artifact for the current commit and publishes it on npm.
|
||||||
|
|
|
@ -5,8 +5,8 @@ main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
source ./ci/lib.sh
|
source ./ci/lib.sh
|
||||||
|
|
||||||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-static"
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-binary"
|
||||||
RELEASE_PATH+=-static
|
RELEASE_PATH+=-binary
|
||||||
|
|
||||||
# We cannot find the path to node from $PATH because yarn shims a script to ensure
|
# We cannot find the path to node from $PATH because yarn shims a script to ensure
|
||||||
# we use the same version it's using so we instead run a script with yarn that
|
# we use the same version it's using so we instead run a script with yarn that
|
|
@ -2,7 +2,7 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Packages code-server for the current OS and architecture into ./release-packages.
|
# Packages code-server for the current OS and architecture into ./release-packages.
|
||||||
# This script assumes that a static release is built already into ./release-static.
|
# This script assumes that a binary release is built already into ./release-binary
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
|
@ -29,9 +29,9 @@ main() {
|
||||||
release_archive() {
|
release_archive() {
|
||||||
local release_name="code-server-$VERSION-$OS-$ARCH"
|
local release_name="code-server-$VERSION-$OS-$ARCH"
|
||||||
if [[ $OS == "linux" ]]; then
|
if [[ $OS == "linux" ]]; then
|
||||||
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-static/$release_name/" ./release-static
|
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-binary/$release_name/" ./release-binary
|
||||||
else
|
else
|
||||||
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-static/$release_name/" release-static
|
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-binary/$release_name/" release-binary
|
||||||
fi
|
fi
|
||||||
echo "done (release-packages/$release_name)"
|
echo "done (release-packages/$release_name)"
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ main() {
|
||||||
rm -Rf \
|
rm -Rf \
|
||||||
out \
|
out \
|
||||||
release \
|
release \
|
||||||
release-static \
|
release-binary \
|
||||||
release-packages \
|
release-packages \
|
||||||
release-gcp \
|
release-gcp \
|
||||||
release-images/ \
|
release-images/ \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# This script is intended to be bundled into the static releases.
|
# This script is intended to be bundled into the binary releases.
|
||||||
# Runs code-server with the bundled Node binary.
|
# Runs code-server with the bundled Node binary.
|
||||||
|
|
||||||
# More complicated than readlink -f or realpath to support macOS.
|
# More complicated than readlink -f or realpath to support macOS.
|
||||||
|
|
|
@ -13,4 +13,4 @@ license: "MIT"
|
||||||
files:
|
files:
|
||||||
./ci/build/code-server-nfpm.sh: /usr/bin/code-server
|
./ci/build/code-server-nfpm.sh: /usr/bin/code-server
|
||||||
./ci/build/code-server.service: /usr/lib/systemd/user/code-server.service
|
./ci/build/code-server.service: /usr/lib/systemd/user/code-server.service
|
||||||
./release-static/**/*: "/usr/lib/code-server/"
|
./release-binary/**/*: "/usr/lib/code-server/"
|
||||||
|
|
|
@ -10,18 +10,18 @@ main() {
|
||||||
local EXTENSIONS_DIR
|
local EXTENSIONS_DIR
|
||||||
EXTENSIONS_DIR="$(mktemp -d)"
|
EXTENSIONS_DIR="$(mktemp -d)"
|
||||||
|
|
||||||
echo "Testing static release"
|
echo "Testing binary release"
|
||||||
|
|
||||||
./release-static/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
|
./release-binary/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
|
||||||
local installed_extensions
|
local installed_extensions
|
||||||
installed_extensions="$(./release-static/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
|
installed_extensions="$(./release-binary/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
|
||||||
if [[ $installed_extensions != "ms-python.python" ]]; then
|
if [[ $installed_extensions != "ms-python.python" ]]; then
|
||||||
echo "Unexpected output from listing extensions:"
|
echo "Unexpected output from listing extensions:"
|
||||||
echo "$installed_extensions"
|
echo "$installed_extensions"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Static release works correctly"
|
echo "Binary release works correctly"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
|
@ -7,8 +7,8 @@ main() {
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
tar -xzf release-npm-package/package.tar.gz
|
tar -xzf release-npm-package/package.tar.gz
|
||||||
|
|
||||||
yarn release:static
|
yarn release:binary
|
||||||
yarn test:static-release
|
yarn test:binary-release
|
||||||
yarn package
|
yarn package
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,14 +51,14 @@ yarn --production
|
||||||
node .
|
node .
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can make it static and build packages with:
|
Now you can build binary packages with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn release:static
|
yarn release:binary
|
||||||
yarn test:static-release
|
yarn test:binary-release
|
||||||
yarn package
|
yarn package
|
||||||
# The static release is in ./release-static
|
# The binary release is in ./release-binary
|
||||||
# .deb, .rpm and the static archive are in ./release-packages
|
# .deb, .rpm and the binary archive are in ./release-packages
|
||||||
```
|
```
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
- [Arch Linux](#arch-linux)
|
- [Arch Linux](#arch-linux)
|
||||||
- [yarn, npm](#yarn-npm)
|
- [yarn, npm](#yarn-npm)
|
||||||
- [macOS](#macos)
|
- [macOS](#macos)
|
||||||
- [Static Releases](#static-releases)
|
- [Binary Releases](#binary-releases)
|
||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
@ -51,8 +51,8 @@ commands presented in the rest of this document.
|
||||||
- `--dry-run` to echo the commands for the install process without running them.
|
- `--dry-run` to echo the commands for the install process without running them.
|
||||||
- `--method` to choose the installation method.
|
- `--method` to choose the installation method.
|
||||||
- `--method=detect` to detect the package manager but fallback to `--method=archive`.
|
- `--method=detect` to detect the package manager but fallback to `--method=archive`.
|
||||||
- `--method=archive` to install a static release archive into `~/.local`.
|
- `--method=archive` to install a binary release archive into `~/.local`.
|
||||||
- `--prefix=/usr/local` to install a static release archive system wide.
|
- `--prefix=/usr/local` to install a binary release archive system wide.
|
||||||
- `--version=X.X.X` to install version `X.X.X` instead of latest.
|
- `--version=X.X.X` to install version `X.X.X` instead of latest.
|
||||||
- `--help` to see full usage docs.
|
- `--help` to see full usage docs.
|
||||||
|
|
||||||
|
@ -61,13 +61,13 @@ commands presented in the rest of this document.
|
||||||
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
||||||
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
||||||
- For Arch Linux it will install the AUR package.
|
- For Arch Linux it will install the AUR package.
|
||||||
- For any unrecognized Linux operating system it will install the latest static release into `~/.local`.
|
- For any unrecognized Linux operating system it will install the latest binary release into `~/.local`.
|
||||||
|
|
||||||
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
||||||
|
|
||||||
- For macOS it will install the Homebrew package.
|
- For macOS it will install the Homebrew package.
|
||||||
|
|
||||||
- If Homebrew is not installed it will install the latest static release into `~/.local`.
|
- If Homebrew is not installed it will install the latest binary release into `~/.local`.
|
||||||
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
||||||
|
|
||||||
- If ran on an architecture with no binary releases, it will install the npm package with `yarn` or `npm`.
|
- If ran on an architecture with no binary releases, it will install the npm package with `yarn` or `npm`.
|
||||||
|
@ -136,7 +136,7 @@ brew services start code-server
|
||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Static Releases
|
## Binary Releases
|
||||||
|
|
||||||
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
|
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
|
||||||
They bundle the node binary and `node_modules`.
|
They bundle the node binary and `node_modules`.
|
||||||
|
@ -148,7 +148,7 @@ They bundle the node binary and `node_modules`.
|
||||||
You can add the code-server `bin` directory to your `$PATH` to easily execute `code-server`
|
You can add the code-server `bin` directory to your `$PATH` to easily execute `code-server`
|
||||||
without the full path every time.
|
without the full path every time.
|
||||||
|
|
||||||
Here is an example script for installing and using a static `code-server` release on Linux:
|
Here is an example script for installing and using a binary `code-server` release on Linux:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.local/lib ~/.local/bin
|
mkdir -p ~/.local/lib ~/.local/bin
|
||||||
|
|
18
install.sh
18
install.sh
|
@ -30,10 +30,10 @@ Usage:
|
||||||
Choose the installation method. Defaults to detect.
|
Choose the installation method. Defaults to detect.
|
||||||
- detect detects the system package manager and tries to use it.
|
- detect detects the system package manager and tries to use it.
|
||||||
Full reference on the process is further below.
|
Full reference on the process is further below.
|
||||||
- archive installs a static release archive into ~/.local
|
- archive installs a binary release archive into ~/.local
|
||||||
Add ~/.local/bin to your \$PATH to use it.
|
Add ~/.local/bin to your \$PATH to use it.
|
||||||
--prefix <dir>
|
--prefix <dir>
|
||||||
Sets the prefix used by static release archives. Defaults to ~/.local
|
Sets the prefix used by binary release archives. Defaults to ~/.local
|
||||||
The release is unarchived into ~/.local/lib/code-server-X.X.X
|
The release is unarchived into ~/.local/lib/code-server-X.X.X
|
||||||
and the binary symlinked into ~/.local/bin/code-server
|
and the binary symlinked into ~/.local/bin/code-server
|
||||||
To install system wide pass ---prefix=/usr/local
|
To install system wide pass ---prefix=/usr/local
|
||||||
|
@ -41,11 +41,11 @@ Usage:
|
||||||
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
||||||
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
||||||
- For Arch Linux it will install the AUR package.
|
- For Arch Linux it will install the AUR package.
|
||||||
- For any unrecognized Linux operating system it will install the latest static
|
- For any unrecognized Linux operating system it will install the latest binary
|
||||||
release into ~/.local
|
release into ~/.local
|
||||||
|
|
||||||
- For macOS it will install the Homebrew package.
|
- For macOS it will install the Homebrew package.
|
||||||
- If Homebrew is not installed it will install the latest static release
|
- If Homebrew is not installed it will install the latest binary release
|
||||||
into ~/.local
|
into ~/.local
|
||||||
|
|
||||||
- If ran on an architecture with no binary releases, it will install the
|
- If ran on an architecture with no binary releases, it will install the
|
||||||
|
@ -65,10 +65,10 @@ echo_latest_version() {
|
||||||
echo "$version"
|
echo "$version"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_static_postinstall() {
|
echo_archive_postinstall() {
|
||||||
echo
|
echo
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Static release has been installed into $ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION
|
Binary release has been installed into $ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION
|
||||||
Please extend your path to use code-server:
|
Please extend your path to use code-server:
|
||||||
PATH="$ARCHIVE_INSTALL_PREFIX/bin:\$PATH"
|
PATH="$ARCHIVE_INSTALL_PREFIX/bin:\$PATH"
|
||||||
Then you can run:
|
Then you can run:
|
||||||
|
@ -158,7 +158,7 @@ main() {
|
||||||
ARCH="$(arch)"
|
ARCH="$(arch)"
|
||||||
if [ ! "$ARCH" ]; then
|
if [ ! "$ARCH" ]; then
|
||||||
if [ "$METHOD" = archive ]; then
|
if [ "$METHOD" = archive ]; then
|
||||||
echoerr "No static releases available for the architecture $(uname -m)."
|
echoerr "No binary releases available for the architecture $(uname -m)."
|
||||||
echoerr 'Please rerun without the "--method archive" flag to install from npm.'
|
echoerr 'Please rerun without the "--method archive" flag to install from npm.'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -304,7 +304,7 @@ install_aur() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_archive() {
|
install_archive() {
|
||||||
echo "Installing static release v$VERSION"
|
echo "Installing binary release archive v$VERSION"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-$OS-$ARCH.tar.gz" \
|
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-$OS-$ARCH.tar.gz" \
|
||||||
|
@ -327,7 +327,7 @@ install_archive() {
|
||||||
"$sh_c" mv -f "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION-$OS-$ARCH" "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION"
|
"$sh_c" mv -f "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION-$OS-$ARCH" "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION"
|
||||||
"$sh_c" ln -fs "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION/bin/code-server" "$ARCHIVE_INSTALL_PREFIX/bin/code-server"
|
"$sh_c" ln -fs "$ARCHIVE_INSTALL_PREFIX/lib/code-server-$VERSION/bin/code-server" "$ARCHIVE_INSTALL_PREFIX/bin/code-server"
|
||||||
|
|
||||||
echo_static_postinstall
|
echo_archive_postinstall
|
||||||
}
|
}
|
||||||
|
|
||||||
install_npm() {
|
install_npm() {
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
"build": "./ci/build/build-code-server.sh",
|
"build": "./ci/build/build-code-server.sh",
|
||||||
"build:vscode": "./ci/build/build-vscode.sh",
|
"build:vscode": "./ci/build/build-vscode.sh",
|
||||||
"release": "./ci/build/build-release.sh",
|
"release": "./ci/build/build-release.sh",
|
||||||
"release:static": "./ci/build/build-static-release.sh",
|
"release:binary": "./ci/build/build-binary-release.sh",
|
||||||
"release:github-draft": "./ci/build/release-github-draft.sh",
|
"release:github-draft": "./ci/build/release-github-draft.sh",
|
||||||
"release:github-assets": "./ci/build/release-github-assets.sh",
|
"release:github-assets": "./ci/build/release-github-assets.sh",
|
||||||
"test:static-release": "./ci/build/test-static-release.sh",
|
"test:binary-release": "./ci/build/test-binary-release.sh",
|
||||||
"package": "./ci/build/build-packages.sh",
|
"package": "./ci/build/build-packages.sh",
|
||||||
"_____": "",
|
"_____": "",
|
||||||
"fmt": "./ci/dev/fmt.sh",
|
"fmt": "./ci/dev/fmt.sh",
|
||||||
|
|
Loading…
Reference in New Issue