Skip to content

Commit a28aa46

Browse files
feat: [IPR-1063] Move jq command from publish workflow to script
1 parent eed6b5f commit a28aa46

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,7 @@ jobs:
112112

113113
- name: Publish scratch-gui-standalone
114114
run: |
115-
jq '
116-
.name = "@scratch/scratch-gui-standalone" |
117-
del(.peerDependencies) |
118-
.exports."." = .exports."./standalone" |
119-
del(.exports."./standalone")
120-
' ./packages/scratch-gui/package.json | npx sponge ./packages/scratch-gui/package.json
115+
bash ./scripts/prepare-standalone-gui.sh
121116
122117
npm --workspace=@scratch/scratch-gui-standalone run clean && npm --workspace=@scratch/scratch-gui-standalone run build:dist-standalone
123118
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui-standalone

scripts/prepare-standalone-gui.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
jq '
2+
if .name != "@scratch/scratch-gui-standalone" then
3+
.name = "@scratch/scratch-gui-standalone" |
4+
del(.peerDependencies) |
5+
.exports."." = .exports."./standalone" |
6+
del(.exports."./standalone")
7+
else
8+
.
9+
end
10+
' ./packages/scratch-gui/package.json | npx sponge ./packages/scratch-gui/package.json

0 commit comments

Comments
 (0)