Skip to content

Commit d8f0a54

Browse files
committed
Fix cross-compiled Linux releases
Now using the setup-env.sh script in the VS Code repo to set the right env vars.
1 parent 9dcb1d7 commit d8f0a54

File tree

1 file changed

+37
-46
lines changed

1 file changed

+37
-46
lines changed

.github/workflows/release.yaml

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,42 @@ concurrency:
1919

2020
jobs:
2121
package-linux:
22-
name: ${{ matrix.vscode_target }}
23-
runs-on: ubuntu-latest
24-
container: "python:3.8-slim-buster"
22+
name: ${{ format('linux-{0}', matrix.vscode_arch) }}
23+
runs-on: ubuntu-22.04
2524
strategy:
2625
matrix:
2726
include:
28-
- prefix: x86_64-linux-gnu
29-
npm_arch: x64
30-
apt_arch: amd64
27+
- npm_arch: x64
28+
vscode_arch: x64
3129
package_arch: amd64
32-
vscode_target: linux-x64
33-
- prefix: aarch64-linux-gnu
34-
npm_arch: arm64
35-
apt_arch: arm64
30+
- npm_arch: arm64
3631
package_arch: arm64
37-
vscode_target: linux-arm64
38-
- prefix: arm-linux-gnueabihf
39-
npm_arch: armv7l
40-
apt_arch: armhf
32+
vscode_arch: arm64
33+
- npm_arch: arm
4134
package_arch: armv7l
42-
vscode_target: linux-armhf
35+
vscode_arch: armhf
4336

4437
env:
45-
AR: ${{ format('{0}-ar', matrix.prefix) }}
46-
AS: ${{ format('{0}-as', matrix.prefix) }}
47-
CC: ${{ format('{0}-gcc', matrix.prefix) }}
48-
CPP: ${{ format('{0}-cpp', matrix.prefix) }}
49-
CXX: ${{ format('{0}-g++', matrix.prefix) }}
50-
FC: ${{ format('{0}-gfortran', matrix.prefix) }}
51-
LD: ${{ format('{0}-ld', matrix.prefix) }}
52-
STRIP: ${{ format('{0}-strip', matrix.prefix) }}
53-
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
54-
# Set cross-compiler package arch.
55-
APT_ARCH: ${{ matrix.apt_arch }}
56-
# For downloading the right Node.
38+
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
39+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
40+
# For setting cross-compilation flags via setup-env.sh.
41+
VSCODE_ARCH: ${{ matrix.vscode_arch }}
42+
# Gulp target.
43+
VSCODE_TARGET: ${{ format('linux-{0}', matrix.vscode_arch) }}
5744
npm_config_arch: ${{ matrix.npm_arch }}
58-
# Overrides package architecture.
45+
# Sets the release archive name.
5946
ARCH: ${{ matrix.package_arch }}
6047
# Not building from source results in an x86_64 argon2, as if
6148
# npm_config_arch is being ignored.
6249
npm_config_build_from_source: true
63-
# Overrides VS Code gulp build target.
64-
VSCODE_TARGET: ${{ matrix.vscode_target }}
6550
TAG: ${{ inputs.version || github.ref_name }}
6651

6752
steps:
68-
- name: Install cross-compiler and system dependencies
69-
run: |
70-
sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
71-
dpkg --add-architecture $APT_ARCH
72-
apt update && apt install -y --no-install-recommends \
73-
crossbuild-essential-$APT_ARCH \
74-
libx11-dev:$APT_ARCH \
75-
libx11-xcb-dev:$APT_ARCH \
76-
libxkbfile-dev:$APT_ARCH \
77-
libsecret-1-dev:$APT_ARCH \
78-
libkrb5-dev:$APT_ARCH \
79-
ca-certificates \
80-
curl wget rsync gettext-base quilt git
53+
- run: sudo apt update && sudo apt install -y libkrb5-dev
54+
- uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
55+
with:
56+
packages: quilt
57+
version: 1.0
8158
- name: Install nfpm
8259
run: |
8360
mkdir -p ~/.local/bin
@@ -99,9 +76,23 @@ jobs:
9976
cache-dependency-path: |
10077
package-lock.json
10178
test/package-lock.json
102-
- run: npm ci
103-
- run: npm run build
104-
- run: npm run build:vscode
79+
# Use remote npmrc, since the root one targets Electron, and this leads to
80+
# errors in this environment. This target does not appear to require the
81+
# node-gyp header patch.
82+
- name: Use remote npmrc
83+
- run: |
84+
cp lib/vscode/remote/.npmrc lib/vscode
85+
sed -i "s/fs.existsSync(localHeaderPath)/false/" lib/vscode/build/npm/preinstall.ts
86+
- name: Install dependencies and build
87+
run: |
88+
cd lib/vscode/build
89+
npm ci
90+
cd ..
91+
source ./build/azure-pipelines/linux/setup-env.sh
92+
cd ../..
93+
npm ci
94+
npm run build
95+
npm run build:vscode
10596
10697
# Platform-agnostic NPM package.
10798
- run: npm run release

0 commit comments

Comments
 (0)