Skip to content

Commit c96e489

Browse files
authored
Merge pull request #2 from GLINCKER/develop
Develop
2 parents 3a10fdc + edcda2e commit c96e489

File tree

13 files changed

+1647
-484
lines changed

13 files changed

+1647
-484
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: ["*"] # Run on all branches (including develop, feature branches)
66
pull_request:
7-
branches: [main]
7+
branches: [main] # Run on PRs to main
88

99
jobs:
1010
test:

.github/workflows/commit-lint.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Commit Message Validation
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
commit-lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Fetch all history to check commits
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build project
29+
run: npm run build
30+
31+
- name: Validate commit message
32+
run: npm run check
33+
# Alternative: use the CLI directly
34+
# run: npx commitweave check
35+
36+
- name: Validate all commits in PR (for pull requests)
37+
if: github.event_name == 'pull_request'
38+
run: |
39+
# Check all commits in the PR
40+
for commit in $(git rev-list ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}); do
41+
echo "Checking commit: $commit"
42+
git log -1 --pretty=%B $commit | npx tsx scripts/check-commit.ts || exit 1
43+
done

.github/workflows/release.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ on:
1919
jobs:
2020
create-release:
2121
runs-on: ubuntu-latest
22-
outputs:
23-
upload_url: ${{ steps.create_release.outputs.upload_url }}
22+
permissions:
23+
contents: write
2424

2525
steps:
2626
- name: Checkout code
@@ -31,23 +31,21 @@ jobs:
3131
run: |
3232
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
3333
if [[ "$TAG_NAME" == *"beta"* ]] || [[ "$TAG_NAME" == *"alpha"* ]] || [[ "${{ github.event.inputs.prerelease }}" == "true" ]]; then
34-
echo "prerelease=true" >> $GITHUB_OUTPUT
34+
echo "prerelease=--prerelease" >> $GITHUB_OUTPUT
3535
echo "release_type=Pre-release" >> $GITHUB_OUTPUT
3636
else
37-
echo "prerelease=false" >> $GITHUB_OUTPUT
37+
echo "prerelease=" >> $GITHUB_OUTPUT
3838
echo "release_type=Release" >> $GITHUB_OUTPUT
3939
fi
4040
41-
- name: Create Release
42-
id: create_release
43-
uses: actions/create-release@v1
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
tag_name: ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
48-
release_name: ${{ steps.release-type.outputs.release_type }} ${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
49-
body: |
50-
## What's Changed
41+
- name: Create Release with GitHub CLI
42+
run: |
43+
TAG_NAME="${{ github.ref_name || format('v{0}', github.event.inputs.version) }}"
44+
RELEASE_TITLE="${{ steps.release-type.outputs.release_type }} $TAG_NAME"
45+
46+
gh release create "$TAG_NAME" \
47+
--title "$RELEASE_TITLE" \
48+
--notes "## What's Changed
5149
5250
- Automated release of commitweave CLI tool
5351
- Enhanced commit message creation with emoji support
@@ -57,25 +55,26 @@ jobs:
5755
## Installation
5856
5957
### Stable Release
60-
```bash
58+
\`\`\`bash
6159
npm install -g @typeweaver/commitweave
62-
```
60+
\`\`\`
6361
6462
### Beta Release
65-
```bash
63+
\`\`\`bash
6664
npm install -g @typeweaver/commitweave@beta
67-
```
65+
\`\`\`
6866
6967
## Usage
7068
71-
```bash
69+
\`\`\`bash
7270
commitweave # Start interactive commit creation
7371
commitweave init # Initialize configuration
74-
```
72+
\`\`\`
7573
76-
Full changelog: https://github.com/GLINCKER/commitweave/compare/v0.1.0-beta.1...${{ github.ref_name || format('v{0}', github.event.inputs.version) }}
77-
draft: false
78-
prerelease: ${{ steps.release-type.outputs.prerelease }}
74+
Full changelog: https://github.com/GLINCKER/commitweave/commits/$TAG_NAME" \
75+
${{ steps.release-type.outputs.prerelease }}
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7978

8079
publish-npm:
8180
needs: create-release

PUBLISHING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Versioning Strategy
44

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

@@ -30,15 +30,15 @@
3030
#### Beta Releases (Recommended for now)
3131
1. Update version in `package.json`:
3232
```bash
33-
npm version 0.1.0-beta.2 --no-git-tag-version
33+
npm version 0.1.0-beta.3 --no-git-tag-version
3434
```
3535
2. Create and push beta tag:
3636
```bash
3737
git add package.json
38-
git commit -m "chore: bump version to 0.1.0-beta.2"
39-
git tag v0.1.0-beta.2
38+
git commit -m "chore: bump version to 0.1.0-beta.3"
39+
git tag v0.1.0-beta.3
4040
git push origin main
41-
git push origin v0.1.0-beta.2
41+
git push origin v0.1.0-beta.3
4242
```
4343

4444
#### Stable Releases (Future)
@@ -81,7 +81,7 @@ npm install -g @typeweaver/commitweave@beta
8181
npm install -g @typeweaver/commitweave
8282

8383
# Specific version
84-
npm install -g @typeweaver/commitweave@0.1.0-beta.1
84+
npm install -g @typeweaver/commitweave@0.1.0-beta.3
8585
```
8686

8787
### 5. Pre-publish Checklist

0 commit comments

Comments
 (0)