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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [main]
branches: ["*"] # Run on all branches (including develop, feature branches)
pull_request:
branches: [main]
branches: [main] # Run on PRs to main

jobs:
test:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Commit Message Validation

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
commit-lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to check commits

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Validate commit message
run: npm run check
# Alternative: use the CLI directly
# run: npx commitweave check

- name: Validate all commits in PR (for pull requests)
if: github.event_name == 'pull_request'
run: |
# Check all commits in the PR
for commit in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do
echo "Checking commit: $commit"
git log -1 --pretty=%B $commit | npx tsx scripts/check-commit.ts || exit 1
done
45 changes: 22 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ on:
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
permissions:
contents: write

steps:
- name: Checkout code
Expand All @@ -31,23 +31,21 @@ jobs:
run: |
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
if [[ "$TAG_NAME" == *"beta"* ]] || [[ "$TAG_NAME" == *"alpha"* ]] || [[ "${{ github.event.inputs.prerelease }}" == "true" ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
echo "prerelease=--prerelease" >> $GITHUB_OUTPUT
echo "release_type=Pre-release" >> $GITHUB_OUTPUT
else
echo "prerelease=false" >> $GITHUB_OUTPUT
echo "prerelease=" >> $GITHUB_OUTPUT
echo "release_type=Release" >> $GITHUB_OUTPUT
fi

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
release_name: ${{ steps.release-type.outputs.release_type }} ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
body: |
## What's Changed
- name: Create Release with GitHub CLI
run: |
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
RELEASE_TITLE="${{ steps.release-type.outputs.release_type }} $TAG_NAME"

gh release create "$TAG_NAME" \
--title "$RELEASE_TITLE" \
--notes "## What's Changed

- Automated release of commitweave CLI tool
- Enhanced commit message creation with emoji support
Expand All @@ -57,25 +55,26 @@ jobs:
## Installation

### Stable Release
```bash
\`\`\`bash
npm install -g @typeweaver/commitweave
```
\`\`\`

### Beta Release
```bash
\`\`\`bash
npm install -g @typeweaver/commitweave@beta
```
\`\`\`

## Usage

```bash
\`\`\`bash
commitweave # Start interactive commit creation
commitweave init # Initialize configuration
```
\`\`\`

Full changelog: https://github.com/GLINCKER/commitweave/compare/v0.1.0-beta.1...${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
draft: false
prerelease: ${{ steps.release-type.outputs.prerelease }}
Full changelog: https://github.com/GLINCKER/commitweave/commits/$TAG_NAME" \
${{ steps.release-type.outputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm:
needs: create-release
Expand Down
12 changes: 6 additions & 6 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Versioning Strategy

### Beta Phase (Current)
- **Current version**: `0.1.0-beta.1`
- **Current version**: `0.1.0-beta.3`
- **NPM tag**: `beta`
- **Installation**: `npm install -g @typeweaver/commitweave@beta`

Expand All @@ -30,15 +30,15 @@
#### Beta Releases (Recommended for now)
1. Update version in `package.json`:
```bash
npm version 0.1.0-beta.2 --no-git-tag-version
npm version 0.1.0-beta.3 --no-git-tag-version
```
2. Create and push beta tag:
```bash
git add package.json
git commit -m "chore: bump version to 0.1.0-beta.2"
git tag v0.1.0-beta.2
git commit -m "chore: bump version to 0.1.0-beta.3"
git tag v0.1.0-beta.3
git push origin main
git push origin v0.1.0-beta.2
git push origin v0.1.0-beta.3
```

#### Stable Releases (Future)
Expand Down Expand Up @@ -81,7 +81,7 @@ npm install -g @typeweaver/commitweave@beta
npm install -g @typeweaver/commitweave

# Specific version
npm install -g @typeweaver/commitweave@0.1.0-beta.1
npm install -g @typeweaver/commitweave@0.1.0-beta.3
```

### 5. Pre-publish Checklist
Expand Down
Loading