2023-10-01 14:51:50 +03:00
|
|
|
#!/usr/bin/env bash
|
2024-02-13 08:51:57 +03:00
|
|
|
set -eu
|
2023-10-01 14:51:50 +03:00
|
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
|
2024-02-13 08:51:57 +03:00
|
|
|
git pull || true
|
|
|
|
yarn
|
|
|
|
|
2024-04-23 06:34:49 +03:00
|
|
|
version="$1"
|
|
|
|
swc_core_version="$(cargo tree -i -p swc_core --depth 0 | awk '{print $2}')"
|
|
|
|
|
2024-02-13 08:51:57 +03:00
|
|
|
echo "Publishing $version with swc_core $swc_core_version"
|
2023-10-01 14:51:50 +03:00
|
|
|
|
|
|
|
# Update swc_core
|
2024-03-26 08:44:30 +03:00
|
|
|
(cd ./bindings && ../scripts/update-all-swc-crates.sh || true)
|
2023-10-01 14:51:50 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Update version
|
2024-05-28 09:05:02 +03:00
|
|
|
(cd ./packages/core && npm version "$version" --no-git-tag-version --allow-same-version || true)
|
2023-10-24 14:29:53 +03:00
|
|
|
(cd ./packages/minifier && npm version "$version" --no-git-tag-version --allow-same-version || true)
|
2023-10-01 14:51:50 +03:00
|
|
|
(cd ./bindings && cargo set-version $version -p binding_core_wasm -p binding_minifier_wasm)
|
|
|
|
(cd ./bindings && cargo set-version --bump patch -p swc_cli)
|
2024-02-13 08:51:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Commmit and tag
|
|
|
|
git add -A
|
2024-02-13 08:52:53 +03:00
|
|
|
git commit -am "chore: Publish \`$version\` with \`swc_core\` \`$swc_core_version\`"
|
2024-02-13 08:51:57 +03:00
|
|
|
git tag -a -m "swc_core $swc_core_version" "v$version"
|
|
|
|
|
|
|
|
|
|
|
|
# Update changelog
|
|
|
|
yarn changelog
|
|
|
|
git add -A
|
|
|
|
git commit -m 'chore: Update changelog'
|
|
|
|
|
|
|
|
# Publish packages
|
|
|
|
git push
|
|
|
|
git push --tags
|
|
|
|
(cd ./bindings && cargo mono publish --no-verify)
|