Skip to content

Commit

Permalink
fixing the musl release issues
Browse files Browse the repository at this point in the history
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
  • Loading branch information
avifenesh committed Oct 23, 2024
1 parent 0a11fde commit d066c7b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 28 deletions.
10 changes: 7 additions & 3 deletions .github/json_matrices/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@
"RUNNER": "macos-latest",
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin",
"PACKAGE_MANAGERS": ["pypi", "npm", "maven"]
"PACKAGE_MANAGERS": [
"pypi",
"npm",
"maven"
]
},
{
"OS": "ubuntu",
"NAMED_OS": "linux",
"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"]
},
Expand All @@ -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"]
}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down Expand Up @@ -119,18 +119,18 @@ 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 }}"
always-auth: true
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/
Expand Down Expand Up @@ -181,11 +181,16 @@ jobs:
working-directory: ./node
run: |
npm pkg fix
echo "Before publishing:"
echo "Current directory: $(pwd)"
echo "Contents of ./node/build-ts/src/:"
ls -la ./
ls -la ./build-ts/src/
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"
Expand All @@ -203,8 +208,11 @@ jobs:
if: ${{ matrix.build.ARCH == 'arm64' }}
shell: bash
run: |
git reset --hard
echo "Resetting repository"
git clean -xdf
git reset --hard
git fetch
git checkout ${{ github.sha }}
publish-base-to-npm:
if: github.event_name != 'pull_request'
Expand All @@ -218,9 +226,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
Expand Down Expand Up @@ -336,10 +344,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 }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/setup-musl-on-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,10 +43,10 @@ runs:
shell: bash
run: |
git config --global --add safe.directory "${{ inputs.workspace }}"
git fetch origin ${{ github.sha }}
git checkout ${{ github.sha }}
git clean -xdf
git reset --hard
git submodule sync
git submodule update --init --recursive
- name: Set up access for musl on ARM
shell: bash
Expand Down

0 comments on commit d066c7b

Please sign in to comment.