Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/prepare_slim_package.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Create a slim folder with the minium content we want, and remove unneeded files
mkdir slim && cp -r artifacts* package.json README.md deployments slim && cd slim
# Generate a JSON list of the tokens from the helpers
TS_NODE_TRANSPILE_ONLY=1 node_modules/.bin/ts-node --compiler-options '{"module":"commonjs"}' -e "import { tokens } from './helpers/tokens'; require('fs').writeFileSync('tokens.json', JSON.stringify(tokens, null, 2));"

mkdir slim && cp -r artifacts* package.json README.md deployments tokens.json slim && cd slim
find deployments -mindepth 1 -depth -not -name "*_addresses.json*" -exec rm -r "{}" +
find artifacts -mindepth 1 -depth -not -regex "artifacts/contracts.*" -exec rm -r "{}" +
find artifacts-zk -mindepth 1 -depth -not -regex "artifacts-zk/contracts.*" -exec rm -r "{}" +
find artifacts -mindepth 1 -depth -regex "artifacts/.*dbg\.json" -exec rm -r "{}" +

# Make sure the tokens list is included in the published files
jq '.files |= (. + ["tokens.json"] | unique)' package.json > package.tmp.json && mv package.tmp.json package.json

# Add "-slim" to the version in the npm package, keeping the tag "-dev" if it exists
jq '.version |= sub("^(?<core>[0-9]+\\.[0-9]+\\.[0-9]+)"; "\(.core)-slim")' package.json > package.tmp.json && mv package.tmp.json package.json

Expand Down
Loading