Skip to content

Commit 5040d55

Browse files
committed
Add release workflow
1 parent 6f724ba commit 5040d55

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: ci
22
on:
3-
push:
4-
branches:
5-
- main
6-
pull_request:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: "Release tag: <upstream version>-bwa.<release index> (e.g., v0.1.3-bwa.5)"
7+
required: true
8+
type: string
79
jobs:
810
build:
911
runs-on: ubuntu-latest
@@ -21,4 +23,28 @@ jobs:
2123
- run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
2224
- run: ./javy-x86_64-linux-v1.2.0 compile out.js -o examples/plugin.wasm
2325
- run: sqlc -f sqlc.dev.yaml diff
24-
working-directory: examples
26+
working-directory: examples
27+
- run: sha256sum examples/plugin.wasm | awk '{print $1}' > examples/plugin.wasm.sha256
28+
- run: |
29+
set -euo pipefail
30+
sha=$(cat examples/plugin.wasm.sha256)
31+
url="https://github.com/blue-water-autonomy/sqlc-gen-typescript/releases/download/${{ inputs.tag }}/plugin.wasm"
32+
{
33+
echo "# Configuration"
34+
echo "```"
35+
echo "version: '2'"
36+
echo "plugins:"
37+
echo "- name: ts"
38+
echo " wasm:"
39+
echo " url: ${url}"
40+
echo " sha256: ${sha}"
41+
echo "```"
42+
} > RELEASE_NOTES.txt
43+
- env:
44+
GH_TOKEN: ${{ github.token }}
45+
run: |
46+
gh release create "${{ inputs.tag }}" \
47+
examples/plugin.wasm \
48+
examples/plugin.wasm.sha256 \
49+
--title "${{ inputs.tag }}" \
50+
--notes-file RELEASE_NOTES.txt

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This repository is a fork of the upstream
66
[sqlc-dev/sqlc-gen-typescript](https://github.com/sqlc-dev/sqlc-gen-typescript)
77
plugin to fix bugs and tweak it to fit our TypeScript/ESLint rules.
88

9+
To release a new version, run the manual `release` workflow in GitHub Actions.
10+
911
> [!CAUTION]
1012
> Here be dragons! This plugin is still in early access. Expect breaking changes, missing functionality, and sub-optimal output. Please report all issues and errors. Good luck!
1113

0 commit comments

Comments
 (0)