update-sqlite #26
This file contains 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-sqlite | |
on: | |
workflow_dispatch: | |
inputs: | |
year: | |
description: SQLite release year | |
required: true | |
version: | |
description: SQLite version (encoded) | |
required: true | |
jobs: | |
download-and-update: | |
name: Download and update SQLite | |
runs-on: ubuntu-latest | |
env: | |
ENV_YEAR: ${{ github.event.inputs.year }} | |
ENV_VERSION: ${{ github.event.inputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Create new update branch | |
run: git checkout -b sqlite-update-${{ env.ENV_VERSION }} | |
- name: Update download script | |
run: | | |
sed -Ei "s/YEAR=\"[0-9]+\"/YEAR=\"${{ env.ENV_YEAR }}\"/g" ./deps/download.sh | |
sed -Ei "s/VERSION=\"[0-9]+\"/VERSION=\"${{ env.ENV_VERSION }}\"/g" ./deps/download.sh | |
echo "ENV_TRUE_VERSION=$((10#${ENV_VERSION:0:1})).$((10#${ENV_VERSION:1:2})).$((10#${ENV_VERSION:3:2}))" >> $GITHUB_ENV | |
- name: Download, compile and package SQLite | |
run: npm run download | |
- name: Push update branch | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Update SQLite to version ${{ env.ENV_TRUE_VERSION }} | |
branch: sqlite-update-${{ env.ENV_VERSION }} | |
- name: Create new PR | |
uses: repo-sync/pull-request@v2 | |
with: | |
github_token: ${{ secrets.PAT }} | |
source_branch: sqlite-update-${{ env.ENV_VERSION }} | |
pr_title: Update SQLite to version ${{ env.ENV_TRUE_VERSION }} | |
pr_body: This is an automated pull request, updating SQLite to version `${{ env.ENV_TRUE_VERSION }}`. |