Skip to content

0.5.26

0.5.26 #174

Workflow file for this run

name: CI
on:
push:
branches:
- v0.5
tags:
- 'v*'
permissions:
contents: write
id-token: write
jobs:
test:
name: Integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- run: cd integration-tests && npm ci && npm run test
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-14-xlarge
target: aarch64-apple-darwin
- host: macos-14-large
target: x86_64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: true
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: true
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
use-cross: true
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
use-cross: true
- host: ubuntu-latest
target: arm-unknown-linux-gnueabihf
use-cross: true
- host: ubuntu-latest
target: arm-unknown-linux-musleabihf
use-cross: true
name: Build - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
- name: Setup cmake
if: ${{ matrix.settings.use-cross }}
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.18.x'
- name: Install cross
if: ${{ matrix.settings.use-cross }}
run: cargo install cross --locked
- name: Add msbuild to PATH
if: ${{ matrix.settings.target == 'x86_64-pc-windows-msvc' }}
uses: microsoft/setup-msbuild@v2
- name: Install dependencies
run: npm ci
- name: Build (native)
if: ${{ !matrix.settings.use-cross }}
run: cargo build --message-format=json --release --target ${{ matrix.settings.target }} | npx neon dist --name libsql-js
shell: bash
- name: Build (cross)
if: ${{ matrix.settings.use-cross }}
run: cross build --message-format=json --release --target ${{ matrix.settings.target }} | npx neon dist --name libsql-js -m /target
shell: bash
- name: Pack platform package
run: npx neon pack-build -t ${{ matrix.settings.target }} -o dist
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: dist/*.tgz
if-no-files-found: error
publish:
name: Publish
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: npm install -g npm@11
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
run: npx tsc
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List packages
run: ls -R artifacts/
shell: bash
- name: Publish
run: |
TAG_ARGS=""
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
echo "Publishing stable release"
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
echo "Publishing pre-release"
TAG_ARGS="--tag next"
else
echo "Not a release, skipping publish"
exit 0
fi
# Publish platform packages first
for dir in artifacts/bindings-*; do
for tgz in "$dir"/*.tgz; do
if [ -f "$tgz" ]; then
echo "Publishing $tgz..."
npm publish "$tgz" --access public --provenance $TAG_ARGS
fi
done
done
# Publish main package
npm publish --access public --provenance $TAG_ARGS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}