File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-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+ # Set npm authentication
2+ echo " //registry.npmjs.org/:_authToken=${NPM_TOKEN} " > ~ /.npmrc
3+
4+ cd slim
5+
6+ # Extract to PRE_RELEASE_TAG the tag in the version field of the package json, or the empty string if it doesn't exist
7+ 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)
8+
9+ # Publish the package to a custom tag for slim versions
10+ npm publish --provenance --access public --tag $PRE_RELEASE_TAG
Original file line number Diff line number Diff line change 99jobs :
1010 release :
1111 runs-on : ubuntu-latest
12+ permissions :
13+ id-token : write
1214 steps :
1315 - name : Checkout
1416 uses : actions/checkout@v3
3537 GIT_COMMITTER_NAME : Venus Tools
3638 GIT_COMMITTER_EMAIL :
[email protected] 3739 run : yarn semantic-release
40+
41+ - name : Prepare slim package
42+ run : bash .github/prepare_slim_package.sh
43+
44+ - name : Publish slim package
45+ run : bash .github/publish_slim_package.sh
46+ env :
47+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 11{
22 "name" : " @venusprotocol/oracle" ,
33 "description" : " Venus Protocol Price Oracle" ,
4+ "repository" :
" [email protected] :VenusProtocol/oracle.git" ,
45 "version" : " 2.15.0-dev.3" ,
56 "author" : " Venus" ,
67 "engines" : {
You can’t perform that action at this time.
0 commit comments