This repository was archived by the owner on Mar 14, 2026. It is now read-only.
Update SQLite #687
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 SQLite | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| name: Check for updates | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Get latest SQLite version | |
| run: | | |
| CSV="$(wget -q https://sqlite.org/download.html -O - | grep -E 'sqlite-amalgamation-[0-9]+\.zip,')" | |
| VERSION="$(echo "${CSV}" | awk -F, '{print $2}')" | |
| URL="https://sqlite.org/$(echo "${CSV}" | awk -F, '{print $3}')" | |
| HASH="$(echo "${CSV}" | awk -F, '{print $5}')" | |
| echo "NEW_VERSION=${VERSION}" >> "${GITHUB_ENV}" | |
| echo "NEW_URL=${URL}" >> "${GITHUB_ENV}" | |
| echo "NEW_HASH=${HASH}" >> "${GITHUB_ENV}" | |
| echo "ℹ️ SQLite ${VERSION} is available at ${URL} with SHA3-256 hash ${HASH}." | |
| - name: Update CMakeLists.txt | |
| run: | | |
| CURRENT_VERSION=$(grep -oP 'set\(SQLITE3_VERSION "\K[^"]+' CMakeLists.txt) | |
| echo "ℹ️ Current version is ${CURRENT_VERSION}." | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> "${GITHUB_ENV}" | |
| echo "Current version: ${CURRENT_VERSION}" >> "${GITHUB_STEP_SUMMARY}" | |
| echo "New version: ${NEW_VERSION} (available at ${NEW_URL} with SHA3-256 hash ${NEW_HASH})" >> "${GITHUB_STEP_SUMMARY}" | |
| if [ "${CURRENT_VERSION}" != "${NEW_VERSION}" ]; then | |
| sed -i "s/set(SQLITE3_VERSION \"${CURRENT_VERSION}\")/set(SQLITE3_VERSION \"${NEW_VERSION}\")/" CMakeLists.txt | |
| sed -i "s!set(SQLITE3_DOWNLOAD_URL \".*\")!set(SQLITE3_DOWNLOAD_URL \"${NEW_URL}\")!" CMakeLists.txt | |
| sed -i "s/set(SQLITE3_SHA3_256 \".*\")/set(SQLITE3_SHA3_256 \"${NEW_HASH}\")/" CMakeLists.txt | |
| echo "KEEP_GOING=yes" >> "${GITHUB_ENV}" | |
| echo "🚀 Creating a pull request." >> "${GITHUB_STEP_SUMMARY}" | |
| else | |
| echo "KEEP_GOING=no" >> "${GITHUB_ENV}" | |
| echo "😌 No update is necessary." >> "${GITHUB_STEP_SUMMARY}" | |
| fi | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9 | |
| id: cpr | |
| with: | |
| commit-message: "chore(deps): update SQLite from ${{ env.CURRENT_VERSION }} to ${{ env.NEW_VERSION }}" | |
| title: "chore(deps): update SQLite from ${{ env.CURRENT_VERSION }} to ${{ env.NEW_VERSION }}" | |
| body: | | |
| This PR updates SQLite from ${{ env.CURRENT_VERSION }} to ${{ env.NEW_VERSION }}. | |
| - [Download](https://sqlite.org/download.html) | |
| - [Changelog](https://sqlite.org/changes.html) | |
| branch: "update-sqlite-${{ env.NEW_VERSION }}" | |
| labels: dependencies | |
| token: ${{ secrets.REPOSITORY_ACCESS_TOKEN }} | |
| if: env.KEEP_GOING == 'yes' | |
| - name: Conclusion | |
| if: env.KEEP_GOING == 'yes' | |
| run: | | |
| if [ ${{ steps.cpr.outputs.pull-request-number }} != "" ]; then | |
| echo "ℹ️ Pull request: ${{ steps.cpr.outputs.pull-request-url }}." | |
| else | |
| echo "⚠️ No pull request created." | |
| fi |