Skip to content

Commit 6c2dab2

Browse files
committed
🔀 Merge pull requests #370, #371, #372, #373, and #374 from 'ci/run-dependabot-on-main-branch', 'ci/run-workflows-only-push-or-pr-for-branches', 'ci/add-workflow-to-release', 'doc/remove-ci-status-badges-devel-and-release' and 'singlify'
Signed-off-by: kei-g <km.8k6ce+github@gmail.com>
6 parents 26799a8 + 500774b + a3565e5 + 25d186b + 7951f23 + 10891e8 commit 6c2dab2

File tree

9 files changed

+106
-81
lines changed

9 files changed

+106
-81
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
version: 2
21
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
2+
- directory: /
3+
open-pull-requests-limit: 16
4+
package-ecosystem: github-actions
5+
schedule:
6+
interval: daily
7+
- directory: /
58
open-pull-requests-limit: 16
9+
package-ecosystem: npm
610
schedule:
7-
interval: "daily"
8-
target-branch: devel
11+
interval: daily
12+
version: 2

.github/workflows/build.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
jobs:
22
build:
3+
if: github.ref_type == 'branch'
34
name: Build on Node.js ${{ matrix.node }}
45
runs-on: ubuntu-latest
56
strategy:
@@ -28,17 +29,7 @@ name: Build
2829
on:
2930
pull_request:
3031
branches:
31-
- devel
32-
- main
33-
- release
32+
- '**'
3433
push:
3534
branches:
36-
- devel
37-
- main
38-
- release
39-
paths-ignore:
40-
- '**.md'
41-
- '.editorconfig'
42-
- '.gitignore'
43-
- '.npmignore'
44-
- 'LICENSE'
35+
- '**'

.github/workflows/codeql.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
jobs:
22
analyze:
3+
if: github.ref_type == 'branch'
34
name: Analyze
45
permissions:
56
actions: read
@@ -28,13 +29,7 @@ name: CodeQL
2829
on:
2930
pull_request:
3031
branches:
31-
- devel
32-
- main
33-
- release
32+
- '**'
3433
push:
3534
branches:
36-
- devel
37-
- main
38-
- release
39-
schedule:
40-
- cron: '19 13 * * 3'
35+
- '**'

.github/workflows/coverage.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
jobs:
22
coverage:
3+
if: github.ref_type == 'branch'
34
name: Check code coverages on Node.js ${{ matrix.node }}
45
runs-on: ubuntu-latest
56
strategy:
@@ -34,17 +35,7 @@ name: Coverage
3435
on:
3536
pull_request:
3637
branches:
37-
- devel
38-
- main
39-
- release
38+
- '**'
4039
push:
4140
branches:
42-
- devel
43-
- main
44-
- release
45-
paths-ignore:
46-
- '**.md'
47-
- '.editorconfig'
48-
- '.gitignore'
49-
- '.npmignore'
50-
- 'LICENSE'
41+
- '**'

