diff --git a/.githooks/pre-push b/.githooks/pre-push index 5e87ec07..7c0d9591 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,15 +1,20 @@ -#! /bin/bash +#! /usr/bin/env bash -# Build the UI -cd src/ui +echo "Rebuilding the UI..." +cd "$(dirname "${BASH_SOURCE[0]}")/../src/ui" npm run deploy -# Check for changes -git diff-index --quiet HEAD +echo "Checking for changes..." +git diff --quiet --exit-code if [ $? -eq 1 ]; then - # Stage all changes + echo "Changes detected. Staging and appending to the last commit..." + git add -A + git commit --no-verify --quiet --message "chore: rebuild the project" + + exit 1 +else + echo "No changes detected." - # Commit the changes - git commit -n -q -m "chore: rebuild the project" + exit 0 fi diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml deleted file mode 100644 index 0570a8d3..00000000 --- a/.github/workflows/nightly-release.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Nightly Release - -on: - schedule: - - cron: "0 6 * * *" - workflow_dispatch: - inputs: - draft: - type: boolean - default: true - description: Put PR in draft mode for testing - -jobs: - nightly-release: - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - steps: - - uses: actions/checkout@v4 - - name: version tag - id: version-tag - run: | - tag="0.0.$(date +"%Y%m%d%H%M%S")" - echo "tag=$tag" >> $GITHUB_OUTPUT - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: Install Dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install wheel numpy twine - - name: Build Package - run: | - cd ./src/builtin-adapter - ./python/pip_package/build_pip_package.sh ${{ steps.version-tag.outputs.tag }} - - name: Verify the Distribution - run: twine check ./src/builtin-adapter/gen/adapter_pip/dist/* - - name: Check Directory Output - run: ls -l ./src/builtin-adapter/gen/adapter_pip/dist/*.whl diff --git a/src/ui/package.json b/src/ui/package.json index 6466c786..2f683269 100644 --- a/src/ui/package.json +++ b/src/ui/package.json @@ -2,14 +2,14 @@ "name": "model-explorer", "version": "0.0.0", "scripts": { + "prepare": "git config --local core.hooksPath .githooks/", "ng": "ng", "start": "ng serve model_explorer --host 0.0.0.0", "build": "ng build model_explorer", "build-npm": "./scripts/build_npm.sh", "deploy": "./scripts/build_and_update_python_package.sh", "watch": "ng build --watch --configuration development", - "test": "ng test model_explorer", - "setup-git-hooks": "cd ../.. && git config --local core.hooksPath .githooks/" + "test": "ng test model_explorer" }, "private": true, "dependencies": {