bulk-release 2.17.0 → 2.18.0
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 +5 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/main/js/steps/contextify.js +30 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [2.18.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.17.0...v2.18.0) (2026-04-05)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
* feat: introduce recovery mode ([2f15fd8](https://github.com/semrel-extra/zx-bulk-release/commit/2f15fd83cfb41a4a55a4ab12d880c00e24c5c717))
|
|
5
|
+
|
|
1
6
|
## [2.17.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.16.2...v2.17.0) (2026-04-05)
|
|
2
7
|
|
|
3
8
|
### Features
|
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ GH_TOKEN=ghtoken GH_USER=username NPM_TOKEN=npmtoken npx zx-bulk-release [opts]
|
|
|
50
50
|
| `--dry-run` / `--no-publish` | Disable any publish logic | |
|
|
51
51
|
| `--report` | Persist release state to file | |
|
|
52
52
|
| `--snapshot` | Disable any publishing steps except of `npm` and `publishCmd` (if defined), then push packages to the `snapshot` channel | |
|
|
53
|
+
| `--recover` | Remove orphan git tags (tag pushed but npm publish failed) and retry release | |
|
|
53
54
|
| `--debug` | Enable [zx](https://github.com/google/zx#verbose) verbose mode | |
|
|
54
55
|
| `--version` / `-v` | Print own version | |
|
|
55
56
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import {getPkgConfig} from '../config.js'
|
|
2
2
|
import {getLatest} from '../processor/meta.js'
|
|
3
|
-
import {getRoot, getSha} from '../api/git.js'
|
|
3
|
+
import {getRoot, getSha, deleteRemoteTag} from '../api/git.js'
|
|
4
|
+
import {fetchManifest} from '../api/npm.js'
|
|
5
|
+
import {log} from '../log.js'
|
|
4
6
|
import {$} from 'zx-extra'
|
|
5
7
|
|
|
6
8
|
// Inspired by https://docs.github.com/en/actions/learn-github-actions/contexts
|
|
7
9
|
export const contextify = async (pkg, {packages, root, flags, env}) => {
|
|
8
10
|
pkg.config = await getPkgConfig([pkg.absPath, root.absPath], env)
|
|
9
11
|
pkg.latest = await getLatest(pkg)
|
|
12
|
+
|
|
13
|
+
if (flags.recover && pkg.latest.tag) {
|
|
14
|
+
await recover(pkg)
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
pkg.context = {
|
|
11
18
|
git: {
|
|
12
19
|
sha: await getSha(pkg.absPath),
|
|
@@ -17,3 +24,25 @@ export const contextify = async (pkg, {packages, root, flags, env}) => {
|
|
|
17
24
|
packages
|
|
18
25
|
}
|
|
19
26
|
}
|
|
27
|
+
|
|
28
|
+
// Verify that the latest tagged version actually exists on npm.
|
|
29
|
+
// If not (tag was pushed but npm publish failed), delete the orphan tag
|
|
30
|
+
// so the next analyze phase can re-detect changes and retry the release.
|
|
31
|
+
const recover = async (pkg) => {
|
|
32
|
+
const needsNpm = !pkg.manifest.private && pkg.config.npmPublish !== false
|
|
33
|
+
if (!needsNpm) return
|
|
34
|
+
|
|
35
|
+
const {tag} = pkg.latest
|
|
36
|
+
const manifest = await fetchManifest({
|
|
37
|
+
name: pkg.name,
|
|
38
|
+
version: tag.version,
|
|
39
|
+
config: pkg.config,
|
|
40
|
+
}, {nothrow: true})
|
|
41
|
+
|
|
42
|
+
if (!manifest) {
|
|
43
|
+
const cwd = await getRoot(pkg.absPath)
|
|
44
|
+
log({pkg})(`recover: tag '${tag.ref}' exists but ${pkg.name}@${tag.version} not found on npm, removing orphan tag`)
|
|
45
|
+
await deleteRemoteTag({cwd, tag: tag.ref})
|
|
46
|
+
pkg.latest = await getLatest(pkg)
|
|
47
|
+
}
|
|
48
|
+
}
|