Skip to content

ci

ci #1

Workflow file for this run

name: ci
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag: <upstream version>-bwa.<release index> (e.g., v0.1.3-bwa.5)"
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sqlc-dev/setup-sqlc@v4
with:
sqlc-version: '1.24.0'
- uses: actions/setup-node@v4
- run: wget https://github.com/bytecodealliance/javy/releases/download/v1.2.0/javy-x86_64-linux-v1.2.0.gz
- run: gzip -d javy-x86_64-linux-v1.2.0.gz
- run: chmod +x javy-x86_64-linux-v1.2.0
- run: npm install
- run: npx tsc --noEmit
- run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
- run: ./javy-x86_64-linux-v1.2.0 compile out.js -o examples/plugin.wasm
- run: sqlc -f sqlc.dev.yaml diff
working-directory: examples
- run: sha256sum examples/plugin.wasm | awk '{print $1}' > examples/plugin.wasm.sha256
- run: |
set -euo pipefail
sha=$(cat examples/plugin.wasm.sha256)
url="https://github.com/blue-water-autonomy/sqlc-gen-typescript/releases/download/${{ inputs.tag }}/plugin.wasm"
{
echo "# Configuration"
echo "```"
echo "version: '2'"
echo "plugins:"
echo "- name: ts"
echo " wasm:"
echo " url: ${url}"
echo " sha256: ${sha}"
echo "```"
} > RELEASE_NOTES.txt
- env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ inputs.tag }}" \
examples/plugin.wasm \
examples/plugin.wasm.sha256 \
--title "${{ inputs.tag }}" \
--notes-file RELEASE_NOTES.txt