Skip to content

Commit 3dc75d1

Browse files
authored
feat(ci): add semantic-release config and GitHub workflow (#6)
1 parent 08200f6 commit 3dc75d1

5 files changed

Lines changed: 73 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- run: npm ci
18+
- run: npx semantic-release
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "develop",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
"@semantic-release/release-notes-generator",
12+
"@semantic-release/changelog",
13+
"@semantic-release/git",
14+
"@semantic-release/github"
15+
],
16+
"preset": "conventionalcommits",
17+
"tagFormat": "v${version}"
18+
}

CHANGELOG.md

Whitespace-only changes.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,16 @@ You can define default settings in `~/.http-cli.conf`:
4242
```
4343
USER_AGENT="http-cli/0.1 (https://github.com/ql4b/http-cli)"
4444
TIMEOUT=10
45-
```
45+
```
46+
47+
## Release Strategy
48+
49+
This project uses [semantic-release](https://semantic-release.gitbook.io/) to automate versioning and changelog generation.
50+
51+
- Commits to `main` trigger **stable releases** (e.g. `v1.2.3`)
52+
- Commits to `develop` trigger **prereleases** (e.g. `v1.3.0-beta.1`)
53+
54+
Releases are based on [Conventional Commits](https://www.conventionalcommits.org/), so use commit messages like:
55+
- `feat: add new feature`
56+
- `fix: correct bug`
57+
- `chore: update metadata`

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "http-cli",
3+
"version": "0.0.0-development",
4+
"description": "A shell script that acts like a teammate — Bash-based HTTP client built around curl.",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/ql4b/http-cli.git"
8+
},
9+
"license": "MIT",
10+
"scripts": {
11+
"release": "semantic-release"
12+
},
13+
"devDependencies": {
14+
"@semantic-release/changelog": "^6.0.3",
15+
"@semantic-release/git": "^10.0.1",
16+
"@semantic-release/github": "^9.0.6",
17+
"semantic-release": "^22.0.12"
18+
},
19+
"release": {
20+
"changelogFile": "CHANGELOG.md"
21+
}
22+
}

0 commit comments

Comments
 (0)