Skip to content

Commit 2028f0e

Browse files
authored
CI(shipjs): add shipjs integration (#52)
* CI(shipjs): add shipjs integration * CI: add test * CI: remove Travis * Update README
1 parent cf1c3f1 commit 2028f0e

File tree

7 files changed

+139
-11
lines changed

7 files changed

+139
-11
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 }}

.github/workflows/shipjs-trigger.yml

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 }}

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: test
2+
on: [push, pull_request]
3+
env:
4+
CI: true
5+
jobs:
6+
test:
7+
name: "Test on Node.js ${{ matrix.node_version }}"
8+
runs-on: ubuntu-18.04
9+
strategy:
10+
matrix:
11+
node_version: [12.x, 14.x]
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v2
15+
- name: setup Node.js ${{ matrix.node_version }}
16+
uses: actions/setup-node@v1
17+
with:
18+
node_version: ${{ matrix.node_version }}
19+
- name: Install
20+
run: yarn install
21+
- name: Test
22+
run: yarn test

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# textlint-rule-preset-ja-technical-writing [![Build Status](https://travis-ci.org/textlint-ja/textlint-rule-preset-ja-technical-writing.svg?branch=master)](https://travis-ci.org/textlint-ja/textlint-rule-preset-ja-technical-writing) [![Gitter](https://badges.gitter.im/textlint-ja/textlint-ja.svg)](https://gitter.im/textlint-ja/textlint-ja)
1+
# textlint-rule-preset-ja-technical-writing [![Actions Status](https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing/workflows/test/badge.svg)](https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing/actions?query=workflow%3A"test") [![Gitter](https://badges.gitter.im/textlint-ja/textlint-ja.svg)](https://gitter.im/textlint-ja/textlint-ja)
22

33
技術文書向けの[textlint](https://textlint.github.io/)ルールプリセットです。
44
全体的に少し厳しめの設定がデフォルト値となっているため、文章に合わせて設定値を変更する必要があります。

ship.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const semver = require("semver");
2+
module.exports = {
3+
buildCommand: () => null,
4+
getNextVersion: ({ revisionRange, commitTitles, commitBodies, currentVersion, dir }) => {
5+
// always major update
6+
return semver.inc(currentVersion, "major");
7+
}
8+
};

0 commit comments

Comments
 (0)