zx-bulk-release 2.2.8 → 2.2.9
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/package.json +1 -1
- package/src/main/js/gh.js +4 -3
- package/src/main/js/git.js +2 -3
- package/src/main/js/meta.js +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [2.2.9](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.8...v2.2.9) (2023-03-24)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* refactor: wrap git pushers with queuefy ([2e9355f](https://github.com/semrel-extra/zx-bulk-release/commit/2e9355f69724a8ba097024456cbe5a80f37ea2a7))
|
|
5
|
+
|
|
1
6
|
## [2.2.8](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.7...v2.2.8) (2023-03-24)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/gh.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import {queuefy} from 'queuefy'
|
|
2
|
+
import {$, path} from 'zx-extra'
|
|
1
3
|
import {log} from './log.js'
|
|
2
4
|
import {getRepo, pushCommit} from './git.js'
|
|
3
5
|
import {formatTag} from './meta.js'
|
|
4
6
|
import {formatReleaseNotes} from './changelog.js'
|
|
5
|
-
import {$, path} from 'zx-extra'
|
|
6
7
|
import {msgJoin} from './util.js'
|
|
7
8
|
|
|
8
9
|
export const ghRelease = async (pkg) => {
|
|
@@ -24,7 +25,7 @@ export const ghRelease = async (pkg) => {
|
|
|
24
25
|
await $.o({cwd})`curl -H 'Authorization: token ${ghToken}' -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${repoName}/releases -d ${releaseData}`
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export const ghPages = async (pkg) => {
|
|
28
|
+
export const ghPages = queuefy(async (pkg) => {
|
|
28
29
|
const {config: {ghPages: opts, gitCommitterEmail, gitCommitterName, ghBasicAuth: basicAuth}} = pkg
|
|
29
30
|
if (!opts) return
|
|
30
31
|
|
|
@@ -45,4 +46,4 @@ export const ghPages = async (pkg) => {
|
|
|
45
46
|
gitCommitterName,
|
|
46
47
|
basicAuth
|
|
47
48
|
})
|
|
48
|
-
}
|
|
49
|
+
})
|
package/src/main/js/git.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {$, ctx, fs, path, tempy, copy} from 'zx-extra'
|
|
2
2
|
import {log} from './log.js'
|
|
3
3
|
import {memoizeBy} from './util.js'
|
|
4
|
-
import {queuefy} from 'queuefy'
|
|
5
4
|
|
|
6
5
|
export const fetchRepo = memoizeBy(async ({cwd: _cwd, branch, origin: _origin, basicAuth}) => ctx(async ($) => {
|
|
7
6
|
const origin = _origin || (await getRepo(_cwd, {basicAuth})).repoAuthedUrl
|
|
@@ -18,7 +17,7 @@ export const fetchRepo = memoizeBy(async ({cwd: _cwd, branch, origin: _origin, b
|
|
|
18
17
|
return cwd
|
|
19
18
|
}), async ({cwd, branch}) => `${await getRoot(cwd)}:${branch}`)
|
|
20
19
|
|
|
21
|
-
export const pushCommit =
|
|
20
|
+
export const pushCommit = async ({cwd, from, to, branch, origin, msg, ignoreFiles, files = [], basicAuth, gitCommitterEmail, gitCommitterName}) => ctx(async ($) => {
|
|
22
21
|
let retries = 3
|
|
23
22
|
|
|
24
23
|
const _cwd = await fetchRepo({cwd, branch, origin, basicAuth})
|
|
@@ -54,7 +53,7 @@ export const pushCommit = queuefy(async ({cwd, from, to, branch, origin, msg, ig
|
|
|
54
53
|
await $`git pull --rebase origin ${branch}`
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
})
|
|
56
|
+
})
|
|
58
57
|
|
|
59
58
|
export const getRoot = async (cwd) => (await $.o({cwd})`git rev-parse --show-toplevel`).toString().trim()
|
|
60
59
|
|
package/src/main/js/meta.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Semantic tags processing
|
|
2
2
|
|
|
3
|
+
import {Buffer} from 'node:buffer'
|
|
4
|
+
import {queuefy} from 'queuefy'
|
|
3
5
|
import {ctx, semver, $, fs, path} from 'zx-extra'
|
|
4
|
-
import {Buffer} from 'buffer'
|
|
5
6
|
import {log} from './log.js'
|
|
6
7
|
import {fetchRepo, pushCommit, getTags as getGitTags} from './git.js'
|
|
7
8
|
import {fetchManifest} from './npm.js'
|
|
@@ -20,7 +21,7 @@ export const pushTag = (pkg) => ctx(async ($) => {
|
|
|
20
21
|
await $`git push origin ${tag}`
|
|
21
22
|
})
|
|
22
23
|
|
|
23
|
-
export const pushMeta = async (pkg) => {
|
|
24
|
+
export const pushMeta = queuefy(async (pkg) => {
|
|
24
25
|
log({pkg})('push artifact to branch \'meta\'')
|
|
25
26
|
|
|
26
27
|
const {name, version, absPath: cwd, config: {gitCommitterEmail, gitCommitterName, ghBasicAuth: basicAuth}} = pkg
|
|
@@ -42,7 +43,7 @@ export const pushMeta = async (pkg) => {
|
|
|
42
43
|
const files = [{relpath: `${getArtifactPath(tag)}.json`, contents: meta}]
|
|
43
44
|
|
|
44
45
|
await pushCommit({cwd, to, branch, msg, files, gitCommitterEmail, gitCommitterName, basicAuth})
|
|
45
|
-
}
|
|
46
|
+
})
|
|
46
47
|
|
|
47
48
|
export const getLatest = async (pkg) => {
|
|
48
49
|
const {absPath: cwd, name, config: {ghBasicAuth: basicAuth}} = pkg
|