Skip to content

Commit

Permalink
Release v1.5.0 (#74)
Browse files Browse the repository at this point in the history
* タコピー構文の追加 (#73)

* add タコピー構文

* change 構文

* add タコピー構文のテスト

* bump version (#75)

* ci: 自動 CHANGELOG/バージョン更新のセットアップ (#76)

* ci: Add changelog generator

* ci: Add semantic-release

* ci: dependabot を develop ブランチに対して動作するように修正 (#80)

* ci: Add target-branch

* Add commit message prefix

Co-authored-by: Mikuroさいな <[email protected]>
  • Loading branch information
meru and MikuroXina authored Mar 22, 2022
1 parent 9e4c550 commit 67e58f3
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
target-branch: develop
commit-message:
prefix: chore
37 changes: 37 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Generate CHANGELOG

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Update CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: false
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: CHANGELOG.md
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
5 changes: 5 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
],
"branches": [
"main"
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

----

## 1.5.0

## feat

- タコピー構文の追加。(`!wakaranai`) ([#73](https://github.com/approvers/OreOreBot2/pull/73))
> かわえもん「渡してない単位、渡して?」
> 教員 「わ、わからないっピ.......」
## 1.4.0

## feat
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oreorebot2",
"version": "1.4.0",
"version": "1.5.0",
"main": "index.js",
"license": "MIT",
"repository": "https://github.com/approvers/OreOreBot2",
Expand Down
19 changes: 19 additions & 0 deletions src/service/hukueki.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ test('use case of dousureba', async () => {
);
});

test('use case of wakaranai', async () => {
const responder = new Hukueki();
await responder.on(
'CREATE',
createMockMessage(
{
args: ['wakaranai', 'こるく'],
senderName: 'りにあ'
},
(message) => {
expect(message).toStrictEqual({
description: `教員「こるく、出して」\nりにあ「わ、わからないっピ.......」`
});
return Promise.resolve();
}
)
);
});

test('args space', async () => {
const responder = new Hukueki();
await responder.on(
Expand Down
18 changes: 16 additions & 2 deletions src/service/hukueki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { MessageEvent } from '../runner';

export class Hukueki implements CommandResponder {
help: Readonly<HelpInfo> = {
title: '服役/ロリコン/ぬきたし構文',
title: '服役/ロリコン/ぬきたし構文/タコピー構文',
description: '何これ……引数のテキストを構文にはめ込むみたいだよ',
commandName: ['hukueki', 'lolicon', 'dousureba'],
commandName: ['hukueki', 'lolicon', 'dousureba', 'wakaranai'],
argsFormat: [
{
name: 'テキスト',
Expand Down Expand Up @@ -84,6 +84,20 @@ export class Hukueki implements CommandResponder {
});
break;
}
case 'wakaranai': {
if (!messageArgs) {
await message.reply({
title: '(引数が)わ、わからないっピ.......',
description: '引数が不足してるみたいだ。'
});
return;
}

await message.reply({
description: `教員「${messageArgs}、出して」\n${message.senderName}「わ、わからないっピ.......」`
});
break;
}
default:
return;
}
Expand Down

0 comments on commit 67e58f3

Please sign in to comment.