Skip to content

Commit ee948ef

Browse files
authored
Merge pull request #4 from reload/release
release
2 parents 09efc05 + 6b9f565 commit ee948ef

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ jobs:
1313
with:
1414
sqlc-version: '1.24.0'
1515
- uses: actions/setup-node@v4
16-
- run: wget https://github.com/bytecodealliance/javy/releases/download/v1.2.0/javy-x86_64-linux-v1.2.0.gz
17-
- run: gzip -d javy-x86_64-linux-v1.2.0.gz
18-
- run: chmod +x javy-x86_64-linux-v1.2.0
19-
- run: npm install
20-
- run: npx tsc --noEmit
21-
- run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
22-
- run: ./javy-x86_64-linux-v1.2.0 compile out.js -o examples/plugin.wasm
23-
- run: sqlc -f sqlc.dev.yaml diff
24-
working-directory: examples
16+
- name: Build
17+
run: |
18+
make generate
2519
- uses: actions/upload-artifact@v4
2620
with:
2721
name: plugin

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Release
3+
on:
4+
workflow_run:
5+
workflows: ["ci", "examples"]
6+
branches: [main]
7+
types:
8+
- completed
9+
permissions:
10+
contents: write
11+
jobs:
12+
release:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- name: Build project
19+
run: |
20+
make examples/plugin.wasm
21+
- name: Bump version and push tag
22+
uses: anothrNick/[email protected]
23+
id: version
24+
env:
25+
GITHUB_TOKEN: ${{ github.token }}
26+
WITH_V: true
27+
DEFAULT_BUMP: patch
28+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
29+
RELEASE_BRANCHES: main
30+
- name: Create release
31+
id: create_release
32+
uses: actions/github-script@v8
33+
if: ${{ steps.version.outputs.new_tag }}
34+
env:
35+
RELEASE_TAG: ${{ steps.version.outputs.new_tag }}
36+
with:
37+
script: |
38+
try {
39+
await github.rest.repos.createRelease({
40+
draft: false,
41+
generate_release_notes: true,
42+
name: process.env.RELEASE_TAG,
43+
owner: context.repo.owner,
44+
prerelease: false,
45+
repo: context.repo.repo,
46+
tag_name: process.env.RELEASE_TAG,
47+
});
48+
} catch (error) {
49+
core.setFailed(error.message);
50+
}
51+
- name: Upload Release Asset
52+
id: upload-release-asset
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
58+
asset_path: ./examples/plugin.wasm
59+
asset_name: plugin.wasm
60+
asset_content_type: application/wasm

0 commit comments

Comments
 (0)