diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c4ec672..17177b6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,6 +34,7 @@ jobs: tar -tzf "$TARBALL" | grep -q "package/dist/index.js" mkdir -p /tmp/wizard-smoke npm install --prefix /tmp/wizard-smoke "$PWD/$TARBALL" + # exits non-zero when invoked without config — that's expected; we only verify the bin is executable /tmp/wizard-smoke/node_modules/.bin/coval-wizard 2>&1 || true rm -f "$TARBALL" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e4c3894..b09adb9 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -3,12 +3,13 @@ name: Auto Release on: push: branches: [main] + workflow_dispatch: # manual dry-run: detects bump type without creating a release permissions: contents: write concurrency: - group: auto-release + group: auto-release-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: false jobs: @@ -28,7 +29,7 @@ jobs: if [ -z "$LAST_TAG" ]; then COMMITS=$(git log --format="%s") - BASE_VERSION=$(node -p "require('./package.json').version") + BASE_VERSION=$(jq -r '.version' package.json) else COMMITS=$(git log --format="%s" "${LAST_TAG}..HEAD") BASE_VERSION="${LAST_TAG#v}" @@ -43,11 +44,14 @@ jobs: while IFS= read -r msg; do # Strip [LINEAR-XXX] / [SIM-123] style prefixes clean=$(echo "$msg" | sed 's/^\[[A-Za-z]*-[0-9]*\] //') - if [[ "$clean" =~ ^[a-z]+(\([^)]*\))?!: ]]; then + re_major='^[a-z]+(\([^)]*\))?!:' + re_feat='^feat(\([^)]*\))?:' + re_fix='^(fix|perf)(\([^)]*\))?:' + if [[ "$clean" =~ $re_major ]]; then TYPE="major"; break - elif [[ "$clean" =~ ^feat(\([^)]*\))?: ]] && [[ "$TYPE" != "major" ]]; then + elif [[ "$clean" =~ $re_feat ]] && [[ "$TYPE" != "major" ]]; then TYPE="minor" - elif [[ "$clean" =~ ^(fix|perf)(\([^)]*\))?: ]] && [[ "$TYPE" == "none" ]]; then + elif [[ "$clean" =~ $re_fix ]] && [[ "$TYPE" == "none" ]]; then TYPE="patch" fi done <<< "$COMMITS" @@ -64,12 +68,13 @@ jobs: major) V="$((M+1)).0.0" ;; minor) V="$M.$((N+1)).0" ;; patch) V="$M.$N.$((P+1))" ;; + *) echo "Unexpected bump type: ${{ steps.release.outputs.type }}"; exit 1 ;; esac echo "value=$V" >> "$GITHUB_OUTPUT" echo "tag=v$V" >> "$GITHUB_OUTPUT" - name: Create GitHub release - if: steps.release.outputs.type != 'none' + if: steps.release.outputs.type != 'none' && github.event_name == 'push' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/README.md b/README.md index 4cd7d5e..29f492a 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Releases are fully automatic on every merge to `main`. No manual version bumps o |---|---|---| | `feat:` | minor (`1.x.0`) | `feat: add gemini support` | | `fix:` / `perf:` | patch (`1.0.x`) | `fix: handle 403 as invalid key` | - | `feat!:` / `fix!:` | major (`x.0.0`) | `feat!: redesign CLI interface` | + | `feat!:` / `fix!:` | major (`x.0.0`) | `feat!: redesign CLI` | | `chore:` / `ci:` / `docs:` | no release | — | 2. **Linear ticket prefixes are stripped automatically.** A PR titled `[SIM-123] feat: add something` is treated identically to `feat: add something`.