Update web sqlite3 wasm version #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |