File: publish.sh

package info (click to toggle)
rust-swc-core 35.0.0~ds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,816 kB
  • sloc: javascript: 873; xml: 538; sh: 358; makefile: 35; python: 5
file content (41 lines) | stat: -rwxr-xr-x 1,379 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -eu


SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

git pull || true
yarn

version="$1"
swc_core_version="$(cargo tree -i -p swc_core --depth 0 | awk '{print $2}')"

echo "Publishing $version with swc_core $swc_core_version"

# Update swc_core
(cd ./bindings && ../scripts/update-all-swc-crates.sh || true)


# Update version
(cd ./packages/core && npm version "$version" --no-git-tag-version --allow-same-version || true)
(cd ./packages/html && npm version "$version" --no-git-tag-version --allow-same-version || true)
(cd ./packages/minifier && npm version "$version" --no-git-tag-version --allow-same-version || true)
(cd ./packages/react-compiler && npm version "$version" --no-git-tag-version --allow-same-version || true)
(cd ./bindings && cargo set-version $version -p binding_core_wasm -p binding_minifier_wasm -p binding_typescript_wasm)
(cd ./bindings && cargo set-version --bump patch -p swc_cli)


# Commmit and tag
git add -A
git commit -am "chore: Publish \`$version\` with \`swc_core\` \`$swc_core_version\`"
git tag -a -m "swc_core $swc_core_version" "v$version"


# Update changelog
yarn changelog
git add -A || true
git commit -m 'chore: Update changelog' || true

# Publish packages
git push git@github.com:swc-project/swc.git --no-verify
git push git@github.com:swc-project/swc.git --no-verify --tags