Skip to content

Commit 4050a5c

Browse files
committed
🔀 Merge pull requests #381, #382, #383, #384, and #385 from 'v1.0.13', 'ci/alternate-impl-to-create-release' and 'doc/update-the-change-logs', remote-tracking branches 'dependabot/npm_and_yarn/eslint-8.32.0' and 'dependabot/npm_and_yarn/rimraf-4.0.7'
Signed-off-by: kei-g <km.8k6ce+github@gmail.com>
6 parents fa95fa9 + 74afcfd + a7f72ca + 64f571d + 5a80c6a + 05220dc commit 4050a5c

File tree

5 files changed

+70
-44
lines changed

5 files changed

+70
-44
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"asynciterable",
55
"autobuild",
66
"codeql",
7+
"commitish",
78
"devel",
89
"esbuild",
910
"linebreak",

.github/workflows/release.yml

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,56 @@ jobs:
88
uses: actions/checkout@v3
99
with:
1010
fetch-depth: 1
11-
- id: commit_summary
12-
name: Get commit summary
11+
- name: Create a release
1312
uses: actions/github-script@v6
1413
with:
1514
script: |
15+
const { owner, repo } = context.repo
16+
const { ref, sha } = context
17+
const version = ref.slice(11)
1618
const child_process = require('node:child_process')
17-
const { ref } = context
18-
core.setOutput('version', ref.slice(11))
19-
child_process.execSync(`git fetch --depth 1 origin +${ref}:${ref}`)
2019
child_process.exec(
21-
`git for-each-ref --format='%(contents)' ${ref}`,
22-
{},
23-
(err, stdout, stderr) => {
24-
const i = stdout.search(/Signed\-off\-by\:\ /g)
25-
if (i < 0)
26-
core.setFailed('There is no signature')
27-
else
28-
core.setOutput('message', stdout.slice(0, i))
29-
}
20+
`git fetch --depth 1 origin +${ref}:${ref}`,
21+
{}
22+
() => child_process.exec(
23+
`git for-each-ref --format='%(contents)' ${ref}`,
24+
{},
25+
async (err, stdout, stderr) => {
26+
if (err)
27+
return core.setFailed(err)
28+
const i = stdout.search(/^Signed\-off\-by\:\ /g)
29+
const j = stdout.search(/^\-{5}BEGIN\ PGP\ SIGNATURE\-{5}$/g)
30+
const body = i < 0 ? j < 0 ? stdout : stdout.slice(0, j) : stdout.slice(0, i)
31+
const response = await github.request(
32+
`POST /repos/${owner}/${repo}/releases`,
33+
{
34+
body,
35+
draft: false,
36+
name: `Version ${version}`,
37+
owner,
38+
prerelease: false,
39+
repo,
40+
tag_name: `v${version}`,
41+
target_commitish: sha,
42+
}
43+
)
44+
switch (response.status) {
45+
case 201:
46+
core.setOutput('result', 'success')
47+
break
48+
case 404:
49+
core.setFailed('Not Found if the discussion category name is invalid')
50+
break
51+
case 422:
52+
core.setFailed('Validation failed, or the endpoint has been spammed')
53+
break
54+
default:
55+
core.setFailed(`Unknown error, status=${response.status}`)
56+
break
57+
}
58+
}
59+
)
3060
)
31-
- env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
name: Create Release
34-
uses: actions/create-release@v1
35-
with:
36-
body: |
37-
${{ steps.commit_summary.outputs.message }}
38-
draft: false
39-
prerelease: false
40-
release_name: Version ${{ steps.commit_summary.outputs.version }}
41-
tag_name: v${{ steps.commit_summary.outputs.version }}
4261
npm:
4362
if: github.ref_type == 'tag'
4463
name: npm

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLogs
22

3+
## Version 1.0.13
4+
5+
- :arrow_up: Packages for development are bumped
6+
- `eslint` is bumped from 8.31.0 to 8.32.0
7+
- `rimraf` is bumped from 4.0.4 to 4.0.7
8+
39
## Version 1.0.12
410

511
- :arrow_up: Packages for development are bumped

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"@typescript-eslint/parser": "^5.48.1",
1616
"chai": "^4.3.7",
1717
"esbuild": "^0.17.0",
18-
"eslint": "^8.31.0",
18+
"eslint": "^8.32.0",
1919
"mocha": "^10.2.0",
2020
"npm-run-all": "^4.1.5",
2121
"nyc": "^15.1.0",
22-
"rimraf": "^4.0.4",
22+
"rimraf": "^4.0.7",
2323
"ts-node": "^10.9.1",
2424
"typescript": "^4.9.4"
2525
},
@@ -56,5 +56,5 @@
5656
"test": "run-p lint cover"
5757
},
5858
"types": "index.d.ts",
59-
"version": "1.0.12"
59+
"version": "1.0.13"
6060
}

0 commit comments

Comments
 (0)