-
Notifications
You must be signed in to change notification settings - Fork 24
54 lines (48 loc) · 1.76 KB
/
release.yml
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
# This triggers whenever a tagged release is pushed
name: Compile Assets and Create Draft Release
on:
push:
tags:
- 'powersync-v[0-9]+.[0-9]+.[0-9]+'
jobs:
setup:
uses: ./.github/workflows/prepare_wasm.yml
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- name: Create Draft Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
tag="${{ github.ref_name }}"
version="${tag#powersync-v}"
changes=$(awk "/## $version/{flag=1;next}/##/{flag=0}flag" packages/powersync/CHANGELOG.md)
body="Release $tag
$changes"
gh release create "$tag" --title "$tag" --notes "$body"
gh release upload "${{ github.ref_name }}" packages/powersync/assets/powersync_db.worker.js packages/powersync/assets/powersync_sync.worker.js packages/sqlite3_wasm_build/dist/*.wasm
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
run_install: false
version: 10
- name: Add NPM auth
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
- name: Publish npm package with WASM files
working-directory: packages/sqlite3_wasm_build
run: |
pnpm i
npm version --allow-same-version --no-git-tag-version $(echo $GITHUB_REF_NAME | sed -E 's/powersync-v//')
pnpm publish --no-git-checks --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}