diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a2c632513..6bfbcb1e5 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -76,8 +76,7 @@ parts: LINUX_CI_STEPS="$(curl -s "${UPSTREAM_URL}/.github/workflows/ci.yml")" NODE_VERSION="$(curl "${UPSTREAM_URL}/package.json" | jq -r '.engines.node')" - YARN_VERSION="$(echo "$LINUX_CI_STEPS" | grep -m1 -Po "npm install -g yarn@\K[^ ]+")" - NPM_VERSION="$(echo "$LINUX_CI_STEPS" | grep -m1 -Po "npm install -g yarn@[\d.]+ npm@\K[^ ]+")" + NPM_VERSION="$(echo "$LINUX_CI_STEPS" | grep -m1 -Po "npm install -g npm@\K[^ ]+")" # Install the correct version of nodejs required by Signal-Desktop asdf plugin add nodejs @@ -85,14 +84,9 @@ parts: asdf global nodejs "$NODE_VERSION" # Configure NPM proxy - npm config set proxy "${http_proxy:-}" - npm config set https-proxy "${https_proxy:-}" - - # Install and configure Yarn - npm install -g "yarn@${YARN_VERSION}" "npm@${NPM_VERSION}" - yarn config set python /usr/bin/python3 - yarn config set proxy "${http_proxy:-}" - yarn config set https-proxy "${https_proxy:-}" + npm config set -g proxy "${http_proxy:-}" + npm config set -g https-proxy "${http_proxy:-}" + npm install -g "npm@${NPM_VERSION}" signal-desktop: after: @@ -111,25 +105,22 @@ parts: build-environment: - SIGNAL_ENV: "production" override-build: | - # Use the version of nodejs/yarn we configured before + # Use the version of nodejs we configured before source "$(pwd)/../../nodejs/build/asdf.sh" git lfs install - # Disable yarn auto clean functionality - rm .yarnclean - # If we're in a proxy environment, we need to patch some packages if [[ -n "${http_proxy:-}" ]]; then # Setup proxy access export HTTP_PROXY="${http_proxy}" - export HTTPS_PROXY="${https_proxy}" + export HTTPS_PROXY="${http_proxy}" export ELECTRON_GET_USE_PROXY=1 export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}" export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}" # The patch applied uses this package to ensure proxy is used - yarn global add https-proxy-agent + npm install https-proxy-agent # Update the package.json so the build uses the patched libraries cat package.json \ @@ -139,30 +130,30 @@ parts: # Build the sticker-creator pushd sticker-creator - yarn install - yarn build + npm ci --legacy-peer-deps + npm run build popd # Install the dependencies for the Signal-Desktop application. - # We cannot use `--frozen-lockfile` due to the patching above. - yarn install + npm install + npm ci --legacy-peer-deps - # This is the equivalent of 'yarn generate'. The upstream package.json + # This is the equivalent of 'npm run generate'. The upstream package.json # uses npm-run-all to run multiple things, which has a bug that prevents # this from succeeding in the snapcraft build env, so this just breaks # that apart into its component parts. - yarn build-protobuf - yarn build:esbuild - yarn build:icu-types - yarn build:compact-locales - yarn sass - yarn get-expire-time - yarn copy-components - - # This is the equivalent of 'yarn build-linux' which also runs 'yarn generate' + npm run build-protobuf + npm run build:esbuild + npm run build:icu-types + npm run build:compact-locales + npm run sass + npm run get-expire-time + npm run copy-components + + # This is the equivalent of 'npm run build-linux' which also runs 'npm run generate' # which is broken (as described above). - yarn build:esbuild:prod - yarn build:release --linux dir + npm run build:esbuild:prod + npm run build:release -- --linux dir # Stage the built release. Directory is called 'linux-unpacked' for amd64, # and 'linux-arm64-unpacked' for arm64.