-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (45 loc) · 1.78 KB
/
release.yml
File metadata and controls
58 lines (45 loc) · 1.78 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
50
51
52
53
54
55
56
57
58
name: Release
on:
workflow_dispatch:
permissions: write-all
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Build plugin
working-directory: plugin
run: GOOS=wasip1 GOARCH=wasm go build -o ../sqlc-gen-better-python.wasm
- name: Get the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest
- name: Create tag
run: |
git tag ${{ steps.latest.outputs.output }}
git push origin ${{ steps.latest.outputs.output }}
- name: Generate release description
run: |
export checksum=$(sha256sum sqlc-gen-better-python.wasm | awk '{print $1}')
export download_url="https://github.com/rayakame/sqlc-gen-better-python/releases/download/${{ steps.latest.outputs.output }}/sqlc-gen-better-python.wasm"
yq -i '.plugins[0].wasm.url = env(download_url)' .github/release_output_template.yaml
yq -i '.plugins[0].wasm.sha256 = env(checksum)' .github/release_output_template.yaml
cat .changes/${{ steps.latest.outputs.output }}.md >> release_body.md
echo "\`\`\`yaml" > release_body.md
cat .github/release_output_template.yaml >> release_body.md
echo "\`\`\`" >> release_body.md
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: "${{ steps.latest.outputs.output }}"
tag_name: "refs/tags/${{ steps.latest.outputs.output }}"
body_path: release_body.md
files: sqlc-gen-better-python.wasm