Skip to content

Commit

Permalink
Add s390x cpu support to install.js and CI (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
kun-lu20 committed Jun 1, 2023
1 parent bcb5053 commit c123b59
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
47 changes: 46 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,51 @@ jobs:
echo "Binary not found at $BIN"
exit 1
fi
build_s390x:
name: Build s390x
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["16", "18", "19", "20"]
steps:
- uses: actions/checkout@v2
- uses: uraimo/run-on-arch-action@v2.1.1
name: Verify install
id: build
with:
arch: s390x
distro: ubuntu20.04
env: | # this is just so we can cache each version
GITHUB_WORKFLOW: ${{ github.workflow }}-${{ github.job }}-${{ matrix.node }}
dockerRunArgs: |
--volume "$PWD:/app"
githubToken: ${{ github.token }}
install: |
set -euo pipefail
apt-get update
apt-get -y install xz-utils curl libnss3
curl -fsSL --output sha https://nodejs.org/dist/latest-v${{ matrix.node }}.x/SHASUMS256.txt
FULL_FILE=`grep 'node-v${{ matrix.node }}.*-linux-s390x.tar.gz' sha | tr -s ' ' | cut -d' ' -f2`
NODE_VERSION=`echo $FULL_FILE | grep --color=never -Eo '[0-9]{2,}\.[0-9]{1,}\.[0-9]{1,}'`
echo "Node version is $NODE_VERSION"
ARCH=s390x
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz"
tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner
rm sha
rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz"
npm install -g npm@latest
run: |
node --version
npm --version
cd /app
npm ci --no-progress
BIN="./lib/chromedriver/chromedriver"
if ! [ -e $BIN ]; then
echo "Binary not found at $BIN"
exit 1
fi
build_proxy:
name: Build with proxy
Expand Down Expand Up @@ -141,7 +186,7 @@ jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: [build, build_arm64, build_proxy]
needs: [build, build_arm64, build_s390x, build_proxy]
if: success() && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion install.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function validatePlatform() {
/** @type string */
let thePlatform = process.platform;
if (thePlatform === 'linux') {
if (process.arch === 'arm64' || process.arch === 'x64') {
if (process.arch === 'arm64' || process.arch === 's390x' || process.arch === 'x64') {
thePlatform += '64';
} else {
console.log('Only Linux 64 bits supported.');
Expand Down

0 comments on commit c123b59

Please sign in to comment.