Index update #77
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: Index update | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 6 * * 0' | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: git submodule update --init | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: Index (sparse) | |
run: python3 index.py -d idlib.sqlite | |
- name: Index (full) | |
run: | | |
python3 index.py -m full --no-prune -d idlib-full-unpruned.sqlite | |
cp idlib-full-unpruned.sqlite idlib-full.sqlite | |
python3 index.py --prune-only -d idlib-full.sqlite | |
- name: Compress databases | |
run: | | |
zstd -10 -k idlib.sqlite | |
zstd -10 -k idlib-full.sqlite | |
zstd -10 -k idlib-full-unpruned.sqlite | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_name: Database Release ${{ github.run_number }} | |
tag_name: db_release-${{ github.run_number }} | |
draft: false | |
prerelease: false | |
- name: Upload idlib.sqlite.zst | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./idlib.sqlite.zst | |
asset_name: idlib.sqlite.zst | |
asset_content_type: application/octet-stream | |
- name: Upload idlib-full-unpruned.sqlite.zst | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./idlib-full-unpruned.sqlite.zst | |
asset_name: idlib-full-unpruned.sqlite.zst | |
asset_content_type: application/octet-stream | |
- name: Upload idlib-full.sqlite.zst | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./idlib-full.sqlite.zst | |
asset_name: idlib-full.sqlite.zst | |
asset_content_type: application/octet-stream |