Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,7 @@ jobs:
use_oidc: true
fail_ci_if_error: false

# Build to confirm the bundle compiles. dist/ is NOT committed (it is
# produced at release time and committed onto the tag), so there is no
# freshness check here.
- run: pnpm run build

# The committed dist/ must match a fresh build, otherwise the action
# would run stale code. Fail if `pnpm run build` produced a diff.
- name: Verify dist/ is up to date
run: |
if [ -n "$(git status --porcelain dist)" ]; then
echo "::error::dist/ is out of date. Run 'npm run build' and commit the result."
git --no-pager diff --stat dist
exit 1
fi
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ coverage/
# Personal Claude Code overrides (shared .claude/settings.json IS committed)
.claude/settings.local.json

# NOTE: dist/ is intentionally committed — GitHub Actions run the bundled
# dist/index.js directly from the repo, so it must be checked in.
# dist/ is NOT committed. The bundle is built at release time and committed
# only onto the release tag (see .github/workflows — release automation), so
# the source branches stay clean. Use a tag (e.g. @v1), not @main, to consume.
dist/
8 changes: 6 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ pnpm exec vitest run tests/version.test.ts # run a single test file
pnpm exec vitest run -t "resolves a semver range" # run tests matching a name
```

## Critical: `dist/` is committed and must stay in sync
## Critical: `dist/` is built at release time, NOT committed to source branches

GitHub Actions runs the bundled `dist/index.js` directly (see `action.yml` → `main: dist/index.js`), **not** the TypeScript source. After any change under `src/`, run `pnpm run build` and commit the regenerated `dist/`. CI (`.github/workflows/ci.yml`) fails the build if `git status --porcelain dist` is non-empty — i.e. if the committed `dist/` doesn't match a fresh build. (Rebuild with the same pnpm version CI uses — the `packageManager` pin keeps them aligned.)
GitHub Actions runs the bundled `dist/index.js` directly (see `action.yml` → `main: dist/index.js`), **not** the TypeScript source — so a consumed ref must contain `dist/`. This repo keeps `dist/` **out of `main`** (`.gitignore`d) and builds it at release time, committing it **only onto the release tag**. Consequences:

- **Consume via a tag** (`uses: yk-lab/setup-task@v1`), never `@main` — `main` has no `dist/`.
- Source PRs carry no `dist/` churn; there is no freshness check. CI still runs `pnpm run build` to confirm the bundle compiles, and `self-test.yml` builds before `uses: ./`.
- Releasing is what produces a usable `dist/` (see release automation in `.github/workflows`). Always rebuild with the pinned pnpm version (`packageManager` field) so the tagged bundle is reproducible.

## Architecture

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ pnpm run lint # eslint (lint:fix to autofix)
> Dependency installs honour a supply-chain cooldown (`minimumReleaseAge` in
> `pnpm-workspace.yaml`): versions published in the last 3 days are not used.

### `dist/` is committed — keep it in sync
### `dist/` is not committed

GitHub Actions runs the bundled `dist/index.js` directly, so it is checked into
the repository. After any change under `src/`, run `pnpm run build` and commit
the regenerated `dist/`. CI fails if the committed `dist/` does not match a
fresh build.
The bundled `dist/index.js` is built at release time and committed only onto the
release tag, so source branches stay clean — do **not** commit `dist/` (it is
`.gitignore`d). `pnpm run build` is still useful locally to confirm the bundle
compiles; CI builds it too. Consume the action via a tag (`@v1`), not `@main`.

## Pull requests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pnpm install
pnpm run all # typecheck + lint + test + build (bundles dist/)
```

`dist/` is committed because GitHub Actions run the bundled `dist/index.js` directly. CI fails if it is out of date.
`dist/` is **not** committed: it is built at release time and committed only onto the release tag (consume the action via a tag like `@v1`, not `@main`). CI runs `pnpm run build` to confirm the bundle compiles.

See [`企画書.md`](./企画書.md) and [`要求仕様書.md`](./要求仕様書.md) for the design rationale and requirements.

Expand Down
8 changes: 5 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ GitHub の各マイルストーンページ。`(FR/NFR/§)` は要求仕様書
### 未 Issue 化(リリース運用 / M3・M4)

- **リリース自動化 + `v1` ムービングタグ + Marketplace 公開**(`release`)
タグ push 時に `dist/` を検証して Release 発行 → `v1` を追従 → Marketplace 掲載。DoD §11 必須。
- **ローカルコードを `yk-lab/setup-task` へ push(remote 設定)**(`chore`)
現状 remote 未設定・リモートは空。`git remote add origin … && git push` で CI/self-test が初回実行。
**dist はリリース時にビルドしてタグに commit する方式に変更**(main は source のみ・#22 は不要)。
`v*` タグ push → `pnpm install --frozen-lockfile` → `pnpm run build` → dist を tag に commit →
`v1` を追従 → Release 発行 → Marketplace 掲載。⚠️ WF からタグを push/移動するため、
**タグ保護 ruleset の bypass にリリース WF の identity を追加**する必要あり。DoD §11 必須。
- ~~ローカルコードを push / remote 設定~~ — 完了済み。

---

Expand Down
Loading
Loading