Skip to content

Build WASM in CI

Build WASM in CI #1

Workflow file for this run

name: WASM
on: [push, pull_request,repository_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
wasm:
name: Wasm Release
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
# Add commits/tags to build against other DuckDB versions
duckdb_version: [ '<submodule_version>' ]
wasmdep: ['mvp', 'eh', 'threads']
env:
GEN: ninja
steps:
- name: Install required ubuntu packages
run: |
apt-get update -y -qq
apt-get install -y -qq software-properties-common
add-apt-repository ppa:git-core/ppa
apt-get update -y -qq
apt-get install -y -qq ninja-build make gcc-multilib g++-multilib libssl-dev wget openjdk-8-jdk zip maven unixodbc-dev libc6-dev-i386 lib32readline6-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip build-essential checkinstall libffi-dev curl libz-dev openssh-client
- name: Install Git 2.18.5
run: |
wget https://github.com/git/git/archive/refs/tags/v2.18.5.tar.gz
tar xvf v2.18.5.tar.gz
cd git-2.18.5
make
make prefix=/usr install
git --version
- uses: mymindstorm/setup-emsdk@v12
with:
version: 'latest'
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Checkout DuckDB to version
if: ${{ matrix.duckdb_version != '<submodule_version>'}}
run: |
cd duckdb
git checkout ${{ matrix.duckdb_version }}
# Build extension
- name: Build extension
env:
GEN: ninja
WASMDEP: ${{ matrix.wasmdep }}
run: |
make wasm_$WASMDEP
- uses: actions/upload-artifact@v2
with:
name: wasm-${{matrix.wasmdep}}-extensions
path: |
build/wasm_${{matrix.wasmdep}}/psql.duckdb_extension.wasm
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Deploy
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
UPLOAD_BASE_PATH: ${{ secrets.UPLOAD_BASE_PATH }}
run: |
git config --global --add safe.directory '*'
cd duckdb
git fetch --tags
export DUCKDB_VERSION=`git tag --points-at HEAD`
export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`}
cd ..
if [[ "$SSH_HOST" == "" ]] ; then
echo 'No key set, skipping'
elif [[ "$GITHUB_REF" =~ ^(refs/tags/v.+)$ ]] ; then
./scripts/extension-upload.sh psql ${{ github.ref_name }} $DUCKDB_VERSION ${{matrix.wasmdep}} true
elif [[ "$GITHUB_REF" =~ ^(refs/heads/main)$ ]] ; then
./scripts/extension-upload.sh psql `git log -1 --format=%h` $DUCKDB_VERSION ${{matrix.wasmdep}} false
fi