Simplify build scripts
This commit is contained in:
parent
47479896d5
commit
03856fe868
9 changed files with 300 additions and 634 deletions
7
scripts/build-js.sh
Executable file
7
scripts/build-js.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
wasm-pack build --target web --features wasm,console_error_panic_hook
|
||||
npm run build --prefix reconcile-js
|
||||
|
|
@ -1,14 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
which wasm-pack || cargo install wasm-pack
|
||||
wasm-pack build --target web --features wasm
|
||||
|
||||
cd reconcile-js
|
||||
npm ci
|
||||
npm run build
|
||||
cd ../examples/website
|
||||
npm ci
|
||||
npm run build
|
||||
cd -
|
||||
npm run build --prefix examples/website
|
||||
|
|
|
|||
7
scripts/build.sh
Executable file
7
scripts/build.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
scripts/build-js.sh
|
||||
uv run --directory reconcile-python --no-sync maturin develop -q
|
||||
|
|
@ -36,7 +36,7 @@ sed_inplace() {
|
|||
echo "Bumping versions"
|
||||
|
||||
which cargo-set-version || cargo install cargo-edit
|
||||
cargo set-version --bump $1
|
||||
cargo set-version --bump "$1"
|
||||
|
||||
NEWVER=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ which wasm-pack || cargo install wasm-pack
|
|||
wasm-pack build --target web --features wasm
|
||||
|
||||
cd reconcile-js
|
||||
npm version $1
|
||||
npm version "$NEWVER" --no-git-tag-version
|
||||
npm install
|
||||
|
||||
cd ../reconcile-python
|
||||
|
|
@ -60,12 +60,11 @@ npm install
|
|||
cd ../..
|
||||
|
||||
git add .
|
||||
TAG=$(node -p "require('./reconcile-js/package.json').version")
|
||||
|
||||
git commit -m "Bump versions to $TAG"
|
||||
git commit -m "Bump versions to $NEWVER"
|
||||
|
||||
git push
|
||||
echo "Tagging $TAG"
|
||||
git tag -a $TAG -m "Release $TAG"
|
||||
git push origin $TAG
|
||||
echo "Tagging $NEWVER"
|
||||
git tag -a $NEWVER -m "Release $NEWVER"
|
||||
git push origin $NEWVER
|
||||
echo "Done"
|
||||
|
|
|
|||
10
scripts/check.sh
Executable file
10
scripts/check.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
scripts/setup.sh
|
||||
scripts/build.sh
|
||||
scripts/lint.sh
|
||||
scripts/test.sh
|
||||
scripts/build-website.sh
|
||||
|
|
@ -1,13 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
wasm-pack build --target web --features wasm
|
||||
|
||||
cd reconcile-js
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
cd ../examples/website
|
||||
npm install
|
||||
npm run start
|
||||
scripts/build-js.sh
|
||||
npm start --prefix examples/website
|
||||
|
|
|
|||
|
|
@ -1,27 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
which cargo-machete || cargo install cargo-machete
|
||||
cargo machete
|
||||
|
||||
cargo clippy --all-targets --all-features -- -D warnings
|
||||
cargo fmt --all -- --check
|
||||
|
||||
cd reconcile-js
|
||||
npm ci
|
||||
npm run format:check
|
||||
npm run format:check --prefix reconcile-js
|
||||
npm run format:check --prefix examples/website
|
||||
|
||||
cd ../examples/website
|
||||
npm ci
|
||||
npm run format:check
|
||||
|
||||
cd ../../reconcile-python
|
||||
cp ../README.md ../LICENSE .
|
||||
uv run maturin develop -q
|
||||
uv run ruff check python/ tests/
|
||||
uv run ruff format --check python/ tests/
|
||||
uv run pyright python/ tests/
|
||||
cd -
|
||||
|
||||
echo "Success!"
|
||||
uv run --directory reconcile-python --no-sync ruff check python/ tests/
|
||||
uv run --directory reconcile-python --no-sync ruff format --check python/ tests/
|
||||
uv run --directory reconcile-python --no-sync pyright python/ tests/
|
||||
|
|
|
|||
19
scripts/setup.sh
Executable file
19
scripts/setup.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
node_version=$(node --version | cut -d'.' -f1 | tr -d 'v')
|
||||
if [ "$node_version" != "22" ]; then
|
||||
echo "Error: Node.js version 22 is required, but found version $node_version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command -v wasm-pack || cargo install --locked wasm-pack
|
||||
command -v cargo-machete || cargo install --locked cargo-machete
|
||||
|
||||
npm ci --prefix reconcile-js
|
||||
npm ci --prefix examples/website
|
||||
cp README.md LICENSE reconcile-js/
|
||||
cp README.md LICENSE reconcile-python/
|
||||
uv sync --directory reconcile-python --frozen --no-install-project
|
||||
|
|
@ -1,36 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
which cargo-insta || cargo install cargo-insta
|
||||
which wasm-pack || cargo install wasm-pack
|
||||
|
||||
node_version=$(node --version | cut -d'.' -f1 | tr -d 'v')
|
||||
if [ "$node_version" != "22" ]; then
|
||||
echo "Error: Node.js version 22 is required, but found version $node_version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wasm-pack build --target web --features wasm,console_error_panic_hook
|
||||
cargo test --verbose --features serde -- --include-ignored
|
||||
|
||||
cargo test
|
||||
cargo test --features serde
|
||||
cargo test --features serde -- --include-ignored
|
||||
cargo test
|
||||
cargo test --features wasm
|
||||
cargo test --features all
|
||||
|
||||
wasm-pack test --node --features wasm,console_error_panic_hook
|
||||
|
||||
cd reconcile-js
|
||||
npm ci
|
||||
npm run build
|
||||
npm run test
|
||||
cd -
|
||||
|
||||
cd reconcile-python
|
||||
cp ../README.md ../LICENSE .
|
||||
uv run maturin develop
|
||||
uv run pytest -v
|
||||
cd -
|
||||
|
||||
echo "Success!"
|
||||
npm test --prefix reconcile-js
|
||||
uv run --directory reconcile-python --no-sync pytest -v
|
||||
|
|
|
|||
Loading…
Reference in a new issue