Skip to content

Build workflow

Build workflow #12

Workflow file for this run

# This is a basic workflow that is manually triggered
name: Build workflow
on:
workflow_dispatch:
inputs:
source_url:
description: 'Source tarball URL'
default: 'https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release'
required: true
type: string
em_version:
description: 'EMSDK version'
default: '3.1.47'
required: true
type: string
env:
EM_CACHE_FOLDER: 'emsdk-cache'
GH_TOKEN: ${{ github.token }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: overlay
# Install EMSDK
- name: Setup Emscripten
id: cache-system-libraries
uses: actions/cache@v3
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{inputs.em_version}}-${{runner.os}}
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{inputs.em_version}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- run: emcc -v
# Unpack tarball
- name: Unpack tarball
run: curl ${{inputs.source_url}} | tar xzf -
# Overlay files onto SQLite tree
- run: tar -C overlay -cf - . | tar -C sqlite -xvf -
# Build
- name: Build amalgamation
working-directory: ./sqlite
run: ./configure --enable-all && make sqlite3.c
- name: Build wasm
working-directory: ./sqlite/ext/wasm
run: make
# Package
- name: Create release with tarball
run: |
tar -C sqlite/ext/wasm/jswasm -czf - . > ./jswasm.tgz
echo "SQLite ${{inputs.source_url}}" >> NOTES
echo "EMSDK ${{inputs.em_version}}" >> NOTES
gh release create --generate-notes --notes-file NOTES "refs/tags/`date`" ./jswasm.tgz