@jsenv/github-release-package 1.2.3 → 1.3.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/{license → LICENSE} +0 -0
- package/README.md +3 -0
- package/{index.js → main.js} +0 -0
- package/package.json +28 -35
- package/src/ensureGithubReleaseForPackage.js +63 -67
- package/src/internal/createGithubRelease.js +0 -3
- package/src/internal/getGithubRelease.js +0 -4
- package/src/internal/readProjectPackage.js +1 -3
- package/dist/commonjs/jsenv_publish_node_package.cjs +0 -268
- package/dist/commonjs/jsenv_publish_node_package.cjs.map +0 -92
- package/readme.md +0 -26
package/{license → LICENSE}
RENAMED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Github Release Package [](https://www.npmjs.com/package/@jsenv/github-release-package) [](https://github.com/jsenv/github-release-package/actions?workflow=main) [](https://codecov.io/gh/jsenv/github-release-package)
|
|
2
|
+
|
|
3
|
+
Create github release for package version updates.
|
package/{index.js → main.js}
RENAMED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/github-release-package",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Create github release when package version changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "dmail",
|
|
8
|
+
"email": "dmaillard06@gmail.com",
|
|
9
|
+
"url": "https://twitter.com/damienmaillard"
|
|
10
|
+
},
|
|
6
11
|
"repository": {
|
|
7
12
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/jsenv/
|
|
13
|
+
"url": "https://github.com/jsenv/github-release-package"
|
|
9
14
|
},
|
|
10
15
|
"engines": {
|
|
11
|
-
"node": ">=
|
|
16
|
+
"node": ">=16.13.0"
|
|
12
17
|
},
|
|
13
18
|
"publishConfig": {
|
|
14
19
|
"access": "public",
|
|
@@ -17,48 +22,36 @@
|
|
|
17
22
|
"type": "module",
|
|
18
23
|
"exports": {
|
|
19
24
|
".": {
|
|
20
|
-
"import": "./
|
|
21
|
-
"require": "./dist/commonjs/jsenv_publish_node_package.cjs"
|
|
25
|
+
"import": "./main.js"
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
|
-
"main": "
|
|
28
|
+
"main": "./main.js",
|
|
25
29
|
"files": [
|
|
26
|
-
"/dist/",
|
|
27
30
|
"/src/",
|
|
28
|
-
"/
|
|
31
|
+
"/main.js"
|
|
29
32
|
],
|
|
30
33
|
"scripts": {
|
|
31
|
-
"eslint
|
|
32
|
-
"
|
|
33
|
-
"test
|
|
34
|
-
"
|
|
35
|
-
"prettier
|
|
36
|
-
"prettier-check": "npm run prettier-format -- --dry-run",
|
|
37
|
-
"upload-coverage": "node ./script/upload-coverage/upload-coverage.js",
|
|
38
|
-
"build": "node --experimental-import-meta-resolve ./script/build/build.js",
|
|
39
|
-
"generate-import-map": "node ./script/generate-import-map/generate-import-map.js",
|
|
40
|
-
"dist": "npm run build",
|
|
41
|
-
"prepublishOnly": "node ./script/transform-package/remove-postinstall.js && npm run dist",
|
|
42
|
-
"postpublish": "node ./script/transform-package/restore-postinstall.js"
|
|
34
|
+
"eslint": "node ./node_modules/eslint/bin/eslint.js . --ext=.js,.mjs",
|
|
35
|
+
"importmap": "node ./script/importmap/importmap.mjs",
|
|
36
|
+
"test": "node ./script/test/test.mjs",
|
|
37
|
+
"test-with-coverage": "npm run test -- --coverage",
|
|
38
|
+
"prettier": "prettier --write ."
|
|
43
39
|
},
|
|
44
40
|
"dependencies": {
|
|
41
|
+
"@jsenv/filesystem": "2.7.1",
|
|
45
42
|
"@jsenv/logger": "4.0.1",
|
|
46
|
-
"@jsenv/server": "
|
|
47
|
-
"@jsenv/util": "4.1.1"
|
|
43
|
+
"@jsenv/server": "12.4.0"
|
|
48
44
|
},
|
|
49
45
|
"devDependencies": {
|
|
50
|
-
"@jsenv/assert": "2.
|
|
51
|
-
"@jsenv/
|
|
52
|
-
"@jsenv/
|
|
53
|
-
"@jsenv/
|
|
54
|
-
"@jsenv/
|
|
55
|
-
"@jsenv/
|
|
56
|
-
"@jsenv/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"eslint": "7.26.0",
|
|
61
|
-
"eslint-plugin-import": "2.22.1",
|
|
62
|
-
"prettier": "2.3.0"
|
|
46
|
+
"@jsenv/assert": "2.4.1",
|
|
47
|
+
"@jsenv/core": "25.3.0",
|
|
48
|
+
"@jsenv/eslint-config": "16.0.9",
|
|
49
|
+
"@jsenv/importmap-eslint-resolver": "5.2.5",
|
|
50
|
+
"@jsenv/importmap-node-module": "5.1.0",
|
|
51
|
+
"@jsenv/package-publish": "1.6.2",
|
|
52
|
+
"@jsenv/performance-impact": "2.2.1",
|
|
53
|
+
"eslint": "8.7.0",
|
|
54
|
+
"eslint-plugin-import": "2.25.4",
|
|
55
|
+
"prettier": "2.5.1"
|
|
63
56
|
}
|
|
64
57
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem"
|
|
1
2
|
import { createLogger } from "@jsenv/logger"
|
|
2
|
-
import { assertAndNormalizeDirectoryUrl } from "@jsenv/util"
|
|
3
|
-
import { executeAsyncFunction, createCancellationTokenForProcess } from "@jsenv/cancellation"
|
|
4
3
|
|
|
5
4
|
import { readProjectPackage } from "./internal/readProjectPackage.js"
|
|
6
5
|
import { getGithubRelease } from "./internal/getGithubRelease.js"
|
|
@@ -8,105 +7,102 @@ import { createGithubRelease } from "./internal/createGithubRelease.js"
|
|
|
8
7
|
|
|
9
8
|
export const ensureGithubReleaseForPackage = async ({
|
|
10
9
|
logLevel,
|
|
11
|
-
cancellationToken = createCancellationTokenForProcess(),
|
|
12
10
|
projectDirectoryUrl,
|
|
13
|
-
updateProcessExitCode = true,
|
|
14
11
|
}) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const logger = createLogger({ logLevel })
|
|
13
|
+
logger.debug(
|
|
14
|
+
`autoReleaseOnGithub(${JSON.stringify(
|
|
15
|
+
{ projectDirectoryUrl, logLevel },
|
|
16
|
+
null,
|
|
17
|
+
" ",
|
|
18
|
+
)})`,
|
|
19
|
+
)
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
projectDirectoryUrl = assertAndNormalizeDirectoryUrl(projectDirectoryUrl)
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const {
|
|
24
|
+
githubToken,
|
|
25
|
+
githubRepositoryOwner,
|
|
26
|
+
githubRepositoryName,
|
|
27
|
+
githubSha,
|
|
28
|
+
} = getOptionsFromGithubAction()
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
logger.debug(`reading project package.json`)
|
|
31
|
+
const { packageVersion } = await getOptionsFromProjectPackage({
|
|
32
|
+
projectDirectoryUrl,
|
|
33
|
+
})
|
|
34
|
+
logger.debug(`${packageVersion} found in package.json`)
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
logger.debug(`search release for ${packageVersion} on github`)
|
|
37
|
+
const githubReleaseName = `v${packageVersion}`
|
|
38
|
+
const existingRelease = await getGithubRelease({
|
|
39
|
+
githubToken,
|
|
40
|
+
githubRepositoryOwner,
|
|
41
|
+
githubRepositoryName,
|
|
42
|
+
githubReleaseName,
|
|
43
|
+
})
|
|
44
|
+
if (existingRelease) {
|
|
45
|
+
logger.info(
|
|
46
|
+
`${packageVersion} already released at ${generateReleaseUrl({
|
|
36
47
|
githubRepositoryOwner,
|
|
37
48
|
githubRepositoryName,
|
|
38
49
|
githubReleaseName,
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`${packageVersion} already released at ${generateReleaseUrl({
|
|
44
|
-
githubRepositoryOwner,
|
|
45
|
-
githubRepositoryName,
|
|
46
|
-
githubReleaseName,
|
|
47
|
-
})}`,
|
|
48
|
-
)
|
|
49
|
-
return
|
|
50
|
-
}
|
|
50
|
+
})}`,
|
|
51
|
+
)
|
|
52
|
+
return
|
|
53
|
+
}
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
logger.info(
|
|
61
|
-
`release created at ${generateReleaseUrl({
|
|
62
|
-
githubRepositoryOwner,
|
|
63
|
-
githubRepositoryName,
|
|
64
|
-
githubReleaseName,
|
|
65
|
-
})}`,
|
|
66
|
-
)
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
catchCancellation: true,
|
|
70
|
-
considerUnhandledRejectionsAsExceptions: true,
|
|
71
|
-
},
|
|
72
|
-
).catch((e) => {
|
|
73
|
-
if (updateProcessExitCode) {
|
|
74
|
-
process.exitCode = 1
|
|
75
|
-
}
|
|
76
|
-
throw e
|
|
55
|
+
logger.info(`creating release for ${packageVersion}`)
|
|
56
|
+
await createGithubRelease({
|
|
57
|
+
githubToken,
|
|
58
|
+
githubRepositoryOwner,
|
|
59
|
+
githubRepositoryName,
|
|
60
|
+
githubSha,
|
|
61
|
+
githubReleaseName,
|
|
77
62
|
})
|
|
63
|
+
logger.info(
|
|
64
|
+
`release created at ${generateReleaseUrl({
|
|
65
|
+
githubRepositoryOwner,
|
|
66
|
+
githubRepositoryName,
|
|
67
|
+
githubReleaseName,
|
|
68
|
+
})}`,
|
|
69
|
+
)
|
|
78
70
|
}
|
|
79
71
|
|
|
80
|
-
const generateReleaseUrl = ({
|
|
72
|
+
const generateReleaseUrl = ({
|
|
73
|
+
githubRepositoryOwner,
|
|
74
|
+
githubRepositoryName,
|
|
75
|
+
githubReleaseName,
|
|
76
|
+
}) => {
|
|
81
77
|
return `https://github.com/${githubRepositoryOwner}/${githubRepositoryName}/releases/tag/${githubReleaseName}`
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
const getOptionsFromGithubAction = () => {
|
|
85
81
|
const eventName = process.env.GITHUB_EVENT_NAME
|
|
86
82
|
if (!eventName) {
|
|
87
|
-
throw new Error(
|
|
83
|
+
throw new Error(
|
|
84
|
+
`missing process.env.GITHUB_EVENT_NAME, we are not in a github action`,
|
|
85
|
+
)
|
|
88
86
|
}
|
|
89
87
|
if (eventName !== "push") {
|
|
90
|
-
throw new Error(
|
|
88
|
+
throw new Error(
|
|
89
|
+
`getOptionsFromGithubAction must be called only in a push action`,
|
|
90
|
+
)
|
|
91
91
|
}
|
|
92
|
-
|
|
93
92
|
const githubRepository = process.env.GITHUB_REPOSITORY
|
|
94
93
|
if (!githubRepository) {
|
|
95
94
|
throw new Error(`missing process.env.GITHUB_REPOSITORY`)
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const [githubRepositoryOwner, githubRepositoryName] =
|
|
97
|
+
githubRepository.split("/")
|
|
100
98
|
const githubToken = process.env.GITHUB_TOKEN
|
|
101
99
|
if (!githubToken) {
|
|
102
100
|
throw new Error(`missing process.env.GITHUB_TOKEN`)
|
|
103
101
|
}
|
|
104
|
-
|
|
105
102
|
const githubSha = process.env.GITHUB_SHA
|
|
106
103
|
if (!githubSha) {
|
|
107
104
|
throw new Error(`missing process.env.GITHUB_SHA`)
|
|
108
105
|
}
|
|
109
|
-
|
|
110
106
|
return {
|
|
111
107
|
githubRepositoryOwner,
|
|
112
108
|
githubRepositoryName,
|
|
@@ -22,9 +22,7 @@ export const createGithubRelease = async ({
|
|
|
22
22
|
method: "POST",
|
|
23
23
|
body,
|
|
24
24
|
})
|
|
25
|
-
|
|
26
25
|
const responseStatus = response.status
|
|
27
|
-
|
|
28
26
|
if (responseStatus !== 201) {
|
|
29
27
|
throw new Error(
|
|
30
28
|
writeUnexpectedResponseStatus({
|
|
@@ -34,7 +32,6 @@ export const createGithubRelease = async ({
|
|
|
34
32
|
}),
|
|
35
33
|
)
|
|
36
34
|
}
|
|
37
|
-
|
|
38
35
|
const responseJson = await response.json()
|
|
39
36
|
return responseJson
|
|
40
37
|
}
|
|
@@ -15,13 +15,10 @@ export const getGithubRelease = async ({
|
|
|
15
15
|
},
|
|
16
16
|
method: "GET",
|
|
17
17
|
})
|
|
18
|
-
|
|
19
18
|
const responseStatus = response.status
|
|
20
|
-
|
|
21
19
|
if (responseStatus === 404) {
|
|
22
20
|
return null
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
if (responseStatus !== 200) {
|
|
26
23
|
throw new Error(
|
|
27
24
|
writeUnexpectedResponseStatus({
|
|
@@ -31,7 +28,6 @@ export const getGithubRelease = async ({
|
|
|
31
28
|
}),
|
|
32
29
|
)
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
const responseJson = await response.json()
|
|
36
32
|
return responseJson
|
|
37
33
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { resolveUrl, urlToFileSystemPath, readFile } from "@jsenv/
|
|
1
|
+
import { resolveUrl, urlToFileSystemPath, readFile } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
3
|
export const readProjectPackage = async ({ projectDirectoryUrl }) => {
|
|
4
4
|
const packageFileUrl = resolveUrl("./package.json", projectDirectoryUrl)
|
|
5
|
-
|
|
6
5
|
let packageInProject
|
|
7
6
|
try {
|
|
8
7
|
const packageString = await readFile(packageFileUrl)
|
|
@@ -28,6 +27,5 @@ ${urlToFileSystemPath(packageFileUrl)}`,
|
|
|
28
27
|
}
|
|
29
28
|
throw e
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
return packageInProject
|
|
33
31
|
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var logger = require('@jsenv/logger');
|
|
6
|
-
var util = require('@jsenv/util');
|
|
7
|
-
var cancellation = require('@jsenv/cancellation');
|
|
8
|
-
var server = require('@jsenv/server');
|
|
9
|
-
|
|
10
|
-
const readProjectPackage = async ({
|
|
11
|
-
projectDirectoryUrl
|
|
12
|
-
}) => {
|
|
13
|
-
const packageFileUrl = util.resolveUrl("./package.json", projectDirectoryUrl);
|
|
14
|
-
let packageInProject;
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const packageString = await util.readFile(packageFileUrl);
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
packageInProject = JSON.parse(packageString);
|
|
21
|
-
} catch (e) {
|
|
22
|
-
if (e.name === "SyntaxError") {
|
|
23
|
-
throw new Error(`syntax error while parsing project package.json
|
|
24
|
-
--- syntax error stack ---
|
|
25
|
-
${e.stack}
|
|
26
|
-
--- package.json path ---
|
|
27
|
-
${util.urlToFileSystemPath(packageFileUrl)}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
throw e;
|
|
31
|
-
}
|
|
32
|
-
} catch (e) {
|
|
33
|
-
if (e.code === "ENOENT") {
|
|
34
|
-
throw new Error(`cannot find project package.json
|
|
35
|
-
--- package.json path ---
|
|
36
|
-
${util.urlToFileSystemPath(packageFileUrl)}`);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return packageInProject;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// https://developer.github.com/v3/git/refs/#get-a-single-reference
|
|
46
|
-
const getGithubRelease = async ({
|
|
47
|
-
githubToken,
|
|
48
|
-
githubRepositoryOwner,
|
|
49
|
-
githubRepositoryName,
|
|
50
|
-
githubReleaseName
|
|
51
|
-
}) => {
|
|
52
|
-
const requestUrl = `https://api.github.com/repos/${githubRepositoryOwner}/${githubRepositoryName}/git/ref/tags/${githubReleaseName}`;
|
|
53
|
-
const response = await server.fetchUrl(requestUrl, {
|
|
54
|
-
headers: {
|
|
55
|
-
authorization: `token ${githubToken}`
|
|
56
|
-
},
|
|
57
|
-
method: "GET"
|
|
58
|
-
});
|
|
59
|
-
const responseStatus = response.status;
|
|
60
|
-
|
|
61
|
-
if (responseStatus === 404) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (responseStatus !== 200) {
|
|
66
|
-
throw new Error(writeUnexpectedResponseStatus$1({
|
|
67
|
-
requestUrl,
|
|
68
|
-
responseStatus,
|
|
69
|
-
responseText: await response.text()
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const responseJson = await response.json();
|
|
74
|
-
return responseJson;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const writeUnexpectedResponseStatus$1 = ({
|
|
78
|
-
requestUrl,
|
|
79
|
-
responseStatus,
|
|
80
|
-
responseText
|
|
81
|
-
}) => `github api response status should be 200.
|
|
82
|
-
--- request url ----
|
|
83
|
-
${requestUrl}
|
|
84
|
-
--- response status ---
|
|
85
|
-
${responseStatus}
|
|
86
|
-
--- response text ---
|
|
87
|
-
${responseText}`;
|
|
88
|
-
|
|
89
|
-
// https://developer.github.com/v3/git/tags/
|
|
90
|
-
const createGithubRelease = async ({
|
|
91
|
-
githubToken,
|
|
92
|
-
githubRepositoryOwner,
|
|
93
|
-
githubRepositoryName,
|
|
94
|
-
githubSha,
|
|
95
|
-
githubReleaseName
|
|
96
|
-
}) => {
|
|
97
|
-
const requestUrl = `https://api.github.com/repos/${githubRepositoryOwner}/${githubRepositoryName}/git/refs`;
|
|
98
|
-
const body = JSON.stringify({
|
|
99
|
-
ref: `refs/tags/${githubReleaseName}`,
|
|
100
|
-
sha: githubSha
|
|
101
|
-
});
|
|
102
|
-
const response = await server.fetchUrl(requestUrl, {
|
|
103
|
-
headers: {
|
|
104
|
-
"authorization": `token ${githubToken}`,
|
|
105
|
-
"content-length": Buffer.byteLength(body)
|
|
106
|
-
},
|
|
107
|
-
method: "POST",
|
|
108
|
-
body
|
|
109
|
-
});
|
|
110
|
-
const responseStatus = response.status;
|
|
111
|
-
|
|
112
|
-
if (responseStatus !== 201) {
|
|
113
|
-
throw new Error(writeUnexpectedResponseStatus({
|
|
114
|
-
requestUrl,
|
|
115
|
-
responseStatus,
|
|
116
|
-
responseText: await response.text()
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const responseJson = await response.json();
|
|
121
|
-
return responseJson;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const writeUnexpectedResponseStatus = ({
|
|
125
|
-
requestUrl,
|
|
126
|
-
responseStatus,
|
|
127
|
-
responseText
|
|
128
|
-
}) => `github api response status should be 201.
|
|
129
|
-
--- request url ----
|
|
130
|
-
${requestUrl}
|
|
131
|
-
--- response status ---
|
|
132
|
-
${responseStatus}
|
|
133
|
-
--- response text ---
|
|
134
|
-
${responseText}`;
|
|
135
|
-
|
|
136
|
-
const ensureGithubReleaseForPackage = async ({
|
|
137
|
-
logLevel,
|
|
138
|
-
cancellationToken = cancellation.createCancellationTokenForProcess(),
|
|
139
|
-
projectDirectoryUrl,
|
|
140
|
-
updateProcessExitCode = true
|
|
141
|
-
}) => {
|
|
142
|
-
return cancellation.executeAsyncFunction(async () => {
|
|
143
|
-
const logger$1 = logger.createLogger({
|
|
144
|
-
logLevel
|
|
145
|
-
});
|
|
146
|
-
logger$1.debug(`autoReleaseOnGithub(${JSON.stringify({
|
|
147
|
-
projectDirectoryUrl,
|
|
148
|
-
logLevel
|
|
149
|
-
}, null, " ")})`);
|
|
150
|
-
projectDirectoryUrl = util.assertAndNormalizeDirectoryUrl(projectDirectoryUrl);
|
|
151
|
-
const {
|
|
152
|
-
githubToken,
|
|
153
|
-
githubRepositoryOwner,
|
|
154
|
-
githubRepositoryName,
|
|
155
|
-
githubSha
|
|
156
|
-
} = getOptionsFromGithubAction();
|
|
157
|
-
logger$1.debug(`reading project package.json`);
|
|
158
|
-
const {
|
|
159
|
-
packageVersion
|
|
160
|
-
} = await getOptionsFromProjectPackage({
|
|
161
|
-
projectDirectoryUrl
|
|
162
|
-
});
|
|
163
|
-
cancellationToken.throwIfRequested();
|
|
164
|
-
logger$1.debug(`${packageVersion} found in package.json`);
|
|
165
|
-
logger$1.debug(`search release for ${packageVersion} on github`);
|
|
166
|
-
const githubReleaseName = `v${packageVersion}`;
|
|
167
|
-
const existingRelease = await getGithubRelease({
|
|
168
|
-
githubToken,
|
|
169
|
-
githubRepositoryOwner,
|
|
170
|
-
githubRepositoryName,
|
|
171
|
-
githubReleaseName
|
|
172
|
-
});
|
|
173
|
-
cancellationToken.throwIfRequested();
|
|
174
|
-
|
|
175
|
-
if (existingRelease) {
|
|
176
|
-
logger$1.info(`${packageVersion} already released at ${generateReleaseUrl({
|
|
177
|
-
githubRepositoryOwner,
|
|
178
|
-
githubRepositoryName,
|
|
179
|
-
githubReleaseName
|
|
180
|
-
})}`);
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
logger$1.info(`creating release for ${packageVersion}`);
|
|
185
|
-
await createGithubRelease({
|
|
186
|
-
githubToken,
|
|
187
|
-
githubRepositoryOwner,
|
|
188
|
-
githubRepositoryName,
|
|
189
|
-
githubSha,
|
|
190
|
-
githubReleaseName
|
|
191
|
-
});
|
|
192
|
-
logger$1.info(`release created at ${generateReleaseUrl({
|
|
193
|
-
githubRepositoryOwner,
|
|
194
|
-
githubRepositoryName,
|
|
195
|
-
githubReleaseName
|
|
196
|
-
})}`);
|
|
197
|
-
}, {
|
|
198
|
-
catchCancellation: true,
|
|
199
|
-
considerUnhandledRejectionsAsExceptions: true
|
|
200
|
-
}).catch(e => {
|
|
201
|
-
if (updateProcessExitCode) {
|
|
202
|
-
process.exitCode = 1;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
throw e;
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const generateReleaseUrl = ({
|
|
210
|
-
githubRepositoryOwner,
|
|
211
|
-
githubRepositoryName,
|
|
212
|
-
githubReleaseName
|
|
213
|
-
}) => {
|
|
214
|
-
return `https://github.com/${githubRepositoryOwner}/${githubRepositoryName}/releases/tag/${githubReleaseName}`;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const getOptionsFromGithubAction = () => {
|
|
218
|
-
const eventName = process.env.GITHUB_EVENT_NAME;
|
|
219
|
-
|
|
220
|
-
if (!eventName) {
|
|
221
|
-
throw new Error(`missing process.env.GITHUB_EVENT_NAME, we are not in a github action`);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (eventName !== "push") {
|
|
225
|
-
throw new Error(`getOptionsFromGithubAction must be called only in a push action`);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const githubRepository = process.env.GITHUB_REPOSITORY;
|
|
229
|
-
|
|
230
|
-
if (!githubRepository) {
|
|
231
|
-
throw new Error(`missing process.env.GITHUB_REPOSITORY`);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const [githubRepositoryOwner, githubRepositoryName] = githubRepository.split("/");
|
|
235
|
-
const githubToken = process.env.GITHUB_TOKEN;
|
|
236
|
-
|
|
237
|
-
if (!githubToken) {
|
|
238
|
-
throw new Error(`missing process.env.GITHUB_TOKEN`);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const githubSha = process.env.GITHUB_SHA;
|
|
242
|
-
|
|
243
|
-
if (!githubSha) {
|
|
244
|
-
throw new Error(`missing process.env.GITHUB_SHA`);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return {
|
|
248
|
-
githubRepositoryOwner,
|
|
249
|
-
githubRepositoryName,
|
|
250
|
-
githubToken,
|
|
251
|
-
githubSha
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const getOptionsFromProjectPackage = async ({
|
|
256
|
-
projectDirectoryUrl
|
|
257
|
-
}) => {
|
|
258
|
-
const projectPackage = await readProjectPackage({
|
|
259
|
-
projectDirectoryUrl
|
|
260
|
-
});
|
|
261
|
-
return {
|
|
262
|
-
packageVersion: projectPackage.version
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
exports.ensureGithubReleaseForPackage = ensureGithubReleaseForPackage;
|
|
267
|
-
|
|
268
|
-
//# sourceMappingURL=jsenv_publish_node_package.cjs.map
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "jsenv_publish_node_package.cjs",
|
|
4
|
-
"sources": [
|
|
5
|
-
"../../src/internal/readProjectPackage.js",
|
|
6
|
-
"../../src/internal/getGithubRelease.js",
|
|
7
|
-
"../../src/internal/createGithubRelease.js",
|
|
8
|
-
"../../src/ensureGithubReleaseForPackage.js"
|
|
9
|
-
],
|
|
10
|
-
"sourcesContent": [
|
|
11
|
-
"import { resolveUrl, urlToFileSystemPath, readFile } from \"@jsenv/util\"\n\nexport const readProjectPackage = async ({ projectDirectoryUrl }) => {\n const packageFileUrl = resolveUrl(\"./package.json\", projectDirectoryUrl)\n\n let packageInProject\n try {\n const packageString = await readFile(packageFileUrl)\n try {\n packageInProject = JSON.parse(packageString)\n } catch (e) {\n if (e.name === \"SyntaxError\") {\n throw new Error(`syntax error while parsing project package.json\n--- syntax error stack ---\n${e.stack}\n--- package.json path ---\n${urlToFileSystemPath(packageFileUrl)}`)\n }\n throw e\n }\n } catch (e) {\n if (e.code === \"ENOENT\") {\n throw new Error(\n `cannot find project package.json\n--- package.json path ---\n${urlToFileSystemPath(packageFileUrl)}`,\n )\n }\n throw e\n }\n\n return packageInProject\n}\n",
|
|
12
|
-
"// https://developer.github.com/v3/git/refs/#get-a-single-reference\n\nimport { fetchUrl } from \"@jsenv/server\"\n\nexport const getGithubRelease = async ({\n githubToken,\n githubRepositoryOwner,\n githubRepositoryName,\n githubReleaseName,\n}) => {\n const requestUrl = `https://api.github.com/repos/${githubRepositoryOwner}/${githubRepositoryName}/git/ref/tags/${githubReleaseName}`\n const response = await fetchUrl(requestUrl, {\n headers: {\n authorization: `token ${githubToken}`,\n },\n method: \"GET\",\n })\n\n const responseStatus = response.status\n\n if (responseStatus === 404) {\n return null\n }\n\n if (responseStatus !== 200) {\n throw new Error(\n writeUnexpectedResponseStatus({\n requestUrl,\n responseStatus,\n responseText: await response.text(),\n }),\n )\n }\n\n const responseJson = await response.json()\n return responseJson\n}\n\nconst writeUnexpectedResponseStatus = ({\n requestUrl,\n responseStatus,\n responseText,\n}) => `github api response status should be 200.\n--- request url ----\n${requestUrl}\n--- response status ---\n${responseStatus}\n--- response text ---\n${responseText}`\n",
|
|
13
|
-
"// https://developer.github.com/v3/git/tags/\n\nimport { fetchUrl } from \"@jsenv/server\"\n\nexport const createGithubRelease = async ({\n githubToken,\n githubRepositoryOwner,\n githubRepositoryName,\n githubSha,\n githubReleaseName,\n}) => {\n const requestUrl = `https://api.github.com/repos/${githubRepositoryOwner}/${githubRepositoryName}/git/refs`\n const body = JSON.stringify({\n ref: `refs/tags/${githubReleaseName}`,\n sha: githubSha,\n })\n const response = await fetchUrl(requestUrl, {\n headers: {\n \"authorization\": `token ${githubToken}`,\n \"content-length\": Buffer.byteLength(body),\n },\n method: \"POST\",\n body,\n })\n\n const responseStatus = response.status\n\n if (responseStatus !== 201) {\n throw new Error(\n writeUnexpectedResponseStatus({\n requestUrl,\n responseStatus,\n responseText: await response.text(),\n }),\n )\n }\n\n const responseJson = await response.json()\n return responseJson\n}\n\nconst writeUnexpectedResponseStatus = ({\n requestUrl,\n responseStatus,\n responseText,\n}) => `github api response status should be 201.\n--- request url ----\n${requestUrl}\n--- response status ---\n${responseStatus}\n--- response text ---\n${responseText}`\n",
|
|
14
|
-
"import { createLogger } from \"@jsenv/logger\"\nimport { assertAndNormalizeDirectoryUrl } from \"@jsenv/util\"\nimport { executeAsyncFunction, createCancellationTokenForProcess } from \"@jsenv/cancellation\"\n\nimport { readProjectPackage } from \"./internal/readProjectPackage.js\"\nimport { getGithubRelease } from \"./internal/getGithubRelease.js\"\nimport { createGithubRelease } from \"./internal/createGithubRelease.js\"\n\nexport const ensureGithubReleaseForPackage = async ({\n logLevel,\n cancellationToken = createCancellationTokenForProcess(),\n projectDirectoryUrl,\n updateProcessExitCode = true,\n}) => {\n return executeAsyncFunction(\n async () => {\n const logger = createLogger({ logLevel })\n logger.debug(\n `autoReleaseOnGithub(${JSON.stringify({ projectDirectoryUrl, logLevel }, null, \" \")})`,\n )\n\n projectDirectoryUrl = assertAndNormalizeDirectoryUrl(projectDirectoryUrl)\n\n const { githubToken, githubRepositoryOwner, githubRepositoryName, githubSha } =\n getOptionsFromGithubAction()\n\n logger.debug(`reading project package.json`)\n const { packageVersion } = await getOptionsFromProjectPackage({ projectDirectoryUrl })\n cancellationToken.throwIfRequested()\n logger.debug(`${packageVersion} found in package.json`)\n\n logger.debug(`search release for ${packageVersion} on github`)\n const githubReleaseName = `v${packageVersion}`\n const existingRelease = await getGithubRelease({\n githubToken,\n githubRepositoryOwner,\n githubRepositoryName,\n githubReleaseName,\n })\n cancellationToken.throwIfRequested()\n if (existingRelease) {\n logger.info(\n `${packageVersion} already released at ${generateReleaseUrl({\n githubRepositoryOwner,\n githubRepositoryName,\n githubReleaseName,\n })}`,\n )\n return\n }\n\n logger.info(`creating release for ${packageVersion}`)\n await createGithubRelease({\n githubToken,\n githubRepositoryOwner,\n githubRepositoryName,\n githubSha,\n githubReleaseName,\n })\n logger.info(\n `release created at ${generateReleaseUrl({\n githubRepositoryOwner,\n githubRepositoryName,\n githubReleaseName,\n })}`,\n )\n },\n {\n catchCancellation: true,\n considerUnhandledRejectionsAsExceptions: true,\n },\n ).catch((e) => {\n if (updateProcessExitCode) {\n process.exitCode = 1\n }\n throw e\n })\n}\n\nconst generateReleaseUrl = ({ githubRepositoryOwner, githubRepositoryName, githubReleaseName }) => {\n return `https://github.com/${githubRepositoryOwner}/${githubRepositoryName}/releases/tag/${githubReleaseName}`\n}\n\nconst getOptionsFromGithubAction = () => {\n const eventName = process.env.GITHUB_EVENT_NAME\n if (!eventName) {\n throw new Error(`missing process.env.GITHUB_EVENT_NAME, we are not in a github action`)\n }\n if (eventName !== \"push\") {\n throw new Error(`getOptionsFromGithubAction must be called only in a push action`)\n }\n\n const githubRepository = process.env.GITHUB_REPOSITORY\n if (!githubRepository) {\n throw new Error(`missing process.env.GITHUB_REPOSITORY`)\n }\n\n const [githubRepositoryOwner, githubRepositoryName] = githubRepository.split(\"/\")\n\n const githubToken = process.env.GITHUB_TOKEN\n if (!githubToken) {\n throw new Error(`missing process.env.GITHUB_TOKEN`)\n }\n\n const githubSha = process.env.GITHUB_SHA\n if (!githubSha) {\n throw new Error(`missing process.env.GITHUB_SHA`)\n }\n\n return {\n githubRepositoryOwner,\n githubRepositoryName,\n githubToken,\n githubSha,\n }\n}\n\nconst getOptionsFromProjectPackage = async ({ projectDirectoryUrl }) => {\n const projectPackage = await readProjectPackage({ projectDirectoryUrl })\n return {\n packageVersion: projectPackage.version,\n }\n}\n"
|
|
15
|
-
],
|
|
16
|
-
"names": [
|
|
17
|
-
"readProjectPackage",
|
|
18
|
-
"projectDirectoryUrl",
|
|
19
|
-
"packageFileUrl",
|
|
20
|
-
"resolveUrl",
|
|
21
|
-
"packageInProject",
|
|
22
|
-
"packageString",
|
|
23
|
-
"readFile",
|
|
24
|
-
"JSON",
|
|
25
|
-
"parse",
|
|
26
|
-
"e",
|
|
27
|
-
"name",
|
|
28
|
-
"Error",
|
|
29
|
-
"stack",
|
|
30
|
-
"urlToFileSystemPath",
|
|
31
|
-
"code",
|
|
32
|
-
"getGithubRelease",
|
|
33
|
-
"githubToken",
|
|
34
|
-
"githubRepositoryOwner",
|
|
35
|
-
"githubRepositoryName",
|
|
36
|
-
"githubReleaseName",
|
|
37
|
-
"requestUrl",
|
|
38
|
-
"response",
|
|
39
|
-
"fetchUrl",
|
|
40
|
-
"headers",
|
|
41
|
-
"authorization",
|
|
42
|
-
"method",
|
|
43
|
-
"responseStatus",
|
|
44
|
-
"status",
|
|
45
|
-
"writeUnexpectedResponseStatus",
|
|
46
|
-
"responseText",
|
|
47
|
-
"text",
|
|
48
|
-
"responseJson",
|
|
49
|
-
"json",
|
|
50
|
-
"createGithubRelease",
|
|
51
|
-
"githubSha",
|
|
52
|
-
"body",
|
|
53
|
-
"stringify",
|
|
54
|
-
"ref",
|
|
55
|
-
"sha",
|
|
56
|
-
"Buffer",
|
|
57
|
-
"byteLength",
|
|
58
|
-
"ensureGithubReleaseForPackage",
|
|
59
|
-
"logLevel",
|
|
60
|
-
"cancellationToken",
|
|
61
|
-
"createCancellationTokenForProcess",
|
|
62
|
-
"updateProcessExitCode",
|
|
63
|
-
"executeAsyncFunction",
|
|
64
|
-
"logger",
|
|
65
|
-
"createLogger",
|
|
66
|
-
"debug",
|
|
67
|
-
"assertAndNormalizeDirectoryUrl",
|
|
68
|
-
"getOptionsFromGithubAction",
|
|
69
|
-
"packageVersion",
|
|
70
|
-
"getOptionsFromProjectPackage",
|
|
71
|
-
"throwIfRequested",
|
|
72
|
-
"existingRelease",
|
|
73
|
-
"info",
|
|
74
|
-
"generateReleaseUrl",
|
|
75
|
-
"catchCancellation",
|
|
76
|
-
"considerUnhandledRejectionsAsExceptions",
|
|
77
|
-
"catch",
|
|
78
|
-
"process",
|
|
79
|
-
"exitCode",
|
|
80
|
-
"eventName",
|
|
81
|
-
"env",
|
|
82
|
-
"GITHUB_EVENT_NAME",
|
|
83
|
-
"githubRepository",
|
|
84
|
-
"GITHUB_REPOSITORY",
|
|
85
|
-
"split",
|
|
86
|
-
"GITHUB_TOKEN",
|
|
87
|
-
"GITHUB_SHA",
|
|
88
|
-
"projectPackage",
|
|
89
|
-
"version"
|
|
90
|
-
],
|
|
91
|
-
"mappings": ";;;;;;;;;AAEO,MAAMA,kBAAkB,GAAG,OAAO;AAAEC,EAAAA;AAAF,CAAP,KAAmC;AACnE,QAAMC,cAAc,GAAGC,eAAU,CAAC,gBAAD,EAAmBF,mBAAnB,CAAjC;AAEA,MAAIG,gBAAJ;;AACA,MAAI;AACF,UAAMC,aAAa,GAAG,MAAMC,aA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
|
|
92
|
-
}
|
package/readme.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# github-release-package
|
|
2
|
-
|
|
3
|
-
Create github release for package version updates.
|
|
4
|
-
|
|
5
|
-
[](https://github.com/jsenv/jsenv-github-release-package/packages)
|
|
6
|
-
[](https://www.npmjs.com/package/@jsenv/github-release-package)
|
|
7
|
-
[](https://github.com/jsenv/jsenv-github-release-package/actions?workflow=ci)
|
|
8
|
-
[](https://codecov.io/gh/jsenv/jsenv-github-release-package)
|
|
9
|
-
|
|
10
|
-
# Table of contents
|
|
11
|
-
|
|
12
|
-
- [Presentation](#Presentation)
|
|
13
|
-
- [Usage](#Usage)
|
|
14
|
-
- [Installation](#installation)
|
|
15
|
-
|
|
16
|
-
# Presentation
|
|
17
|
-
|
|
18
|
-
TODO
|
|
19
|
-
|
|
20
|
-
# Usage
|
|
21
|
-
|
|
22
|
-
TODO
|
|
23
|
-
|
|
24
|
-
# Installation
|
|
25
|
-
|
|
26
|
-
TODO
|