Skip to content

Commit 89f79da

Browse files
authored
CI(shipjs): add shipjs integration (#32)
1 parent e7f4981 commit 89f79da

File tree

6 files changed

+2431
-81
lines changed

6 files changed

+2431
-81
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Ship js Manual Prepare
2+
on:
3+
issue_comment:
4+
types: [created]
5+
jobs:
6+
manual_prepare:
7+
if: |
8+
github.event_name == 'issue_comment' &&
9+
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
10+
startsWith(github.event.comment.body, '@shipjs prepare')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
ref: master
17+
- uses: actions/setup-node@v1
18+
- run: |
19+
if [ -f "yarn.lock" ]; then
20+
yarn install
21+
else
22+
npm install
23+
fi
24+
- run: |
25+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
26+
git config --global user.name "github-actions[bot]"
27+
- run: npm run release:prepare -- --yes --no-browse
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
31+
32+
create_done_comment:
33+
if: success()
34+
needs: manual_prepare
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/github@master
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
args: comment "@${{ github.actor }} `shipjs prepare` done"
42+
43+
create_fail_comment:
44+
if: cancelled() || failure()
45+
needs: manual_prepare
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/github@master
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
args: comment "@${{ github.actor }} `shipjs prepare` fail"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Ship js Schedule Prepare
2+
on:
3+
schedule:
4+
# * is a special character in YAML so you have to quote this string
5+
- cron: "0 0 1 */6 *"
6+
jobs:
7+
schedule_prepare:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
ref: master
14+
- uses: actions/setup-node@v1
15+
- run: |
16+
if [ -f "yarn.lock" ]; then
17+
yarn install
18+
else
19+
npm install
20+
fi
21+
- run: |
22+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
23+
git config --global user.name "github-actions[bot]"
24+
- run: npm run release:prepare -- --yes --no-browse
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ship js trigger
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
ref: master
14+
15+
- uses: actions/setup-node@v1
16+
with:
17+
registry-url: "https://registry.npmjs.org"
18+
- run: |
19+
if [ -f "yarn.lock" ]; then
20+
yarn install
21+
else
22+
npm install
23+
fi
24+
25+
- run: npm run release:trigger
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
29+
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@
1414
"version": "4.0.4",
1515
"description": "textlint rule preset for japanese.",
1616
"main": "lib/textlint-rule-preset-japanese.js",
17-
"files": [
18-
"lib"
19-
],
17+
"files": ["lib"],
2018
"directories": {
2119
"test": "test"
2220
},
2321
"scripts": {
24-
"test": "cd example && npm it"
22+
"test": "cd example && npm it",
23+
"release:prepare": "shipjs prepare",
24+
"release:trigger": "shipjs trigger"
2525
},
26-
"keywords": [
27-
"preset",
28-
"rule",
29-
"textlint",
30-
"textlintrule"
31-
],
26+
"keywords": ["preset", "rule", "textlint", "textlintrule"],
3227
"dependencies": {
3328
"@textlint-rule/textlint-rule-no-invalid-control-character": "^1.2.0",
3429
"@textlint/module-interop": "^1.0.1",
@@ -42,5 +37,8 @@
4237
"textlint-rule-no-nfd": "^1.0.1",
4338
"textlint-rule-prh": "^5.2.0",
4439
"textlint-rule-sentence-length": "^2.1.1"
40+
},
41+
"devDependencies": {
42+
"shipjs": "0.19.0"
4543
}
4644
}

ship.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { buildCommand: () => null };

0 commit comments

Comments
 (0)