zx-bulk-release 2.5.3 → 2.6.1

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.6.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.6.0...v2.6.1) (2023-04-21)
2
+
3
+ ### Fixes & improvements
4
+ * docs: readme struct edits, mention `wget` and `git` as requirements ([2f76f12](https://github.com/semrel-extra/zx-bulk-release/commit/2f76f12b142a700dd53045fc4d268d6d8e64b721))
5
+
6
+ ## [2.6.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.3...v2.6.0) (2023-04-21)
7
+
8
+ ### Features
9
+ * feat: enable npm `--provenance` via `NPM_PROVENANCE` env var ([c61ff88](https://github.com/semrel-extra/zx-bulk-release/commit/c61ff88a47c3fee6102ea19de47cdcecdda8833d))
10
+
1
11
  ## [2.5.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.2...v2.5.3) (2023-04-13)
2
12
 
3
13
  ### Fixes & improvements
package/README.md CHANGED
@@ -25,6 +25,9 @@
25
25
  * macOS / linux
26
26
  * Node.js >= 16.0.0
27
27
  * npm >=7 / yarn >= 3
28
+ * wget
29
+ * tar
30
+ * git
28
31
 
29
32
  ## Usage
30
33
  ### Install
@@ -63,8 +66,9 @@ await run({
63
66
  })
64
67
  ```
65
68
 
66
- ### Config
67
- Any [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) compliant format: `.releaserc`, `.release.json`, `.release.yaml`, etc.
69
+ ## Config
70
+ ### cosmiconfig
71
+ Any [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) compliant format: `.releaserc`, `.release.json`, `.release.yaml`, etc in the package root or in the repo root dir.
68
72
  ```json
69
73
  {
70
74
  "cmd": "yarn && yarn build && yarn test",
@@ -74,51 +78,29 @@ Any [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) compliant format
74
78
  }
75
79
  ```
76
80
 
77
- ### Demo
78
- * [demo-zx-bulk-release](https://github.com/semrel-extra/demo-zx-bulk-release)
79
- * [qiwi/pijma](https://github.com/qiwi/pijma)
80
-
81
- ### Output
82
-
83
- [Compact and clear logs](https://github.com/semrel-extra/demo-zx-bulk-release/runs/7090161341?check_suite_focus=true#step:6:1)
81
+ ### env vars
82
+ ```js
83
+ export const parseEnv = (env = process.env) => {
84
+ const {GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, NPM_PROVENANCE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = env
84
85
 
85
- ```shell
86
- Run npm_config_yes=true npx zx-bulk-release
87
- zx-bulk-release
88
- [@semrel-extra/zxbr-test-a] semantic changes [
89
- {
90
- group: 'Fixes & improvements',
91
- releaseType: 'patch',
92
- change: 'fix(a): random',
93
- subj: 'fix(a): random',
94
- body: '',
95
- short: '6ff25bd',
96
- hash: '6ff25bd421755b929ef2b58f35c727670fd93849'
97
- }
98
- ]
99
- [@semrel-extra/zxbr-test-a] run cmd 'yarn && yarn build && yarn test'
100
- [@semrel-extra/zxbr-test-a] push release tag 2022.6.27-semrel-extra.zxbr-test-a.1.8.1-f0
101
- [@semrel-extra/zxbr-test-a] push artifact to branch 'meta'
102
- [@semrel-extra/zxbr-test-a] push changelog
103
- [@semrel-extra/zxbr-test-a] publish npm package @semrel-extra/zxbr-test-a 1.8.1 to https://registry.npmjs.org
104
- [@semrel-extra/zxbr-test-a] create gh release
105
- [@semrel-extra/zxbr-test-b] semantic changes [
106
- {
107
- group: 'Dependencies',
108
- releaseType: 'patch',
109
- change: 'perf',
110
- subj: 'perf: @semrel-extra/zxbr-test-a updated to 1.8.1'
86
+ return {
87
+ ghUser: GH_USER || GH_USERNAME || GITHUB_USER || GITHUB_USERNAME,
88
+ ghToken: GH_TOKEN || GITHUB_TOKEN,
89
+ npmToken: NPM_TOKEN,
90
+ // npmConfig suppresses npmToken
91
+ npmConfig: NPMRC || NPM_USERCONFIG || NPM_CONFIG_USERCONFIG,
92
+ npmRegistry: NPM_REGISTRY || 'https://registry.npmjs.org',
93
+ npmProvenance: NPM_PROVENANCE,
94
+ gitCommitterName: GIT_COMMITTER_NAME || 'Semrel Extra Bot',
95
+ gitCommitterEmail: GIT_COMMITTER_EMAIL || 'semrel-extra-bot@hotmail.com',
111
96
  }
112
- ]
113
- [@semrel-extra/zxbr-test-b] run cmd 'yarn && yarn build && yarn test'
114
- [@semrel-extra/zxbr-test-b] push release tag 2022.6.27-semrel-extra.zxbr-test-b.1.3.5-f0
115
- [@semrel-extra/zxbr-test-b] push artifact to branch 'meta'
116
- [@semrel-extra/zxbr-test-b] push changelog
117
- [@semrel-extra/zxbr-test-b] publish npm package @semrel-extra/zxbr-test-b 1.3.5 to https://registry.npmjs.org
118
- [@semrel-extra/zxbr-test-b] create gh release
119
- [@semrel-extra/zxbr-test-d] semantic changes [
97
+ }
120
98
  ```
121
99
 
100
+ ## Demo
101
+ * [demo-zx-bulk-release](https://github.com/semrel-extra/demo-zx-bulk-release)
102
+ * [qiwi/pijma](https://github.com/qiwi/pijma)
103
+
122
104
  ## Implementation notes
123
105
  ### Flow
124
106
  ```js
@@ -208,25 +190,6 @@ Note, [npm-package-name charset](https://www.npmjs.com/package/validate-npm-pack
208
190
  // date name ver b64 format
209
191
  ```
210
192
 
211
- ### env vars
212
-
213
- ```js
214
- export const parseEnv = (env = process.env) => {
215
- const {GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = env
216
-
217
- return {
218
- ghUser: GH_USER || GH_USERNAME || GITHUB_USER || GITHUB_USERNAME,
219
- ghToken: GH_TOKEN || GITHUB_TOKEN,
220
- npmToken: NPM_TOKEN,
221
- // npmConfig suppresses npmToken
222
- npmConfig: NPMRC || NPM_USERCONFIG || NPM_CONFIG_USERCONFIG,
223
- npmRegistry: NPM_REGISTRY || 'https://registry.npmjs.org',
224
- gitCommitterName: GIT_COMMITTER_NAME || 'Semrel Extra Bot',
225
- gitCommitterEmail: GIT_COMMITTER_EMAIL || 'semrel-extra-bot@hotmail.com',
226
- }
227
- }
228
- ```
229
-
230
193
  ### Meta
231
194
 
232
195
  Each release stores its result into the `meta` branch.
@@ -290,6 +253,46 @@ Release process state is reported to the console and to a file if `--report` fla
290
253
  }
291
254
  ```
292
255
 
256
+ ### Output
257
+ [Compact and clear logs](https://github.com/semrel-extra/demo-zx-bulk-release/runs/7090161341?check_suite_focus=true#step:6:1)
258
+
259
+ ```shell
260
+ Run npm_config_yes=true npx zx-bulk-release
261
+ zx-bulk-release
262
+ [@semrel-extra/zxbr-test-a] semantic changes [
263
+ {
264
+ group: 'Fixes & improvements',
265
+ releaseType: 'patch',
266
+ change: 'fix(a): random',
267
+ subj: 'fix(a): random',
268
+ body: '',
269
+ short: '6ff25bd',
270
+ hash: '6ff25bd421755b929ef2b58f35c727670fd93849'
271
+ }
272
+ ]
273
+ [@semrel-extra/zxbr-test-a] run cmd 'yarn && yarn build && yarn test'
274
+ [@semrel-extra/zxbr-test-a] push release tag 2022.6.27-semrel-extra.zxbr-test-a.1.8.1-f0
275
+ [@semrel-extra/zxbr-test-a] push artifact to branch 'meta'
276
+ [@semrel-extra/zxbr-test-a] push changelog
277
+ [@semrel-extra/zxbr-test-a] publish npm package @semrel-extra/zxbr-test-a 1.8.1 to https://registry.npmjs.org
278
+ [@semrel-extra/zxbr-test-a] create gh release
279
+ [@semrel-extra/zxbr-test-b] semantic changes [
280
+ {
281
+ group: 'Dependencies',
282
+ releaseType: 'patch',
283
+ change: 'perf',
284
+ subj: 'perf: @semrel-extra/zxbr-test-a updated to 1.8.1'
285
+ }
286
+ ]
287
+ [@semrel-extra/zxbr-test-b] run cmd 'yarn && yarn build && yarn test'
288
+ [@semrel-extra/zxbr-test-b] push release tag 2022.6.27-semrel-extra.zxbr-test-b.1.3.5-f0
289
+ [@semrel-extra/zxbr-test-b] push artifact to branch 'meta'
290
+ [@semrel-extra/zxbr-test-b] push changelog
291
+ [@semrel-extra/zxbr-test-b] publish npm package @semrel-extra/zxbr-test-b 1.3.5 to https://registry.npmjs.org
292
+ [@semrel-extra/zxbr-test-b] create gh release
293
+ [@semrel-extra/zxbr-test-d] semantic changes [
294
+ ```
295
+
293
296
  ## References
294
297
  * [semrel-extra/zx-semrel](https://github.com/semrel-extra/zx-semrel)
295
298
  * [dhoulb/multi-semantic-release](https://github.com/dhoulb/multi-semantic-release)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.5.3",
4
+ "version": "2.6.1",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -38,12 +38,13 @@ export const normalizePkgConfig = (config, env) => ({
38
38
  }
39
39
  })
40
40
 
41
- export const parseEnv = ({GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = process.env) =>
41
+ export const parseEnv = ({GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, NPM_PROVENANCE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = process.env) =>
42
42
  ({
43
43
  ghUser: GH_USER || GH_USERNAME || GITHUB_USER || GITHUB_USERNAME,
44
44
  ghToken: GH_TOKEN || GITHUB_TOKEN,
45
45
  npmConfig: NPMRC || NPM_USERCONFIG || NPM_CONFIG_USERCONFIG,
46
46
  npmToken: NPM_TOKEN,
47
+ npmProvenance: NPM_PROVENANCE,
47
48
  npmRegistry: NPM_REGISTRY || 'https://registry.npmjs.org',
48
49
  gitCommitterName: GIT_COMMITTER_NAME || 'Semrel Extra Bot',
49
50
  gitCommitterEmail: GIT_COMMITTER_EMAIL || 'semrel-extra-bot@hotmail.com',
@@ -37,7 +37,7 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
37
37
  }
38
38
 
39
39
  export const npmPublish = async (pkg) => {
40
- const {absPath: cwd, name, version, manifest, config: {npmPublish, npmRegistry, npmToken, npmConfig} } = pkg
40
+ const {absPath: cwd, name, version, manifest, config: {npmPublish, npmRegistry, npmToken, npmConfig, npmProvenance}} = pkg
41
41
 
42
42
  if (manifest.private || npmPublish === false) return
43
43
 
@@ -46,7 +46,7 @@ export const npmPublish = async (pkg) => {
46
46
  const npmTag = pkg.preversion ? 'snapshot' : 'latest'
47
47
  const npmrc = await getNpmrc({npmConfig, npmToken, npmRegistry})
48
48
 
49
- await $.o({cwd})`npm publish --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --tag ${npmTag} --no-workspaces`
49
+ await $.o({cwd})`npm publish ${npmProvenance ? '--provenance' : ''} --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --tag ${npmTag} --no-workspaces`
50
50
  }
51
51
 
52
52
  export const getNpmrc = async ({npmConfig, npmToken, npmRegistry}) => {