Download crates.io dumped database before build crates index

This commit is contained in:
Folyd 2020-02-27 17:47:30 +08:00
parent ba523999d5
commit a872c12762
2 changed files with 5 additions and 1 deletions

View file

@ -13,5 +13,8 @@ jobs:
- uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Download crates.io dumped database
- run: |
wget -v https://static.crates.io/db-dump.tar.gz -O /data/db-dump.tar.gz
- name: Deloy crates index
run: ./scripts/deploy-crates-index.sh

View file

@ -2,12 +2,13 @@
set -e
CRATES_INDEX_PATH="/tmp/index.js"
CRATES_DATABASE_PATH="/data/db-dump.tar.gz"
BRANCH="now"
build() {
echo "Starting building crates-index..."
cd rust
RUST_BACKTRACE=full cargo run --release --bin crates-index ${CRATES_INDEX_PATH}
RUST_BACKTRACE=full cargo run --release --bin crates-index ${CRATES_DATABASE_PATH} ${CRATES_INDEX_PATH}
echo "{\"version\": $(date +%s)}" > /tmp/version.json
cd ..
}