@robotical/martyblocks 1.4.26 → 1.4.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,22 @@
1
1
  name: Build and publish to npm
2
2
 
3
- on:
4
- release:
5
- types: [created]
3
+ # on:
4
+ # release:
5
+ # types: [created]
6
+ on: workflow_dispatch
7
+
6
8
 
7
9
  jobs:
8
10
  build_and_release:
9
- runs-on: ubuntu-latest
11
+ runs-on: macos-latest
10
12
  env:
11
13
  NODE_OPTIONS: "--max-old-space-size=5120" # locally export NODE_OPTIONS=--max-old-space-size=5120
12
- MBHome: /home/runner/work/MartyBlocks/MartyBlocks
13
- mblib: /home/runner/work/MartyBlocks/MartyBlocks/marty-blocks-lib/
14
- REPLACEMENTS: /home/runner/work/MartyBlocks/MartyBlocks/marty-blocks-lib/replacements
15
- blocks_original: /home/runner/work/MartyBlocks/MartyBlocks/scratch-blocks
16
- vm_original: /home/runner/work/MartyBlocks/MartyBlocks/scratch-vm
17
- gui_original: /home/runner/work/MartyBlocks/MartyBlocks/scratch-gui
14
+ MBHome: /Users/runner/work/MartyBlocks/MartyBlocks
15
+ mblib: /Users/runner/work/MartyBlocks/MartyBlocks/marty-blocks-lib/
16
+ REPLACEMENTS: /Users/runner/work/MartyBlocks/MartyBlocks/marty-blocks-lib/replacements
17
+ blocks_original: /Users/runner/work/MartyBlocks/MartyBlocks/scratch-blocks
18
+ vm_original: /Users/runner/work/MartyBlocks/MartyBlocks/scratch-vm
19
+ gui_original: /Users/runner/work/MartyBlocks/MartyBlocks/scratch-gui
18
20
 
19
21
  steps:
20
22
 
@@ -25,7 +27,7 @@ jobs:
25
27
 
26
28
  - uses: actions/setup-python@v4
27
29
  with:
28
- python-version: '2.7'
30
+ python-version: '2.7.18'
29
31
 
30
32
  - name: Use Node.js 16.15.0
31
33
  uses: actions/setup-node@v2
@@ -110,7 +112,7 @@ jobs:
110
112
  # Setup .npmrc file to publish to npm
111
113
  - uses: actions/setup-node@v2
112
114
  with:
113
- node-version: "16.x"
115
+ node-version: "16.15.0"
114
116
  registry-url: "https://registry.npmjs.org"
115
117
  - run: npm publish
116
118
  env:
@@ -55,8 +55,9 @@ npmlinkAll() {
55
55
  buildAllAndStart () {
56
56
  # arguments [all, blocks, vm, gui]
57
57
  local type="${1:-all}"
58
+ setDevelopment
58
59
  cpReplacements
59
- buildScratch $type
60
+ buildScratchStart $type
60
61
  cd $gui_original
61
62
  npm start
62
63
  }
@@ -71,12 +72,23 @@ buildAllAndStart () {
71
72
  ##################### Helper functions ####################
72
73
  buildAllAndCpToWebApp () {
73
74
  local type="${1:-all}"
75
+ setDevelopment
74
76
  cpReplacements
75
77
  buildScratch $type
76
78
  cpToDist
77
79
  cpToWebapp
78
80
  }
79
81
 
82
+ setProduction () {
83
+ cd $mblib
84
+ npx node ./set-production.js
85
+ }
86
+
87
+ setDevelopment () {
88
+ cd $mblib
89
+ npx node ./set-development.js
90
+ }
91
+
80
92
  cpReplacements ()
81
93
  {
82
94
  cp -r $REPLACEMENTS/* $MBHome
@@ -90,6 +102,14 @@ buildScratch () {
90
102
  if [ $type = gui ]; then buildGui; fi
91
103
  }
92
104
 
105
+ buildScratchStart () {
106
+ local type="${1:-all}"
107
+ if [ $type = all ]; then buildBlocks; buildVm; buildGui; fi
108
+ if [ $type = blocks ]; then buildBlocks; fi
109
+ if [ $type = vm ]; then buildBlocks; buildVm; fi
110
+ if [ $type = gui ]; then buildGuiStart; fi
111
+ }
112
+
93
113
  cpToWebapp () {
94
114
  rm -rf $WebappHome/public/MartyBlocks/*
95
115
  cp -r $gui_original/build/* $WebappHome/public/MartyBlocks
@@ -120,6 +140,10 @@ buildGui() {
120
140
  cd $gui_original && BUILD_MODE=dist npm run build
121
141
  }
122
142
 
143
+ buildGuiStart() {
144
+ cd $gui_original && npm run build
145
+ }
146
+
123
147
  publishPackage() {
124
148
  cdhome;
125
149
  rm -rf dist;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/martyblocks",
3
- "version": "1.4.26",
3
+ "version": "1.4.38",
4
4
  "description": "MartyBlocks based on Scratch for Marty the Robot by Robotical",
5
5
  "main": "README.md",
6
6
  "scripts": {