From 15e983ecd8d171545f190cedb5b46f766db5aaa7 Mon Sep 17 00:00:00 2001 From: cm-dyoshikawa Date: Thu, 31 Jul 2025 07:53:28 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20GitHub=20Actions=20CI/CD=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=81=A8gitignore?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GitHub Actionsワークフロー(CI/リリース)を追加 - .gitignoreに.pnpm-storeとClaude Code設定を追加 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 49 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++ .gitignore | 5 +++- 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b5b8eed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + quality: + name: Code Quality & Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 10.13.1 + + - name: Install dependencies + run: pnpm install --ignore-scripts + + - name: Check no files generated after install + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Error: Files were generated or modified after pnpm install" + git status --porcelain + exit 1 + fi + + - name: Run check + run: pnpm check + + - name: Run secretlint + run: pnpm secretlint + + - name: Run typecheck + run: pnpm typecheck + + - name: Build project + run: pnpm build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7929ba5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + release: + types: [created] + +jobs: + publish: + name: Publish to NPM + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: main + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 10.13.1 + + - name: Install dependencies + run: pnpm install + + - name: Run quality checks + run: | + pnpm check + pnpm secretlint + pnpm typecheck + + - name: Publish to npm + run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 1248700..227172e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ Thumbs.db # Dependencies node_modules/ +.pnpm-store/ package-lock.json yarn.lock pnpm-lock.yaml @@ -24,4 +25,6 @@ pnpm-lock.yaml # Build output dist/ *.tsbuildinfo -assets/ + +# Claude Code +.claude/settings.local.json From acafb2e3166fa1def13ba2204c069105b2c58277 Mon Sep 17 00:00:00 2001 From: cm-dyoshikawa Date: Thu, 31 Jul 2025 08:04:00 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20gitignore=E3=81=ABtmp=E3=83=87?= =?UTF-8?q?=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一時ファイル用のtmp/ディレクトリをgitignoreに追加しました。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 227172e..082fc2b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ dist/ # Claude Code .claude/settings.local.json + +# Others +tmp/ From 93cce9c942dff231497a1700cdd96dc4ae7f0590 Mon Sep 17 00:00:00 2001 From: cm-dyoshikawa Date: Thu, 31 Jul 2025 09:00:30 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E3=83=AA=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E6=89=8B=E9=A0=86=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=97?= =?UTF-8?q?=E3=81=9Frelease.yml=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新しいリリース手順を記述したrelease.ymlファイルを追加しました。これにより、バージョン管理やリリース作成のプロセスが明確になります。 🤖 Generated with [Claude Code](https://claude.ai/code) --- .claude/commands/release.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .claude/commands/release.yml diff --git a/.claude/commands/release.yml b/.claude/commands/release.yml new file mode 100644 index 0000000..1268d45 --- /dev/null +++ b/.claude/commands/release.yml @@ -0,0 +1,20 @@ +new_version = get_version_without_v_prefix($ARGUMENTS) # 例: 1.0.0 +new_version_with_v_prefix = get_version_with_v_prefix($ARGUMENTS) # 例: v1.0.0 + +new_versionの指定がない場合、patchバージョンを現在のバージョンから+1した値をnew_version,new_version_with_v_prefixに設定します。 + +1. 現在 main ブランチにいることを確認します。main ブランチでない場合は、この操作を中止します。 +2. `git pull` を実行します。 +3. `git checkout -b release/{new_version_with_v_prefix}` を実行します。 +4. `src/cli/index.ts` 内のバージョンを更新します。その後、`git add` と `git commit` を実行します。 +5. `pnpm version {new_version} --no-git-tag-version` でバージョンを更新します。 +6. `package.json` が変更されるため、`git commit` と `git push` を実行します。 +7. `gh pr create` と `gh pr merge` を実行して、リリースブランチを main ブランチにマージします。 +8. 前のバージョンタグと現在のコミット間のコード変更を比較して、リリース説明を準備します。 + - 英語で記述します。 + - 機密情報は含めません。 + - `What's Changed`、`Contributors`、`Full Changelog` のセクションが必要です。 + - `./tmp/release-notes.md` をリリースノートとして使用します。 +9. 予防措置として、リリース内容に非公開にすべき情報が含まれていないことを確認します。 +10. `gh release create {new_version_with_v_prefix} --title {new_version_with_v_prefix} --notes-file ./tmp/release-notes.md ...` コマンドを使用して、`github.com/classmethod/tsumiki` リポジトリでタイトルとタグの両方を new_version_with_v_prefix に設定し、ステップ4の内容を説明として使用してリリースを作成します。 +11. main ブランチに戻ります。 \ No newline at end of file From e1bb31e9836c072ed5c2119840998022bc1e2027 Mon Sep 17 00:00:00 2001 From: cm-dyoshikawa Date: Thu, 31 Jul 2025 09:02:19 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20release.yml=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=82=B9=E6=89=8B=E9=A0=86=E3=81=AB=E3=81=8A?= =?UTF-8?q?=E3=81=91=E3=82=8B=E6=94=B9=E8=A1=8C=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit release.ymlファイルの11行目に改行を追加し、リリース手順の可読性を向上させました。 --- .claude/commands/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/commands/release.yml b/.claude/commands/release.yml index 1268d45..dc95261 100644 --- a/.claude/commands/release.yml +++ b/.claude/commands/release.yml @@ -17,4 +17,4 @@ new_versionの指定がない場合、patchバージョンを現在のバージ - `./tmp/release-notes.md` をリリースノートとして使用します。 9. 予防措置として、リリース内容に非公開にすべき情報が含まれていないことを確認します。 10. `gh release create {new_version_with_v_prefix} --title {new_version_with_v_prefix} --notes-file ./tmp/release-notes.md ...` コマンドを使用して、`github.com/classmethod/tsumiki` リポジトリでタイトルとタグの両方を new_version_with_v_prefix に設定し、ステップ4の内容を説明として使用してリリースを作成します。 -11. main ブランチに戻ります。 \ No newline at end of file +11. main ブランチに戻ります。