diff --git a/.github/workflows/publish_nuget.yml b/.github/workflows/publish_nuget.yml index 9a72bc0..9534819 100644 --- a/.github/workflows/publish_nuget.yml +++ b/.github/workflows/publish_nuget.yml @@ -2,9 +2,10 @@ name: Publish NuGet on: push: + # Fire on ALL tag pushes so the format guard (below) catches mistakes + # like `v0.1.0-alpha` loudly instead of silently no-op-ing. tags: - - 'v*.*.*' - - 'v*.*.*-*' + - '*' permissions: contents: write @@ -17,6 +18,24 @@ jobs: environment: nuget # Must match the environment named in the nuget.org Trusted Publisher policy. steps: + - name: "Assert tag is a bare version number" + shell: bash + run: | + # ShellSyntaxTree convention: tags are SemVer version numbers WITHOUT + # a leading 'v'. E.g., `0.1.0-alpha`, NOT `v0.1.0-alpha`. The tag is + # the package version verbatim. + TAG="${GITHUB_REF_NAME}" + if [[ "$TAG" == v* ]]; then + echo "::error::Tag '$TAG' starts with 'v'. ShellSyntaxTree tags must be bare SemVer version numbers (e.g., '0.1.0-alpha', not 'v0.1.0-alpha'). Delete this tag and retag without the leading 'v'." + exit 1 + fi + if ! [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$ ]]; then + echo "::error::Tag '$TAG' is not a valid SemVer version. Expected '..' or '..-' (e.g., '1.0.0' or '0.2.0-beta.1')." + exit 1 + fi + echo "PACKAGE_VERSION=${TAG}" >> "$GITHUB_ENV" + echo "Tag '$TAG' is a valid bare version. Publishing package version: ${TAG}" + - name: "Checkout" uses: actions/checkout@v6.0.2 with: @@ -31,15 +50,6 @@ jobs: - name: "Restore .NET tools" run: dotnet tool restore - - name: "Compute package version from tag" - shell: bash - run: | - # tag form is vX.Y.Z or vX.Y.Z-suffix - TAG="${GITHUB_REF_NAME}" - VERSION="${TAG#v}" - echo "PACKAGE_VERSION=${VERSION}" >> "$GITHUB_ENV" - echo "Publishing package version: ${VERSION}" - - name: "dotnet pack" run: dotnet pack /p:PackageVersion=${{ env.PACKAGE_VERSION }} -c Release -o ./output diff --git a/IMPLEMENTATION_PLAN.md b/IMPLEMENTATION_PLAN.md index dbce2c4..91faf41 100644 --- a/IMPLEMENTATION_PLAN.md +++ b/IMPLEMENTATION_PLAN.md @@ -9,7 +9,7 @@ bulldoze priorities. --- -## NOW (v0.1.0-alpha shipping path) +## NOW (0.1.0-alpha shipping path) > **Active OpenSpec change:** `v0.1-locked-interpretations` — captures > the eight planning-interview decisions (see @@ -169,15 +169,16 @@ bulldoze priorities. - [x] Wired into `pr_validation.yml` via standard `dotnet test` (no separate job) -### 13. Release v0.1.0-alpha — PR 7 in flight +### 13. Release 0.1.0-alpha — PR 7 in flight -- [x] `RELEASE_NOTES.md` updated with v0.1.0-alpha section +- [x] `RELEASE_NOTES.md` updated with 0.1.0-alpha section - [x] `dotnet pack -c Release -o ./bin/nuget` produces clean `ShellSyntaxTree.0.1.0-alpha.nupkg` + `.snupkg` with embedded README, icon, SourceLink metadata - [ ] **STOP after PR 7 merges** — await user go-ahead before pushing - `v0.1.0-alpha` tag (the tag → nuget.org publish is irreversible) -- [ ] On user go-ahead: `git tag v0.1.0-alpha && git push origin v0.1.0-alpha` + `0.1.0-alpha` tag (the tag → nuget.org publish is irreversible) +- [ ] On user go-ahead: `git tag 0.1.0-alpha && git push origin 0.1.0-alpha` + (tags are bare SemVer, no `v` prefix — `publish_nuget.yml` asserts this) - [ ] Verify `publish_nuget.yml` produces release on tag push and the package appears on nuget.org @@ -203,7 +204,7 @@ bulldoze priorities. --- -## NEXT (v0.1.x — additive, post-alpha) +## NEXT (0.1.x — additive, post-alpha) - Seed 50–100 corpus entries from sanitized real-world dogfood logs (SPEC §14 workflow) @@ -214,7 +215,7 @@ bulldoze priorities. - Performance sanity check (~1 ms typical) with a tiny BenchmarkDotNet harness — only if anything in the daemon hot path complains -## LATER (v0.2+ — out of v0.1 scope) +## LATER (0.2+ — out of 0.1 scope) - PowerShell parser (`PwshParser : IShellParser`) — first time we exercise the multi-shell seam diff --git a/README.md b/README.md index a060243..db3cda9 100644 --- a/README.md +++ b/README.md @@ -173,11 +173,14 @@ dotnet pack -c Release -o ./bin/nuget ## Versioning -- **v0.1.0-alpha** — first publishable cut. Bash-only. -- **v0.1.x** — additive (more verb table entries, more corpus, bug +Tags are bare SemVer version numbers — no `v` prefix. The release +workflow asserts this and fails fast on misformatted tags. + +- **0.1.0-alpha** — first publishable cut. Bash-only. +- **0.1.x** — additive (more verb table entries, more corpus, bug fixes). -- **v0.2.0** — first PowerShell parser. -- **v1.0.0** — when an external consumer beyond Netclaw ships against +- **0.2.0** — first PowerShell parser. +- **1.0.0** — when an external consumer beyond Netclaw ships against it without finding API gaps. ## License