Skip to content

Commit 382c481

Browse files
added releases action
1 parent 10f430b commit 382c481

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/release.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This triggers whenever a tagged release is pushed
2+
name: Compile Assets and Create Draft Release
3+
4+
on:
5+
push:
6+
tags:
7+
# Trigger on tags beginning with 'v'
8+
- 'v*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write # Needed to create releases
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Need to fetch the tags
21+
22+
- uses: dart-lang/setup-dart@v1
23+
24+
- name: Install dependencies
25+
run: dart pub get
26+
27+
- name: Compile WebWorker
28+
run: dart compile js -o assets/db_worker.js -O0 lib/src/web/worker/worker.dart
29+
30+
- name: Set tag name
31+
id: tag
32+
run: |
33+
tag=$(basename "${{ github.ref }}")
34+
echo "tag=$tag" >> $GITHUB_OUTPUT
35+
36+
- name: Create Release
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
GH_REPO: ${{ github.repository }}
40+
run: |
41+
tag="${{ steps.tag.outputs.tag }}"
42+
body="Release $tag"
43+
gh release create --draft "$tag" --title "$tag" --notes "$body"
44+
45+
- name: Upload Worker
46+
env:
47+
GH_TOKEN: ${{ github.token }}
48+
GH_REPO: ${{ github.repository }}
49+
run: |
50+
gh release upload "${{ steps.tag.outputs.tag }}" assets/db_worker.js

DEVELOPING.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ Running tests for the `web` platform requires some preparation to be executed. T
77
See the [test action](./.github/workflows/test.yaml) for the latest steps.
88

99
On your local machine run the commands from the `Install SQLite`, `Compile WebWorker` and `Run Tests` steps.
10+
11+
## Releases
12+
13+
Web worker files are compiled and uploaded to draft Github releases whenever tags matching `v*` are pushed. These tags are created when versioning. Releases should be manually finalized and published when releasing new package versions.

0 commit comments

Comments
 (0)