You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts.md
+23-12Lines changed: 23 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,55 +52,66 @@ This script builds all files needed to deploy plugins and examples to GitHub Pag
52
52
53
53
This script installs a beta version of Blockly, builds all files needed to deploy plugins and examples to GitHub Pages, then starts a local server with that content.
54
54
55
+
## Publishing scripts
56
+
57
+
Note that publishing via the command line is not preferred. You should
58
+
use the GitHub Action workflow whenever possible, which can handle
59
+
publishing all plugins as well as recovering from the partially-published
60
+
state (publishing unpublished plugins only).
61
+
62
+
Note that none of these scripts will handle npm authentication. You need to
63
+
configure an npm authentication token before you can use these scripts.
64
+
65
+
Full publishing documentation can be found in the internal team documentation.
66
+
55
67
### `npm run publish:prepare`
56
68
57
69
This script will clone a copy of blockly-samples to a directory called `dist`,
58
-
run `npm ci`, build and test all plugins, and then log in to the npm publishing
59
-
service. It must be run before any of the other manual publishing commands are
60
-
run.
70
+
run `npm ci`, then build and test all plugins.
61
71
62
72
If any plugin fails to build or some tests fail, this script should fail. Since
63
73
nothing has been pushed to npm or github, you can simply correct the error and
64
74
try again.
65
75
76
+
This script will be run automatically before any of the other publish scripts,
77
+
so you do not need to run it manually first.
78
+
66
79
### `npm run publish:manual`
67
80
68
-
This script assumes that you have already run `npm run publish:prepare`. It will
81
+
This script will first run `npm run publish:prepare`. It will
69
82
publish all of the changed plugins since the last release, using the `dist`
70
83
directory. It runs the lerna command that uses conventional commits to determine
71
84
a new version number for each plugin, and publishes the new versions to npm and
72
-
to a github release and tag. Plugins do not automatically build themselves
73
-
before publishing. You must have run `npm run publish:prepare` script ahead of
74
-
time for this reason.
85
+
to a github release and tag.
75
86
76
87
If there is some error with npm while running this command, you may end up in a
77
88
state where some plugins have been published to npm and not others, after lerna
78
89
has already tagged the new releases. You can recover from this state by fixing
79
-
the error, and then running `npm run publish:prepare` again followed by
90
+
the error, and then running either
80
91
`npm run publish:unpublishedOnly` or `npm run publish:force`.
81
92
82
93
### `npm run publish:unpublishedOnly`
83
94
84
-
This script assumes that you have already run `npm run publish:prepare`. It uses the `dist`
95
+
This script will first run `npm run publish:prepare`. It uses the `dist`
85
96
directory created in that script. It uses lerna to check each plugin to see if the version
86
97
in `package.json` matches the version on npm. If a version is not yet on npm, it will publish
87
98
that plugin without updating its version number. Thus, this script should only be used
88
99
after `lerna version` has been run in some form (most commonly, during a run of
89
100
`npm run publish:manual` that subsequently failed).
90
101
91
-
If this script fails, correct the error and re-run`npm run publish:prepare` and
102
+
If this script fails, correct the error and re-run
92
103
`npm run publish:unpublishedOnly`.
93
104
94
105
### `npm run publish:force`
95
106
96
-
This script assumes you have already run `npm run publish:prepare`. It will use lerna
107
+
This script will first run `npm run publish:prepare`. It will use lerna
97
108
to force publish all packages, even those that have not changed. You can use this
98
109
if you run into publishing problems to recover from error states, but you should prefer
99
110
to use `npm run publish:unpublishedOnly` if possible.
100
111
101
112
### `npm run publish:checkVersions`
102
113
103
-
This script assumes you have already run `npm run publish:prepare`. It will run `lerna
114
+
This script will first run `npm run publish:prepare`. It will run `lerna
104
115
version` to generate the new version numbers using conventional commits that would be
105
116
created during a full publish action, but it will not actually push the changes nor
106
117
create any tags. This can be used to check which plugins would be published and under
0 commit comments