File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # Create a slim folder with the minium content we want, and remove unneeded files
2+ mkdir slim && cp -r artifacts* package.json README.md deployments slim && cd slim
3+ find deployments -mindepth 1 -depth -not -name " *_addresses.json*" -exec rm -r " {}" +
4+ find artifacts -mindepth 1 -depth -not -regex " artifacts/contracts.*" -exec rm -r " {}" +
5+ find artifacts-zk -mindepth 1 -depth -not -regex " artifacts-zk/contracts.*" -exec rm -r " {}" +
6+ find artifacts -mindepth 1 -depth -regex " artifacts/.*dbg\.json" -exec rm -r " {}" +
7+
8+ # Add "-slim" to the version in the npm package, keeping the tag "-dev" if it exists
9+ jq ' .version |= sub("^(?<core>[0-9]+\\.[0-9]+\\.[0-9]+)"; "\(.core)-slim")' package.json > package.tmp.json && mv package.tmp.json package.json
10+
11+ # Remove the "prepare" and "postinstall" scripts, they won't work for this slim version
12+ jq ' del(.scripts.prepare)' package.json > package.tmp.json && mv package.tmp.json package.json
13+ jq ' del(.scripts.postinstall)' package.json > package.tmp.json && mv package.tmp.json package.json
14+
15+ # Empty devDependencies and dependencies
16+ jq ' .dependencies = {}' package.json > package.tmp.json && mv package.tmp.json package.json
17+ jq ' .devDependencies = {}' package.json > package.tmp.json && mv package.tmp.json package.json
Original file line number Diff line number Diff line change 1+ cd slim
2+
3+ # Extract to PRE_RELEASE_TAG the tag in the version field of the package json, or the empty string if it doesn't exist
4+ PRE_RELEASE_TAG=$( jq -r ' .version | if test("-") then capture("^[0-9]+\\.[0-9]+\\.[0-9]+-(?<tag>[a-zA-Z-]+)") | .tag else "" end' package.json)
5+
6+ # Publish the package to a custom tag for slim versions
7+ npm publish --access public --tag $PRE_RELEASE_TAG
Original file line number Diff line number Diff line change 4040 GIT_COMMITTER_NAME : Venus Tools
4141 GIT_COMMITTER_EMAIL : tools@venus.io
4242 run : yarn semantic-release
43+
44+ - name : Prepare slim package
45+ run : bash .github/prepare_slim_package.sh
46+
47+ - name : Publish slim package
48+ run : bash .github/publish_slim_package.sh
You can’t perform that action at this time.
0 commit comments