Skip to content

DB

DB #24

Workflow file for this run

name: DB
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
build:
name: build vuls.db
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 32768
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: vuls nightly install
run: go install github.com/MaineK00n/vuls2/cmd/vuls@nightly
- name: make db-build
run: make db-build DBPATH=./vuls.db
- name: Install bbolt
run: go install go.etcd.io/bbolt/cmd/bbolt@latest
- name: Install Zstd
run: sudo apt-get update && sudo apt-get install -y zstd
- name: compact vuls.db
run: |
bbolt compact -o ./vuls-compact.db ./vuls.db
mv ./vuls-compact.db ./vuls.db
zstd --ultra -22 -T4 --rm ./vuls.db -o ./vuls.db.zst
- name: Install Oras
run: |
# https://oras.land/docs/installation/#linux
VERSION="1.2.0"
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
mkdir -p oras-install/
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
sudo mv oras-install/oras /usr/local/bin/
rm -rf oras_${VERSION}_*.tar.gz oras-install/
- name: Login to GitHub Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Upload vuls.db to GHCR
run: oras push ghcr.io/vulsio/vuls-nightly-db:latest ./vuls.db.zst:application/vnd.vulsio.vuls.db.layer.v1+zstd
# run: oras push ghcr.io/${{ github.repository }}:latest ./vuls.db.zst:application/vnd.vulsio.vuls.db.layer.v1+zstd