2022-09-16 17:14:28 +02:00
|
|
|
name: Draft release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-11-08 23:45:01 +01:00
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: The version to publish (include "v", i.e. "v4.9.1").
|
|
|
|
type: string
|
|
|
|
required: true
|
2022-09-16 17:14:28 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write # For creating releases.
|
|
|
|
discussions: write # For creating a discussion.
|
|
|
|
|
|
|
|
# Cancel in-progress runs for pull requests when developers push
|
|
|
|
# additional changes
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
|
|
|
|
jobs:
|
2022-09-27 20:46:37 +02:00
|
|
|
# TODO: cache building yarn --production
|
|
|
|
# possibly 2m30s of savings(?)
|
|
|
|
# this requires refactoring our release scripts
|
|
|
|
package-linux-amd64:
|
|
|
|
name: x86-64 Linux build
|
2022-09-16 17:14:28 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-27 20:46:37 +02:00
|
|
|
timeout-minutes: 15
|
2022-11-08 23:45:01 +01:00
|
|
|
needs: npm-version
|
2023-09-21 23:42:17 +02:00
|
|
|
container: "centos:8"
|
2022-09-27 20:46:37 +02:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-27 20:46:37 +02:00
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-09-27 20:46:37 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Install development tools
|
|
|
|
run: |
|
2023-09-21 23:42:17 +02:00
|
|
|
cd /etc/yum.repos.d/
|
|
|
|
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
|
|
|
|
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
|
|
|
yum install -y gcc-c++ make jq rsync python3 libsecret-devel krb5-devel
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Install nfpm and envsubst
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.local/bin
|
2022-12-12 16:52:33 +01:00
|
|
|
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.22.2/nfpm_2.22.2_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
2022-09-27 20:46:37 +02:00
|
|
|
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
|
|
|
chmod +x envsubst
|
|
|
|
mv envsubst ~/.local/bin
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Install yarn
|
|
|
|
run: npm install -g yarn
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
- name: Download npm package
|
|
|
|
uses: actions/download-artifact@v3
|
2022-09-27 20:46:37 +02:00
|
|
|
with:
|
2022-11-08 23:45:01 +01:00
|
|
|
name: npm-release-package
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
2022-12-12 23:03:07 +01:00
|
|
|
- name: Build standalone release
|
2023-09-21 23:42:17 +02:00
|
|
|
run: npm run release:standalone
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Run integration tests on standalone release
|
|
|
|
run: yarn test:integration
|
|
|
|
|
|
|
|
- name: Upload coverage report to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
if: success()
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
|
|
# i.e. v4.9.1 -> 4.9.1
|
|
|
|
- name: Get and set VERSION
|
|
|
|
run: |
|
|
|
|
TAG="${{ inputs.version || github.ref_name }}"
|
|
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Build packages with nfpm
|
2022-11-08 23:45:01 +01:00
|
|
|
env:
|
|
|
|
VERSION: ${{ env.VERSION }}
|
2022-09-27 20:46:37 +02:00
|
|
|
run: yarn package
|
|
|
|
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
discussion_category_name: "📣 Announcements"
|
|
|
|
files: ./release-packages/*
|
|
|
|
|
|
|
|
package-linux-cross:
|
|
|
|
name: Linux cross-compile builds
|
2023-09-28 05:17:47 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-27 20:46:37 +02:00
|
|
|
timeout-minutes: 15
|
2022-11-08 23:45:01 +01:00
|
|
|
needs: npm-version
|
2023-09-28 05:17:47 +02:00
|
|
|
container: "debian:buster"
|
2022-09-27 20:46:37 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- prefix: aarch64-linux-gnu
|
2023-09-28 05:17:47 +02:00
|
|
|
npm_arch: arm64
|
|
|
|
apt_arch: arm64
|
2022-09-27 20:46:37 +02:00
|
|
|
- prefix: arm-linux-gnueabihf
|
2023-09-28 05:17:47 +02:00
|
|
|
npm_arch: armv7l
|
|
|
|
apt_arch: armhf
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
2023-09-28 05:17:47 +02:00
|
|
|
AS: ${{ format('{0}-as', matrix.prefix) }}
|
2022-09-27 20:46:37 +02:00
|
|
|
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
2023-09-28 05:17:47 +02:00
|
|
|
CPP: ${{ format('{0}-cpp', matrix.prefix) }}
|
2022-09-27 20:46:37 +02:00
|
|
|
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
2023-09-28 05:17:47 +02:00
|
|
|
FC: ${{ format('{0}-gfortran', matrix.prefix) }}
|
|
|
|
LD: ${{ format('{0}-ld', matrix.prefix) }}
|
|
|
|
STRIP: ${{ format('{0}-strip', matrix.prefix) }}
|
|
|
|
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
|
|
|
|
TARGET_ARCH: ${{ matrix.apt_arch }}
|
|
|
|
npm_config_arch: ${{ matrix.npm_arch }}
|
|
|
|
# Not building from source results in an x86_64 argon2, as if
|
|
|
|
# npm_config_arch is being ignored.
|
2023-09-26 19:56:45 +02:00
|
|
|
npm_config_build_from_source: true
|
2022-09-27 20:46:37 +02:00
|
|
|
|
2022-09-16 17:14:28 +02:00
|
|
|
steps:
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-27 20:46:37 +02:00
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-09-16 17:14:28 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-09-27 20:46:37 +02:00
|
|
|
|
2023-09-28 05:17:47 +02:00
|
|
|
- name: Install cross-compiler and system dependencies
|
|
|
|
run: |
|
|
|
|
dpkg --add-architecture $TARGET_ARCH
|
|
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
crossbuild-essential-$TARGET_ARCH \
|
|
|
|
libx11-dev:$TARGET_ARCH \
|
|
|
|
libx11-xcb-dev:$TARGET_ARCH \
|
|
|
|
libxkbfile-dev:$TARGET_ARCH \
|
|
|
|
libsecret-1-dev:$TARGET_ARCH \
|
|
|
|
libkrb5-dev:$TARGET_ARCH \
|
|
|
|
ca-certificates \
|
|
|
|
curl wget rsync gettext-base
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Install nfpm
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.local/bin
|
|
|
|
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
- name: Download npm package
|
|
|
|
uses: actions/download-artifact@v3
|
2022-09-16 17:14:28 +02:00
|
|
|
with:
|
2022-11-08 23:45:01 +01:00
|
|
|
name: npm-release-package
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
|
|
|
- name: Build standalone release
|
2023-09-22 09:21:01 +02:00
|
|
|
run: npm run release:standalone
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Replace node with cross-compile equivalent
|
|
|
|
run: |
|
2023-11-14 22:45:56 +01:00
|
|
|
node_version=$(node --version)
|
|
|
|
wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
|
|
|
|
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
|
2022-09-27 20:46:37 +02:00
|
|
|
mv ./node ./release-standalone/lib/node
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
|
|
# i.e. v4.9.1 -> 4.9.1
|
|
|
|
- name: Get and set VERSION
|
|
|
|
run: |
|
|
|
|
TAG="${{ inputs.version || github.ref_name }}"
|
|
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Build packages with nfpm
|
2022-11-08 23:45:01 +01:00
|
|
|
env:
|
|
|
|
VERSION: ${{ env.VERSION }}
|
2023-09-28 05:17:47 +02:00
|
|
|
run: npm run package ${npm_config_arch}
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
discussion_category_name: "📣 Announcements"
|
|
|
|
files: ./release-packages/*
|
|
|
|
|
|
|
|
package-macos-amd64:
|
|
|
|
name: x86-64 macOS build
|
|
|
|
runs-on: macos-latest
|
|
|
|
timeout-minutes: 15
|
2022-11-08 23:45:01 +01:00
|
|
|
needs: npm-version
|
2022-09-27 20:46:37 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2023-10-05 01:50:11 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-27 20:46:37 +02:00
|
|
|
|
2023-11-14 22:45:56 +01:00
|
|
|
- name: Install Node.js
|
2023-11-14 19:23:05 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-09-27 20:46:37 +02:00
|
|
|
with:
|
2023-11-14 22:45:56 +01:00
|
|
|
node-version-file: .node-version
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Install nfpm
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.local/bin
|
|
|
|
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
2023-11-16 20:10:36 +01:00
|
|
|
# The version of node-gyp we use depends on distutils but it was removed
|
|
|
|
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
|
|
|
# next update Node we can probably remove this. For now, install
|
|
|
|
# setuptools since it contains distutils.
|
|
|
|
- name: Install Python utilities
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
- name: Download npm package
|
|
|
|
uses: actions/download-artifact@v3
|
2022-09-27 20:46:37 +02:00
|
|
|
with:
|
2022-11-08 23:45:01 +01:00
|
|
|
name: npm-release-package
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
2022-12-12 23:03:07 +01:00
|
|
|
- name: Build standalone release
|
|
|
|
run: npm run release:standalone
|
2022-09-27 20:46:37 +02:00
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
|
|
|
|
|
|
|
- name: Run native module tests on standalone release
|
|
|
|
run: yarn test:native
|
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
|
|
# i.e. v4.9.1 -> 4.9.1
|
|
|
|
- name: Get and set VERSION
|
|
|
|
run: |
|
|
|
|
TAG="${{ inputs.version || github.ref_name }}"
|
|
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
|
2022-09-27 20:46:37 +02:00
|
|
|
- name: Build packages with nfpm
|
2022-11-08 23:45:01 +01:00
|
|
|
env:
|
|
|
|
VERSION: ${{ env.VERSION }}
|
2022-09-27 20:46:37 +02:00
|
|
|
run: yarn package
|
2022-09-16 17:14:28 +02:00
|
|
|
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
discussion_category_name: "📣 Announcements"
|
|
|
|
files: ./release-packages/*
|
2022-11-01 18:16:30 +01:00
|
|
|
|
|
|
|
npm-package:
|
|
|
|
name: Upload npm package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 15
|
2022-11-08 23:45:01 +01:00
|
|
|
needs: npm-version
|
|
|
|
steps:
|
|
|
|
- name: Download npm package
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: npm-release-package
|
|
|
|
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
discussion_category_name: "📣 Announcements"
|
|
|
|
files: ./package.tar.gz
|
|
|
|
|
|
|
|
npm-version:
|
|
|
|
name: Modify package.json version
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 15
|
2022-11-01 18:16:30 +01:00
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
2024-01-05 23:29:50 +01:00
|
|
|
uses: dawidd6/action-download-artifact@v3
|
2022-11-01 18:16:30 +01:00
|
|
|
id: download
|
|
|
|
with:
|
|
|
|
branch: ${{ github.ref }}
|
|
|
|
workflow: build.yaml
|
|
|
|
workflow_conclusion: completed
|
|
|
|
name: npm-package
|
2022-12-12 18:47:27 +01:00
|
|
|
check_artifacts: false
|
|
|
|
if_no_artifact_found: fail
|
2022-11-01 18:16:30 +01:00
|
|
|
|
2022-11-08 23:45:01 +01:00
|
|
|
- name: Decompress npm package
|
|
|
|
run: tar -xzf package.tar.gz
|
|
|
|
|
|
|
|
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
|
|
# i.e. v4.9.1 -> 4.9.1
|
|
|
|
- name: Get and set VERSION
|
|
|
|
run: |
|
|
|
|
TAG="${{ inputs.version || github.ref_name }}"
|
|
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Modify version
|
|
|
|
env:
|
2022-11-10 21:48:56 +01:00
|
|
|
VERSION: ${{ env.VERSION }}
|
2022-11-08 23:45:01 +01:00
|
|
|
run: |
|
|
|
|
echo "Updating version in root package.json"
|
|
|
|
npm version --prefix release "$VERSION"
|
|
|
|
|
|
|
|
echo "Updating version in lib/vscode/product.json"
|
2023-09-21 01:33:28 +02:00
|
|
|
tmp=$(mktemp)
|
2022-12-07 23:19:20 +01:00
|
|
|
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
2022-12-06 21:28:27 +01:00
|
|
|
# Ensure it has the same permissions as before
|
|
|
|
chmod 644 release/lib/vscode/product.json
|
2022-11-08 23:45:01 +01:00
|
|
|
|
|
|
|
- name: Compress release package
|
|
|
|
run: tar -czf package.tar.gz release
|
|
|
|
|
|
|
|
- name: Upload npm package artifact
|
2024-01-05 23:32:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-11-01 18:16:30 +01:00
|
|
|
with:
|
2022-11-08 23:45:01 +01:00
|
|
|
name: npm-release-package
|
|
|
|
path: ./package.tar.gz
|