diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4700f3be3..72132a0b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: pip install requests - name: Generate report - run: bash ./run.sh + run: bash -c "source ./configs/build-github.sh && ./run.sh" - name: Deploy GitHub pages uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.travis.yml b/.travis.yml index 9736063b9..9baa067e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,11 @@ language: java dist: xenial -script: ./run.sh +python: "3.7" + +install: pip install requests==2.25.1 + +script: bash -c "source ./configs/build-travis.sh && ./run.sh" deploy: skip_cleanup: true diff --git a/configs/build-github.sh b/configs/build-github.sh new file mode 100644 index 000000000..8b6911038 --- /dev/null +++ b/configs/build-github.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ -n "$GITHUB_REPOSITORY" ]; then + REPO_NAME=$(basename "$GITHUB_REPOSITORY") + export VITE_BASE_DIR="/$REPO_NAME/" +fi + +echo "VITE_BASE_DIR:$VITE_BASE_DIR" \ No newline at end of file diff --git a/configs/build-travis.sh b/configs/build-travis.sh new file mode 100644 index 000000000..71aae4599 --- /dev/null +++ b/configs/build-travis.sh @@ -0,0 +1,6 @@ +if [ -n "$TRAVIS_REPO_SLUG" ]; then + REPO_NAME=$(basename "$TRAVIS_REPO_SLUG") + export VITE_BASE_DIR="/$REPO_NAME/" +fi + +echo "VITE_BASE_DIR:$VITE_BASE_DIR" diff --git a/get-reposense.py b/get-reposense.py index 838f8f318..0d880bef4 100755 --- a/get-reposense.py +++ b/get-reposense.py @@ -126,4 +126,4 @@ def download_file(url): exit() # If no arguments are provided or --release - handle_latest_release() + handle_latest_release() \ No newline at end of file