SQLite workflow #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: SQLite 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.sqlite | |
# 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.sqlite -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 dist | |
# Package | |
- name: Create release with tarball | |
run: | | |
echo "SQLite ${{inputs.source_url}}" >> NOTES | |
echo "EMSDK ${{inputs.em_version}}" >> NOTES | |
gh release create "v`date +%s`" sqlite/ext/wasm/*.zip --generate-notes --notes-file NOTES |