From ea1018c52bf71213b3f8ec1e7a2de882e5a57a53 Mon Sep 17 00:00:00 2001 From: avifenesh Date: Tue, 22 Oct 2024 21:09:03 +0000 Subject: [PATCH] fixing the musl release issues Signed-off-by: avifenesh --- .github/json_matrices/build-matrix.json | 10 ++++--- .github/workflows/node.yml | 10 +++---- .github/workflows/npm-cd.yml | 27 ++++++++++--------- .github/workflows/ort.yml | 4 +-- .github/workflows/pypi-cd.yml | 2 +- .../workflows/setup-musl-on-linux/action.yml | 7 ++--- 6 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/json_matrices/build-matrix.json b/.github/json_matrices/build-matrix.json index 45ac7a57f3..02a6187142 100644 --- a/.github/json_matrices/build-matrix.json +++ b/.github/json_matrices/build-matrix.json @@ -30,7 +30,11 @@ "RUNNER": "macos-latest", "ARCH": "arm64", "TARGET": "aarch64-apple-darwin", - "PACKAGE_MANAGERS": ["pypi", "npm", "maven"] + "PACKAGE_MANAGERS": [ + "pypi", + "npm", + "maven" + ] }, { "OS": "ubuntu", @@ -38,7 +42,7 @@ "ARCH": "arm64", "TARGET": "aarch64-unknown-linux-musl", "RUNNER": ["self-hosted", "Linux", "ARM64"], - "IMAGE": "node:alpine", + "IMAGE": "node:current-alpine", "CONTAINER_OPTIONS": "--user root --privileged --rm", "PACKAGE_MANAGERS": ["npm"] }, @@ -48,7 +52,7 @@ "ARCH": "x64", "TARGET": "x86_64-unknown-linux-musl", "RUNNER": "ubuntu-latest", - "IMAGE": "node:alpine", + "IMAGE": "node:current-alpine", "CONTAINER_OPTIONS": "--user root --privileged", "PACKAGE_MANAGERS": ["npm"] } diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index a9b6b4be18..179b97d5a4 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -70,10 +70,10 @@ jobs: with: submodules: recursive - - name: Use Node.js 16.x - uses: actions/setup-node@v3 + - name: Use Node.js 22.x + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 22.x - name: Build Node wrapper uses: ./.github/workflows/build-node-wrapper @@ -290,10 +290,10 @@ jobs: with: submodules: recursive - - name: Use Node.js 18.x + - name: Use Node.js 22.x uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 22.x - name: Build Node wrapper uses: ./.github/workflows/build-node-wrapper diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 3788d87e04..876dc5e4f5 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -79,12 +79,12 @@ jobs: if: ${{ contains(matrix.build.RUNNER, 'self-hosted') && matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide - # For MUSL on X64 we need to install git since we use the checkout action - - name: Install git for musl + # For MUSL on X86 we need to install git since we use the checkout action + - name: Install git and node for musl if: ${{ contains(matrix.build.TARGET, 'x86_64-unknown-linux-musl')}} run: | apk update - apk add git + apk add git - name: Checkout if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} @@ -119,10 +119,10 @@ jobs: INPUT_VERSION: ${{ github.event.inputs.version }} - name: Setup node - if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} - uses: actions/setup-node@v3 + if: ${{ !contains(matrix.build.TARGET, 'musl') }} + uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "22.x" registry-url: "https://registry.npmjs.org" architecture: ${{ matrix.build.ARCH }} scope: "${{ vars.NPM_SCOPE }}" @@ -130,7 +130,7 @@ jobs: token: ${{ secrets.NPM_AUTH_TOKEN }} - name: Setup node for publishing - if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-musl' }} + if: ${{ !contains(matrix.build.TARGET, 'musl') }} working-directory: ./node run: | npm config set registry https://registry.npmjs.org/ @@ -181,11 +181,12 @@ jobs: working-directory: ./node run: | npm pkg fix + cat package.json set +e # 2>&1 1>&3- redirects stderr to stdout and then redirects the original stdout to another file descriptor, # effectively separating stderr and stdout. The 3>&1 at the end redirects the original stdout back to the console. # https://github.com/npm/npm/issues/118#issuecomment-325440 - ignoring notice messages since currentlly they are directed to stderr - { npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3- | grep -v "notice") ;} 3>&1 + { npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3- | grep -Ev "notice|ExperimentalWarning") ;} 3>&1 if [[ "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]] then echo "Skipping publishing, package already published" @@ -218,9 +219,9 @@ jobs: submodules: "true" - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "22.x" registry-url: "https://registry.npmjs.org" scope: "${{ vars.NPM_SCOPE }}" always-auth: true @@ -336,10 +337,10 @@ jobs: arch: ${{ matrix.build.ARCH }} - name: Setup node - if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} - uses: actions/setup-node@v3 + if: ${{ !contains(matrix.build.TARGET, 'musl') }} + uses: actions/setup-node@v4 with: - node-version: "16" + node-version: "22.x" registry-url: "https://registry.npmjs.org" architecture: ${{ matrix.build.ARCH }} scope: "${{ vars.NPM_SCOPE }}" diff --git a/.github/workflows/ort.yml b/.github/workflows/ort.yml index fcea61ee6b..9394c06bf8 100644 --- a/.github/workflows/ort.yml +++ b/.github/workflows/ort.yml @@ -102,10 +102,10 @@ jobs: ### NodeJS ### - - name: Set up Node.js 16.x + - name: Set up Node.js 22.x uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 22.x - name: Create package.json file for the Node wrapper uses: ./.github/workflows/node-create-package-file diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index e69343f234..b0bd2669bc 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -118,7 +118,7 @@ jobs: if: startsWith(matrix.build.NAMED_OS, 'darwin') run: | brew update - brew install python@3.8 python@3.9 + brew install python@3.9 - name: Setup Python for self-hosted Ubuntu runners if: contains(matrix.build.OS, 'ubuntu') && contains(matrix.build.RUNNER, 'self-hosted') diff --git a/.github/workflows/setup-musl-on-linux/action.yml b/.github/workflows/setup-musl-on-linux/action.yml index ed4677b74a..a4816383a1 100644 --- a/.github/workflows/setup-musl-on-linux/action.yml +++ b/.github/workflows/setup-musl-on-linux/action.yml @@ -29,7 +29,8 @@ runs: shell: sh run: | apk update - apk add bash git sed python3 + apk add bash git sed python3 npm + npm install -g npm@latest - name: Skip all steps if not on ARM64 shell: bash @@ -44,8 +45,8 @@ runs: git config --global --add safe.directory "${{ inputs.workspace }}" git clean -xdf git reset --hard - git submodule sync - git submodule update --init --recursive + git checkout ${{ github.sha }} + git pull - name: Set up access for musl on ARM shell: bash