Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 59 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,45 @@ permissions:
contents: read

jobs:
# For now we build only for linux x86_64
# We can later add more targets as a separate jobs on a different architectures
build-x86_64-unknown-linux-gnu:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: npm run build -- --target x86_64-unknown-linux-gnu
name: build for release stable - ${{ matrix.settings.target }}
files: |
index.linux-x64-gnu.node
index.d.ts
index.js
- host: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
build: npm run build -- --target aarch64-unknown-linux-gnu
files: |
index.linux-arm64-gnu.node
name: Build for release stable - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/setup
with:
node-version: 24
host: ubuntu-latest
target: x86_64-unknown-linux-gnu
host: ${{ matrix.settings.host }}
target: ${{ matrix.settings.target }}
- name: Install libraries for linking
run: sudo apt-get install -y libssl-dev
- name: Build
run: sudo apt-get install -y libssl-dev
- name: Build ${{ matrix.settings.target }}
run: ${{ matrix.settings.build }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v5
- name: Upload artifact - ${{ matrix.settings.target }}
uses: actions/upload-artifact@v6
with:
name: bindings-x86_64-unknown-linux-gnu
path: |
index.linux-x64-gnu.node
index.d.ts
index.js
name: bindings-${{ matrix.settings.target }}
path: ${{ matrix.settings.files }}
if-no-files-found: error
test-x86_64-unknown-linux-gnu:
needs:
- build-x86_64-unknown-linux-gnu
- build
name: test built package - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
Expand All @@ -61,7 +64,6 @@ jobs:
with:
name: bindings-x86_64-unknown-linux-gnu
- name: Install dependencies
shell: bash
run: npm i
- name: Install ccm
# We need a copy of the repo for the ssl tests.
Expand All @@ -76,9 +78,47 @@ jobs:
CCM_IS_SCYLLA: "true"
CCM_PATH: "./scylla-ccm"
run: npm run integration
# We test examples only on aarch64, as we cannot run integration test on this platform
# (For more information see MAINTENANCE.md, section Integration tests).
test-aarch64-unknown-linux-gnu-examples:
needs:
- build
name: test examples - aarch64-unknown-linux-gnu - node@24
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v5
with:
node-version: 24
- name: Install dependencies
run: npm i
- name: Download artifact
uses: actions/download-artifact@v6
with:
merge-multiple: true
- name: Setup 3-node Scylla cluster
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker compose -f .github/docker-compose.yml up -d --wait
- name: Install examples dependencies
run: |
cd examples
npm i
- name: Run all examples
run: SCYLLA_URI=172.42.0.2:9042 npm run examples
- name: Stop the cluster
if: ${{ always() }}
run: docker compose -f .github/docker-compose.yml stop
- name: Print the cluster logs
if: ${{ always() }}
run: docker compose -f .github/docker-compose.yml logs
- name: Remove cluster
if: ${{ always() }}
run: docker compose -f .github/docker-compose.yml down
publish:
needs:
- test-x86_64-unknown-linux-gnu
- test-aarch64-unknown-linux-gnu-examples
name: Publish
runs-on: ubuntu-latest
permissions:
Expand All @@ -92,7 +132,6 @@ jobs:
registry-url: "https://registry.npmjs.org"
cache: npm
- name: Install dependencies
shell: bash
run: npm i
# This creates the directories for subpackage for specific platforms
- name: create npm dirs
Expand All @@ -101,13 +140,13 @@ jobs:
uses: actions/download-artifact@v6
with:
path: artifacts
merge-multiple: true
# Copies the downloaded artifacts to proper places in the npm package directories
- name: Move artifacts
run: npm run artifacts
# Not necessary for the release, but useful for debugging in case some binaries are missing
- name: List packages
run: ls -R ./npm
shell: bash
- name: Copy index files
run: cp ./artifacts/index.js ./artifacts/index.d.ts .
# napi artifacts copies binaries both to specific platform directories and the main directory
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"napi": {
"binary-name": "scylladb-driver-alpha",
"targets": [
"x86_64-unknown-linux-gnu"
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu"
]
},
"repository": {
Expand Down
Loading