Skip to content

Commit 745c34a

Browse files
authored
Use jq in release prepare script (#497)
1 parent 8380edb commit 745c34a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/deploy-release.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ jobs:
1313
prepare-script: >-
1414
cp package.json LICENSE README.md dist/ &&
1515
cd dist &&
16-
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json &&
17-
sed -i -e "s~\"main\": \"dist/index.js\"~\"main\": \"index.js\"~" package.json &&
18-
sed -i -e "s~\"types\": \"dist/index.d.ts\"~\"types\": \"index.d.ts\"~" package.json
16+
jq --arg version "${GITHUB_REF##*/}" '.version = $version | .main |= sub("^dist/"; "") | .types |= sub("^dist/"; "")' package.json > package.tmp.json &&
17+
mv package.tmp.json package.json

0 commit comments

Comments
 (0)