Skip to content

Commit 4cce19c

Browse files
committed
ci(*): add semantic release
1 parent f8af397 commit 4cce19c

File tree

5 files changed

+8521
-2408
lines changed

5 files changed

+8521
-2408
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
env:
15+
NODE_VERSION: 20
16+
17+
jobs:
18+
release:
19+
name: Semantic Release
20+
runs-on: ubuntu-latest
21+
if: github.repository == 'michaelwolz/capacitor-camera-view'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ env.NODE_VERSION }}
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Semantic Release
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
run: npx semantic-release

.releaserc.json

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+
"plugins": [
6+
["@semantic-release/commit-analyzer"],
7+
["@semantic-release/release-notes-generator"],
8+
["@semantic-release/changelog"],
9+
["@semantic-release/npm"],
10+
["@semantic-release/github"],
11+
["@semantic-release/git", {
12+
"assets": ["CHANGELOG.md", "package.json"],
13+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14+
}]
15+
],
16+
"preset": "conventionalcommits",
17+
"dryRun": true
18+
}

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ See the [`BarcodeDetectionData`](#barcodedetectiondata) interface for details on
173173

174174
To see the plugin in action, check out the example app in the `example-app` folder. The app demonstrates how to integrate and use the Capacitor Camera View plugin in an Ionic Angular project.
175175

176+
## Semantic Release
177+
178+
This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated versioning and changelog generation based on conventional commits.
179+
180+
## Conventional Commits
181+
182+
Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for your commit messages. Example:
183+
184+
```
185+
feat(camera): add autofocus support
186+
fix(android): resolve crash on startup
187+
chore: update dependencies
188+
```
189+
190+
## Resources
191+
- [semantic-release documentation](https://semantic-release.gitbook.io/semantic-release/)
192+
- [Conventional Commits](https://www.conventionalcommits.org/)
193+
194+
176195
## API
177196

178197
<docgen-index>

0 commit comments

Comments
 (0)