@thisismanta/semantic-version 2.0.0-0 → 2.0.0-2
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/lib/auto-npm-version.js +4 -3
- package/package.json +1 -1
package/lib/auto-npm-version.js
CHANGED
|
@@ -33,6 +33,7 @@ const index_1 = require("./index");
|
|
|
33
33
|
const debug_1 = require("./debug");
|
|
34
34
|
main();
|
|
35
35
|
async function main() {
|
|
36
|
+
await run('git fetch --tags');
|
|
36
37
|
const lastVersion = semver_1.default.valid(await run('git describe --tags --abbrev=0') ||
|
|
37
38
|
await run('npm pkg get version'));
|
|
38
39
|
(0, debug_1.debug)('lastVersion »', JSON.stringify(lastVersion));
|
|
@@ -62,7 +63,7 @@ async function main() {
|
|
|
62
63
|
if (releaseType === 'minor' || type === 'feat') {
|
|
63
64
|
return releaseType;
|
|
64
65
|
}
|
|
65
|
-
if (type === 'fix') {
|
|
66
|
+
if (type === 'fix' || type === 'refactor') {
|
|
66
67
|
return 'patch';
|
|
67
68
|
}
|
|
68
69
|
return releaseType;
|
|
@@ -106,12 +107,12 @@ async function main() {
|
|
|
106
107
|
(0, debug_1.debug)('releaseNote »', releaseNote);
|
|
107
108
|
const octokit = github.getOctokit(process.env.GITHUB_TOKEN);
|
|
108
109
|
// See https://octokit.github.io/rest.js/v19#repos-create-release
|
|
109
|
-
const
|
|
110
|
+
const releaseRespond = await octokit.rest.repos.createRelease({
|
|
110
111
|
...github.context.repo,
|
|
111
112
|
tag_name: nextVersion,
|
|
112
113
|
body: releaseNote,
|
|
113
114
|
});
|
|
114
|
-
(0, debug_1.debug)('
|
|
115
|
+
(0, debug_1.debug)('releaseRespond »', JSON.stringify(releaseRespond, null, 2));
|
|
115
116
|
console.log('Created a new release on GitHub');
|
|
116
117
|
}
|
|
117
118
|
}
|