bulk-release 2.16.1 → 2.17.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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.17.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.16.2...v2.17.0) (2026-04-05)
2
+
3
+ ### Features
4
+ * feat: rollback git tags on npm push issues ([3d55439](https://github.com/semrel-extra/zx-bulk-release/commit/3d55439a150f08bf2c0cf3d1edae9f327abce0e4))
5
+
6
+ ## [2.16.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.16.1...v2.16.2) (2026-04-05)
7
+
8
+ ### Fixes & improvements
9
+ * fix: handle tarball error ([3fb2fb7](https://github.com/semrel-extra/zx-bulk-release/commit/3fb2fb7a3ff8820a6499275737ea9a74bc281f0b))
10
+
1
11
  ## [2.16.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.16.0...v2.16.1) (2026-04-04)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.16.1",
4
+ "version": "2.17.0",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -109,11 +109,18 @@ export const getTags = async (cwd, ref) =>
109
109
 
110
110
  export const pushTag = async ({cwd, tag, gitCommitterName, gitCommitterEmail}) => {
111
111
  await setUserConfig(cwd, gitCommitterName, gitCommitterEmail)
112
+
112
113
  await $({cwd})`
113
114
  git tag -m ${tag} ${tag} &&
114
115
  git push origin ${tag}`
115
116
  }
116
117
 
118
+ export const deleteRemoteTag = async ({cwd, tag}) => {
119
+ log()(`rolling back remote tag '${tag}'`)
120
+ await $({cwd, nothrow: true})`git push origin :refs/tags/${tag}`
121
+ await $({cwd, nothrow: true})`git tag -d ${tag}`
122
+ }
123
+
117
124
  // Memoize prevents .git/config lock
118
125
  // https://github.com/qiwi/packasso/actions/runs/4539987310/jobs/8000403413#step:7:282
119
126
  export const setUserConfig = memoizeBy(async(cwd, gitCommitterName, gitCommitterEmail) => $({cwd})`
@@ -26,6 +26,10 @@ export const fetchPkg = async (pkg) => {
26
26
  })
27
27
  clearTimeout(timeoutId)
28
28
 
29
+ if (!tarball.ok) {
30
+ throw new Error(`registry responded with ${tarball.status} for ${tarballUrl}`)
31
+ }
32
+
29
33
  await unzip(pipify(tarball.body), {cwd, strip: 1, omit: ['package.json']})
30
34
 
31
35
  log({pkg})(`fetch duration '${id}': ${Date.now() - now}`)
@@ -5,14 +5,11 @@ import {npmPersist, npmPublish} from '../api/npm.js'
5
5
  import {prepareMeta, pushMeta, pushReleaseTag} from '../processor/meta.js'
6
6
  import {pushChangelog} from '../api/changelog.js'
7
7
  import {ghPages, ghRelease} from '../api/gh.js'
8
+ import {deleteRemoteTag} from '../api/git.js'
8
9
 
9
10
  export const publish = memoizeBy(async (pkg, run = exec) => within(async () => {
10
11
  $.scope = pkg.name
11
12
 
12
- // Debug
13
- // https://www.npmjs.com/package/@packasso/preset-ts-tsc-uvu/v/0.0.0?activeTab=code
14
- // https://github.com/qiwi/packasso/actions/runs/4514909191/jobs/7951564982#step:7:817
15
- // https://github.com/qiwi/packasso/blob/meta/2023-3-24-packasso-preset-ts-tsc-uvu-0-21-0-f0.json
16
13
  if (pkg.version !== pkg.manifest.version) {
17
14
  throw new Error('package.json version not synced')
18
15
  }
@@ -27,14 +24,26 @@ export const publish = memoizeBy(async (pkg, run = exec) => within(async () => {
27
24
  ])
28
25
  } else {
29
26
  await pushReleaseTag(pkg)
30
- await Promise.all([
31
- pushMeta(pkg),
32
- pushChangelog(pkg),
33
- npmPublish(pkg),
34
- ghRelease(pkg),
35
- ghPages(pkg),
36
- run(pkg, 'publishCmd')
37
- ])
27
+ try {
28
+ await Promise.all([
29
+ pushMeta(pkg),
30
+ pushChangelog(pkg),
31
+ npmPublish(pkg),
32
+ ghRelease(pkg),
33
+ ghPages(pkg),
34
+ run(pkg, 'publishCmd')
35
+ ])
36
+ } catch (e) {
37
+ // Rollback the tag only for npm-published packages so the next run can retry.
38
+ // Git-tag-only packages (private or npmPublish: false) keep their tag — it IS the release.
39
+ const needsNpm = !pkg.manifest.private && pkg.config.npmPublish !== false
40
+ const cwd = pkg.context.git.root
41
+ const tag = pkg.context.git.tag
42
+ if (tag && needsNpm) {
43
+ await deleteRemoteTag({cwd, tag})
44
+ }
45
+ throw e
46
+ }
38
47
  }
39
48
  pkg.published = true
40
49
  }))