From bf4ae94b62dd4a0513f6b3b3f3a7dd7e4cbbc021 Mon Sep 17 00:00:00 2001 From: Folyd Date: Fri, 28 Jun 2024 22:55:56 -0700 Subject: [PATCH] Move crates index workflow to submodule --- .github/workflows/crates-index.yml | 21 ----------------- scripts/deploy-crates-index.sh | 38 ------------------------------ 2 files changed, 59 deletions(-) delete mode 100644 .github/workflows/crates-index.yml delete mode 100755 scripts/deploy-crates-index.sh diff --git a/.github/workflows/crates-index.yml b/.github/workflows/crates-index.yml deleted file mode 100644 index 57fd1667..00000000 --- a/.github/workflows/crates-index.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: crates-index - -on: - workflow_dispatch: - schedule: - - cron: "10 14 * * *" - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - 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 https://static.crates.io/db-dump.tar.gz -O /tmp/db-dump.tar.gz - - name: Deloy crates index - run: ./scripts/deploy-crates-index.sh diff --git a/scripts/deploy-crates-index.sh b/scripts/deploy-crates-index.sh deleted file mode 100755 index 9067dd74..00000000 --- a/scripts/deploy-crates-index.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -set -e - -CRATES_INDEX_PATH="/tmp/index.js" -CRATES_DATABASE_PATH="/tmp/db-dump.tar.gz" -BRANCH="now" - -build() { - echo "Starting building crates-index..." - cd rust - RUST_BACKTRACE=full cargo run --release crates -p ${CRATES_DATABASE_PATH} -d ${CRATES_INDEX_PATH} - echo "{\"version\": $(date +%s)}" > /tmp/version.json - cd .. -} - -upload() { - echo "Starting uploading crates-index..." - git config --global url."https://".insteadOf git:// - git config --global url."https://github.com/".insteadOf git@github.com: - - git checkout ${BRANCH} - if [[ ! -d "crates" ]] - then - mkdir crates - fi - cp -vr "${CRATES_INDEX_PATH}" /tmp/version.json crates/ - - git config user.name "GitHub Actions" - git config user.email "github-actions-bot@users.noreply.github.com" - git add crates/ - git commit --amend -m "Upload latest crates index" - git push --force "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ${BRANCH} - - echo "Upload complete" -} - -build -upload \ No newline at end of file