Skip to content

DB: add missing releases #125

DB: add missing releases

DB: add missing releases #125

name: 'DB: add missing releases'
on:
workflow_dispatch:
inputs:
rebuild:
description: 'Rebuild the database from scratch'
type: boolean
required: false
default: false
schedule:
- cron: '0 0 * * *'
permissions: {}
jobs:
get_missing_releases:
runs-on: ubuntu-latest
outputs:
missing_gcs: ${{ steps.get_missing_releases.outputs.missing_gcs }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.DB_GCS_SA_KEY }}'
- name: Get missing releases
id: get_missing_releases
working-directory: scripts
run: |
./db_get_missing_releases.sh ${{ inputs.rebuild && '--rebuild' }}
echo "missing_gcs=$(cat missing_gcs_releases.txt | jq -Rsc 'split("\n") | map(select(length > 0))')" >> $GITHUB_OUTPUT
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
path: 'scripts/*.txt'
process_release:
needs: get_missing_releases
if: ${{ needs.get_missing_releases.outputs.missing_gcs != '[]' }}
strategy:
matrix:
release: ${{ fromJson(needs.get_missing_releases.outputs.missing_gcs) }}
fail-fast: false
uses: ./.github/workflows/db-generate-for-release.yml
secrets: inherit
with:
release: kernelctf ${{matrix.release}}
merge_db:
runs-on: ubuntu-latest
needs: [get_missing_releases, process_release]
if: ${{ always() && needs.get_missing_releases.outputs.missing_db != '[]' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.DB_GCS_SA_KEY }}'
- name: Install kpwn_db prerequisites
working-directory: kpwn_db
run: pip install -r requirements.txt
- name: Merge DB
working-directory: scripts
run: ./db_merge.sh ${{ inputs.rebuild && '--rebuild' }}