.github/workflows/example.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
jobs:
22
example:
3+
if: github.ref_type == 'branch'
34
name: Run an example on Node.js ${{ matrix.node }}
45
outputs:
56
result: ${{ steps.example.outputs.result }}
@@ -30,17 +31,7 @@ name: Example
3031
on:
3132
pull_request:
3233
branches:
33-
- devel
34-
- main
35-
- release
34+
- '**'
3635
push:
3736
branches:
38-
- devel
39-
- main
40-
- release
41-
paths-ignore:
42-
- '**.md'
43-
- '.editorconfig'
44-
- '.gitignore'
45-
- '.npmignore'
46-
- 'LICENSE'
37+
- '**'

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
jobs:
2+
github:
3+
if: github.ref_type == 'tag'
4+
name: GitHub
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 1
11+
- id: commit_summary
12+
name: Get commit summary
13+
uses: actions/github-script@v6
14+
with:
15+
script: |
16+
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}`)
20+
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+
}
30+
)
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 }}
42+
npm:
43+
if: github.ref_type == 'tag'
44+
name: npm
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
with:
50+
fetch-depth: 1
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: '18.x'
55+
registry-url: 'https://registry.npmjs.org'
56+
- name: Upgrade npm
57+
run: npm install npm@latest -g
58+
- name: Setup modules
59+
run: npm ci
60+
- env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
name: Publish
63+
run: npm publish
64+
name: Release
65+
on:
66+
create:
67+
tags:
68+
- 'v[0-9]+(\.[0-9]+)*(\-[0-9A-Za-z]+)*'

README.md

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
## CI Status
88

9-
| Branches \ Targets | Build | CodeQL | Coverage | Example |
10-
| ---- | ---- | ---- | ---- | ----
11-
| devel | [![GitHub CI (Build)][github-devel-build-image]][github-devel-build-url] | [![GitHub CI (CodeQL)][github-devel-codeql-image]][github-devel-codeql-url] | [![GitHub CI (Coverage)][github-devel-coverage-image]][github-devel-coverage-url] | [![GitHub CI (Example)][github-devel-example-image]][github-devel-example-url] |
12-
| main | [![GitHub CI (Build)][github-main-build-image]][github-main-build-url] | [![GitHub CI (CodeQL)][github-main-codeql-image]][github-main-codeql-url] | [![GitHub CI (Coverage)][github-main-coverage-image]][github-main-coverage-url] | [![GitHub CI (Example)][github-main-example-image]][github-main-example-url] |
13-
| release | [![GitHub CI (Build)][github-release-build-image]][github-release-build-url] | [![GitHub CI (CodeQL)][github-release-codeql-image]][github-release-codeql-url] | [![GitHub CI (Coverage)][github-release-coverage-image]][github-release-coverage-url] | [![GitHub CI (Example)][github-release-example-image]][github-release-example-url] |
9+
| Workflow Name | Status |
10+
|:-:|:-:|
11+
| **Build** | [![GitHub CI (Build)][github-build-image]][github-build-url] |
12+
| **CodeQL** | [![GitHub CI (CodeQL)][github-codeql-image]][github-codeql-url] |
13+
| **Coverage** | [![GitHub CI (Coverage)][github-coverage-image]][github-coverage-url] |
14+
| **Example** | [![GitHub CI (Example)][github-example-image]][github-example-url] |
1415

1516
## Installation
1617

@@ -82,30 +83,14 @@ Contributions are welcome! See [Contributor's Guide](https://github.com/kei-g/as
8283

8384
[depencency-image]:https://img.shields.io/librariesio/release/npm/async-iterable-queue?logo=nodedotjs
8485
[dependency-url]:https://npmjs.com/package/async-iterable-queue?activeTab=dependencies
85-
[github-devel-build-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml/badge.svg?branch=devel
86-
[github-devel-build-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml?query=branch%3Adevel
87-
[github-devel-codeql-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml/badge.svg?branch=devel
88-
[github-devel-codeql-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml?query=branch%3Adevel
89-
[github-devel-coverage-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml/badge.svg?branch=devel
90-
[github-devel-coverage-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml?query=branch%3Adevel
91-
[github-devel-example-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml/badge.svg?branch=devel
92-
[github-devel-example-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml?query=branch%3Adevel
93-
[github-main-build-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml/badge.svg?branch=main
94-
[github-main-build-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml?query=branch%3Amain
95-
[github-main-codeql-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml/badge.svg?branch=main
96-
[github-main-codeql-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml?query=branch%3Amain
97-
[github-main-coverage-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml/badge.svg?branch=main
98-
[github-main-coverage-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml?query=branch%3Amain
99-
[github-main-example-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml/badge.svg?branch=main
100-
[github-main-example-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml?query=branch%3Amain
101-
[github-release-build-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml/badge.svg?branch=release
102-
[github-release-build-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml?query=branch%3Arelease
103-
[github-release-codeql-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml/badge.svg?branch=release
104-
[github-release-codeql-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml?query=branch%3Arelease
105-
[github-release-coverage-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml/badge.svg?branch=release
106-
[github-release-coverage-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml?query=branch%3Arelease
107-
[github-release-example-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml/badge.svg?branch=release
108-
[github-release-example-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml?query=branch%3Arelease
86+
[github-build-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml/badge.svg?branch=main
87+
[github-build-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml?query=branch%3Amain
88+
[github-codeql-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml/badge.svg?branch=main
89+
[github-codeql-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml?query=branch%3Amain
90+
[github-coverage-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml/badge.svg?branch=main
91+
[github-coverage-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml?query=branch%3Amain
92+
[github-example-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml/badge.svg?branch=main
93+
[github-example-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml?query=branch%3Amain
10994
[github-url]:https://github.com/kei-g/async-iterable-queue
11095
[license-image]:https://img.shields.io/github/license/kei-g/async-iterable-queue
11196
[license-url]:https://opensource.org/licenses/BSD-3-Clause

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@
5656
"test": "run-p lint cover"
5757
},
5858
"types": "index.d.ts",
59-
"version": "1.1.0"
59+
"version": "1.0.12"
6060
}

0 commit comments

Comments
 (0)