From 41746d46d8c16c962ec6160d132eca766c6dafe6 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Fri, 22 Dec 2023 09:57:16 +0100 Subject: [PATCH 01/12] feat: arm64 build for bw cli --- .github/workflows/build-cli.yml | 63 +++++++++++++++++++++++++++++++++ apps/cli/package.json | 2 ++ 2 files changed, 65 insertions(+) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index d6f089501a1..181caf524e4 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -147,6 +147,68 @@ jobs: path: apps/cli/dist/bw-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt if-no-files-found: error + cli-arm64: + name: Build CLI Linux arm64 + runs-on: ubuntu-22.04 + needs: + - setup + env: + _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _NODE_VERSION: ${{ needs.setup.outputs.node_version }} + steps: + - name: Checkout repo + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + + - name: Setup Unix Vars + run: | + echo "LOWER_RUNNER_OS=$(echo $RUNNER_OS | awk '{print tolower($0)}')" >> $GITHUB_ENV + echo "SHORT_RUNNER_OS=$(echo $RUNNER_OS | awk '{print substr($0, 1, 3)}' | \ + awk '{print tolower($0)}')" >> $GITHUB_ENV + + - name: Configure binfmt with QEMU User Emulation + run: | + sudo apt install binfmt-support qemu-user-static + update-binfmts --display + + - name: Set up Node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + with: + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + node-version: ${{ env._NODE_VERSION }} + + - name: Install + run: npm ci + working-directory: ./ + + - name: Build & Package Unix + run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet + + - name: Zip Unix + run: | + cd ./dist/${{ env.LOWER_RUNNER_OS }}-arm64 + zip ../bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip ./bw + + - name: Create checksums Unix + run: | + cd ./dist + shasum -a 256 bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip \ + | awk '{split($0, a); print a[1]}' > bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt + + - name: Upload unix zip asset + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip + path: apps/cli/dist/bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip + if-no-files-found: error + + - name: Upload unix checksum asset + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt + path: apps/cli/dist/bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt + if-no-files-found: error + cli-windows: name: Build CLI Windows runs-on: windows-2019 @@ -374,6 +436,7 @@ jobs: - cloc - setup - cli + - cli-arm64 - cli-windows - snap steps: diff --git a/apps/cli/package.json b/apps/cli/package.json index 31e2368392d..2e4c596ff93 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -27,11 +27,13 @@ "package:win": "pkg . --targets win-x64 --output ./dist/windows/bw.exe", "package:mac": "pkg . --targets macos-x64 --output ./dist/macos/bw", "package:lin": "pkg . --targets linux-x64 --output ./dist/linux/bw", + "package:lin:arm64": "pkg . --targets linux-arm64 --output ./dist/linux-arm64/bw", "debug": "node --inspect ./build/bw.js", "dist": "npm run build:prod && npm run clean && npm run package", "dist:win": "npm run build:prod && npm run clean && npm run package:win", "dist:mac": "npm run build:prod && npm run clean && npm run package:mac", "dist:lin": "npm run build:prod && npm run clean && npm run package:lin", + "dist:lin:arm64": "npm run build:prod && npm run clean && npm run package:lin:arm64", "publish:npm": "npm run build:prod && npm publish --access public", "test": "jest", "test:watch": "jest --watch", From 8675b7b084fa72ec9a4993f8db74b17a3b636294 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Tue, 26 Dec 2023 10:27:52 +0100 Subject: [PATCH 02/12] fix: update argon2 to 0.31.2 --- apps/cli/package.json | 2 +- package-lock.json | 10 +++++----- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 2e4c596ff93..432184a7ea2 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -51,7 +51,7 @@ "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "0.31.0", + "argon2": "0.31.2", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", diff --git a/package-lock.json b/package-lock.json index e90ec8f5229..87e52b52941 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@microsoft/signalr": "6.0.25", "@microsoft/signalr-protocol-msgpack": "6.0.25", "@ng-select/ng-select": "10.0.4", - "argon2": "0.31.0", + "argon2": "0.31.2", "argon2-browser": "1.18.0", "big-integer": "1.6.51", "bootstrap": "4.6.0", @@ -202,7 +202,7 @@ "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "0.31.0", + "argon2": "0.31.2", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", @@ -14841,9 +14841,9 @@ "dev": true }, "node_modules/argon2": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.0.tgz", - "integrity": "sha512-r56NWwlE3tjD/FIqL1T+V4Ka+Mb5yMF35w1YWHpwpEjeONXBUbxmjhWkWqY63mse8lpcZ+ZZIGpKL+s+qXhyfg==", + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.2.tgz", + "integrity": "sha512-QSnJ8By5Mth60IEte45w9Y7v6bWcQw3YhRtJKKN8oNCxnTLDiv/AXXkDPf2srTMfxFVn3QJdVv2nhXESsUa+Yg==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.11", diff --git a/package.json b/package.json index 736149bd25a..9bb439b85a6 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "@microsoft/signalr": "6.0.25", "@microsoft/signalr-protocol-msgpack": "6.0.25", "@ng-select/ng-select": "10.0.4", - "argon2": "0.31.0", + "argon2": "0.31.2", "argon2-browser": "1.18.0", "big-integer": "1.6.51", "bootstrap": "4.6.0", From 169533f2ed4e3f13f50df37de4063eeaf422f81f Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 08:23:47 +0100 Subject: [PATCH 03/12] fix: build from source for argon2 --- .github/workflows/build-cli.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 181caf524e4..1ae186fec80 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -155,6 +155,9 @@ jobs: env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} _NODE_VERSION: ${{ needs.setup.outputs.node_version }} + # The only known way to get arm64 argon2 is to build it from sources + npm_config_arch: arm64 + npm_config_build_from_source: true steps: - name: Checkout repo uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 From 844df27c909e136885a68d8a9df9405ddf9f4634 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 10:54:20 +0100 Subject: [PATCH 04/12] fix: target architecture to arm64 --- .github/workflows/build-cli.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 1ae186fec80..f14864d84ce 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -176,6 +176,7 @@ jobs: - name: Set up Node uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: + architecture: arm64 cache: 'npm' cache-dependency-path: '**/package-lock.json' node-version: ${{ env._NODE_VERSION }} From d346063be820b7fc6d45074270f977d008404338 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 10:56:37 +0100 Subject: [PATCH 05/12] Revert "fix: target architecture to arm64" This reverts commit 844df27c909e136885a68d8a9df9405ddf9f4634. --- .github/workflows/build-cli.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index f14864d84ce..1ae186fec80 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -176,7 +176,6 @@ jobs: - name: Set up Node uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: - architecture: arm64 cache: 'npm' cache-dependency-path: '**/package-lock.json' node-version: ${{ env._NODE_VERSION }} From 2524a5a4f92f9b46e536c928befb1147b57122ce Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 11:02:22 +0100 Subject: [PATCH 06/12] tries to use argon2@next --- apps/cli/package.json | 5 ++--- package-lock.json | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 432184a7ea2..1ffb2b8ec70 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -44,14 +44,13 @@ }, "pkg": { "assets": [ - "./build/**/*", - "../../node_modules/argon2/**/*" + "./build/**/*" ] }, "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "0.31.2", + "argon2": "^0.40.0-alpha.1", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", diff --git a/package-lock.json b/package-lock.json index 87e52b52941..34896ba0dbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -202,7 +202,7 @@ "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "0.31.2", + "argon2": "^0.40.0-alpha.1", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", @@ -231,6 +231,30 @@ "bw": "build/bw.js" } }, + "apps/cli/node_modules/argon2": { + "version": "0.40.0-alpha.1", + "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.40.0-alpha.1.tgz", + "integrity": "sha512-ALTWwi81QZpBRHpkTpfti+NhFexyqwjKV/EVbvQflV5p9EC3aWLGlMU5f5QJxWqZZq3WzJ74XoxBfW/T37GT7w==", + "hasInstallScript": true, + "dependencies": { + "@phc/format": "^1.0.0", + "node-addon-api": "^7.0.0", + "node-gyp-build": "^4.7.1" + }, + "engines": { + "node": ">=16.17.0" + } + }, + "apps/cli/node_modules/node-gyp-build": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", + "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, "apps/desktop": { "name": "@bitwarden/desktop", "version": "2023.12.2", From 51c86751c65754b9e20eb1232dfb6206a3b833ee Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 12:13:16 +0100 Subject: [PATCH 07/12] fix: emulated build instead of cross build --- .github/workflows/build-cli.yml | 49 +++++++++++++++++++-------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 1ae186fec80..f766528b47c 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -75,6 +75,7 @@ jobs: cli: + if: false name: Build CLI ${{ matrix.os }} strategy: matrix: @@ -154,10 +155,7 @@ jobs: - setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - _NODE_VERSION: ${{ needs.setup.outputs.node_version }} - # The only known way to get arm64 argon2 is to build it from sources - npm_config_arch: arm64 - npm_config_build_from_source: true + _NODE_VERSION: ${{ needs.setup.outputs.node_version }}.19.0 steps: - name: Checkout repo uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 @@ -168,24 +166,31 @@ jobs: echo "SHORT_RUNNER_OS=$(echo $RUNNER_OS | awk '{print substr($0, 1, 3)}' | \ awk '{print tolower($0)}')" >> $GITHUB_ENV - - name: Configure binfmt with QEMU User Emulation - run: | - sudo apt install binfmt-support qemu-user-static - update-binfmts --display - - - name: Set up Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + - name: Build on arm64 + uses: uraimo/run-on-arch-action@v2 with: - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - node-version: ${{ env._NODE_VERSION }} - - - name: Install - run: npm ci - working-directory: ./ - - - name: Build & Package Unix - run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet + arch: aarch64 + distro: bullseye + githubToken: ${{ github.token }} + setup: mkdir -p "${PWD}/dist" + dockerRunArgs: --volume "${PWD}:/dist" + env: | + _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _NODE_VERSION: ${{ needs.setup.outputs.node_version }} + DEBIAN_FRONTEND: noninteractive + GIT_SAFE_DIR: true + install: | + apt-get update + apt-get install -y -q make g++ xz-utils wget + echo "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" + wget -q "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" + tar --strip 1 -xJf "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" -C /usr/ + rm -f "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" + run: | + uname -a + ls /lib + npm ci + npm run dist:lin:arm64 --quiet - name: Zip Unix run: | @@ -213,6 +218,7 @@ jobs: if-no-files-found: error cli-windows: + if: false name: Build CLI Windows runs-on: windows-2019 needs: @@ -358,6 +364,7 @@ jobs: if-no-files-found: error snap: + if: false name: Build Snap runs-on: ubuntu-22.04 needs: [setup, cli] diff --git a/package-lock.json b/package-lock.json index 34896ba0dbf..d671c5a85cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -188,7 +188,7 @@ }, "engines": { "node": "~18", - "npm": "~9" + "npm": "~10" } }, "apps/browser": { diff --git a/package.json b/package.json index 9bb439b85a6..a8533469966 100644 --- a/package.json +++ b/package.json @@ -221,6 +221,6 @@ }, "engines": { "node": "~18", - "npm": "~9" + "npm": "~10" } } From 8ba981987a2a49f89d354eac2c4a477067cfd4d2 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 15:31:36 +0100 Subject: [PATCH 08/12] Revert "tries to use argon2@next" This reverts commit 2524a5a4f92f9b46e536c928befb1147b57122ce. --- apps/cli/package.json | 5 +++-- package-lock.json | 26 +------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 1ffb2b8ec70..432184a7ea2 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -44,13 +44,14 @@ }, "pkg": { "assets": [ - "./build/**/*" + "./build/**/*", + "../../node_modules/argon2/**/*" ] }, "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "^0.40.0-alpha.1", + "argon2": "0.31.2", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", diff --git a/package-lock.json b/package-lock.json index d671c5a85cf..e836938764a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -202,7 +202,7 @@ "dependencies": { "@koa/multer": "3.0.2", "@koa/router": "12.0.0", - "argon2": "^0.40.0-alpha.1", + "argon2": "0.31.2", "big-integer": "1.6.51", "browser-hrtime": "1.1.8", "chalk": "4.1.2", @@ -231,30 +231,6 @@ "bw": "build/bw.js" } }, - "apps/cli/node_modules/argon2": { - "version": "0.40.0-alpha.1", - "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.40.0-alpha.1.tgz", - "integrity": "sha512-ALTWwi81QZpBRHpkTpfti+NhFexyqwjKV/EVbvQflV5p9EC3aWLGlMU5f5QJxWqZZq3WzJ74XoxBfW/T37GT7w==", - "hasInstallScript": true, - "dependencies": { - "@phc/format": "^1.0.0", - "node-addon-api": "^7.0.0", - "node-gyp-build": "^4.7.1" - }, - "engines": { - "node": ">=16.17.0" - } - }, - "apps/cli/node_modules/node-gyp-build": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", - "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "apps/desktop": { "name": "@bitwarden/desktop", "version": "2023.12.2", From 1a525771a391cdb0414c5e7ad9658f8ae5191268 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 15:31:49 +0100 Subject: [PATCH 09/12] Revert "fix: emulated build instead of cross build" This reverts commit 51c86751c65754b9e20eb1232dfb6206a3b833ee. --- .github/workflows/build-cli.yml | 49 ++++++++++++++------------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index f766528b47c..1ae186fec80 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -75,7 +75,6 @@ jobs: cli: - if: false name: Build CLI ${{ matrix.os }} strategy: matrix: @@ -155,7 +154,10 @@ jobs: - setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - _NODE_VERSION: ${{ needs.setup.outputs.node_version }}.19.0 + _NODE_VERSION: ${{ needs.setup.outputs.node_version }} + # The only known way to get arm64 argon2 is to build it from sources + npm_config_arch: arm64 + npm_config_build_from_source: true steps: - name: Checkout repo uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 @@ -166,31 +168,24 @@ jobs: echo "SHORT_RUNNER_OS=$(echo $RUNNER_OS | awk '{print substr($0, 1, 3)}' | \ awk '{print tolower($0)}')" >> $GITHUB_ENV - - name: Build on arm64 - uses: uraimo/run-on-arch-action@v2 + - name: Configure binfmt with QEMU User Emulation + run: | + sudo apt install binfmt-support qemu-user-static + update-binfmts --display + + - name: Set up Node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: - arch: aarch64 - distro: bullseye - githubToken: ${{ github.token }} - setup: mkdir -p "${PWD}/dist" - dockerRunArgs: --volume "${PWD}:/dist" - env: | - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} - _NODE_VERSION: ${{ needs.setup.outputs.node_version }} - DEBIAN_FRONTEND: noninteractive - GIT_SAFE_DIR: true - install: | - apt-get update - apt-get install -y -q make g++ xz-utils wget - echo "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" - wget -q "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" - tar --strip 1 -xJf "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" -C /usr/ - rm -f "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" - run: | - uname -a - ls /lib - npm ci - npm run dist:lin:arm64 --quiet + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + node-version: ${{ env._NODE_VERSION }} + + - name: Install + run: npm ci + working-directory: ./ + + - name: Build & Package Unix + run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet - name: Zip Unix run: | @@ -218,7 +213,6 @@ jobs: if-no-files-found: error cli-windows: - if: false name: Build CLI Windows runs-on: windows-2019 needs: @@ -364,7 +358,6 @@ jobs: if-no-files-found: error snap: - if: false name: Build Snap runs-on: ubuntu-22.04 needs: [setup, cli] diff --git a/package-lock.json b/package-lock.json index e836938764a..87e52b52941 100644 --- a/package-lock.json +++ b/package-lock.json @@ -188,7 +188,7 @@ }, "engines": { "node": "~18", - "npm": "~10" + "npm": "~9" } }, "apps/browser": { diff --git a/package.json b/package.json index a8533469966..9bb439b85a6 100644 --- a/package.json +++ b/package.json @@ -221,6 +221,6 @@ }, "engines": { "node": "~18", - "npm": "~10" + "npm": "~9" } } From 33803fa4eda8dcd4e4b927c65464461b6336e960 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 15:39:24 +0100 Subject: [PATCH 10/12] override invalid binary with released one --- .github/workflows/build-cli.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 1ae186fec80..c778de4a7f7 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -75,6 +75,7 @@ jobs: cli: + if: false name: Build CLI ${{ matrix.os }} strategy: matrix: @@ -184,6 +185,15 @@ jobs: run: npm ci working-directory: ./ + # argon2-node comes with an ELF binary for host arch, not target arch. + - name: Download argon2-node binary for arm64 + working-directory: ./ + run: | + curl -L -o argon2.tar.gz https://github.com/ranisalt/node-argon2/releases/download/v0.31.2/argon2-v0.31.2-napi-v3-linux-arm64-glibc.tar.gz + tar xvzf argon2.tar.gz + mv napi-v3/argon2.node node_modules/argon2/lib/binding/napi-v3/argon2.node + rm -rf argon2.tar.gz napi-v3 + - name: Build & Package Unix run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet @@ -213,6 +223,7 @@ jobs: if-no-files-found: error cli-windows: + if: false name: Build CLI Windows runs-on: windows-2019 needs: @@ -358,6 +369,7 @@ jobs: if-no-files-found: error snap: + if: false name: Build Snap runs-on: ubuntu-22.04 needs: [setup, cli] From f49d61c6272af163983429b7cff9d0df603243a3 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 15:45:13 +0100 Subject: [PATCH 11/12] cleanup and fix npm version --- .github/workflows/build-cli.yml | 4 ---- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index c778de4a7f7..04d462fe54f 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -75,7 +75,6 @@ jobs: cli: - if: false name: Build CLI ${{ matrix.os }} strategy: matrix: @@ -172,7 +171,6 @@ jobs: - name: Configure binfmt with QEMU User Emulation run: | sudo apt install binfmt-support qemu-user-static - update-binfmts --display - name: Set up Node uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 @@ -223,7 +221,6 @@ jobs: if-no-files-found: error cli-windows: - if: false name: Build CLI Windows runs-on: windows-2019 needs: @@ -369,7 +366,6 @@ jobs: if-no-files-found: error snap: - if: false name: Build Snap runs-on: ubuntu-22.04 needs: [setup, cli] diff --git a/package-lock.json b/package-lock.json index 87e52b52941..e836938764a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -188,7 +188,7 @@ }, "engines": { "node": "~18", - "npm": "~9" + "npm": "~10" } }, "apps/browser": { diff --git a/package.json b/package.json index 9bb439b85a6..a8533469966 100644 --- a/package.json +++ b/package.json @@ -221,6 +221,6 @@ }, "engines": { "node": "~18", - "npm": "~9" + "npm": "~10" } } From 75a872d29bf3b32d9e76e38787b6b0679b31a093 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 27 Dec 2023 15:51:46 +0100 Subject: [PATCH 12/12] grab argon2 version from cli package.json --- .github/workflows/build-cli.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 04d462fe54f..3f501b2a382 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -187,7 +187,9 @@ jobs: - name: Download argon2-node binary for arm64 working-directory: ./ run: | - curl -L -o argon2.tar.gz https://github.com/ranisalt/node-argon2/releases/download/v0.31.2/argon2-v0.31.2-napi-v3-linux-arm64-glibc.tar.gz + ARGON2_VERSION=$(grep '"argon2":' apps/cli/package.json | sed -e 's/.*"argon2": "\(.*\)",/\1/g') + echo "ARGON2_VERSION: ${ARGON2_VERSION}" + curl -L -o argon2.tar.gz "https://github.com/ranisalt/node-argon2/releases/download/v${ARGON2_VERSION}/argon2-v${ARGON2_VERSION}-napi-v3-linux-arm64-glibc.tar.gz" tar xvzf argon2.tar.gz mv napi-v3/argon2.node node_modules/argon2/lib/binding/napi-v3/argon2.node rm -rf argon2.tar.gz napi-v3