forked from sqlc-dev/sqlc-gen-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (49 loc) · 1.75 KB
/
ci.yml
File metadata and controls
49 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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: |
set -euo pipefail
sha=$(sha256sum examples/plugin.wasm | awk '{print $1}')
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:
# Fine-grained personal access token with access only to this repository, Permissions: "Contents, Access: Read and Write"
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: |
gh release create "${{ inputs.tag }}" \
examples/plugin.wasm \
--title "${{ inputs.tag }}" \
--notes-file RELEASE_NOTES.txt