-
Notifications
You must be signed in to change notification settings - Fork 15
66 lines (56 loc) · 1.86 KB
/
release.yml
File metadata and controls
66 lines (56 loc) · 1.86 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
59
60
61
62
63
64
65
66
# This triggers whenever a tagged release is pushed
name: Release packages
on:
push:
tags:
- 'sqlite_async-v[0-9]+.[0-9]+.[0-9]+*'
- 'drift_sqlite_async-v[0-9]+.[0-9]+.[0-9]+*'
jobs:
gh_release:
runs-on: ubuntu-latest
if: "${{ startsWith(github.ref_name, 'sqlite_async-') }}"
permissions:
contents: write # Needed to create releases
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need to fetch the tags
- uses: dart-lang/setup-dart@v1
- name: Compile web worker
run: |
dart pub get
dart compile js -O4 -o assets/db_worker.js packages/sqlite_async/lib/src/web/worker/worker.dart
- name: Set tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
tag="${{ steps.tag.outputs.tag }}"
body="Release $tag"
gh release create --draft "$tag" --title "$tag" --notes "$body"
- name: Upload Worker
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release upload "${{ steps.tag.outputs.tag }}" assets/db_worker.js
publish_sqlite_async:
permissions:
id-token: write
if: "${{ startsWith(github.ref_name, 'sqlite_async-') }}"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: packages/sqlite_async/
publish_drift_sqlite_async:
permissions:
id-token: write
if: "${{ startsWith(github.ref_name, 'drift_sqlite_async-') }}"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: packages/drift_sqlite_async/