-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.61 KB
/
web_sqlite.yml
File metadata and controls
43 lines (41 loc) · 1.61 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
name: "Update web sqlite3 wasm version"
on:
schedule:
- cron: '0 0 23 * *'
workflow_dispatch:
jobs:
update_wasm:
name: Update web sqlite version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get latest commit data
id: commit
run: |
COMMITS=$(curl -s "https://api.github.com/repos/tekartik/sqflite/commits?path=packages_web%2Fsqflite_common_ffi_web%2Flib%2Fsrc%2Fsetup&page=1&per_page=1")
echo "name=$(echo $COMMITS | jq -r '.[0].commit.author.name')" >> $GITHUB_OUTPUT
echo "mail=$(echo $COMMITS | jq -r '.[0].commit.author.email')" >> $GITHUB_OUTPUT
MONTHS=0
if ${{ github.event_name == 'schedule' }}
then
MONTHS=$(echo $COMMITS | jq -r "((now - (.[0].commit.committer.date | fromdateiso8601) ) / (60*60*24*31) | trunc)")
fi
echo "months=$MONTHS" >> $GITHUB_OUTPUT
- uses: subosito/flutter-action@v2
if: steps.commit.output.months == 0
with:
cache: true
channel: beta
- name: Run sqlite_common_ffi_web setup
if: steps.commit.output.months == 0
run: dart run sqflite_common_ffi_web:setup --force
# Commit all changed files back to the repository
- uses: stefanzweifel/git-auto-commit-action@v4
if: steps.commit.output.months == 0
with:
commit_message: Updated web sqlite
commit_author: ${{ steps.commit.outputs.name }} <${{ steps.commit.outputs.mail }}>
file_pattern: '*.js *.wasm'