Skip to content

Commit a67544c

Browse files
authored
Merge pull request #1 from AutomationDojo/semantic-release
feat: add semantic release support
2 parents a103c39 + deb040e commit a67544c

9 files changed

Lines changed: 39310 additions & 5 deletions

File tree

.github/workflows/pr-size-check-external.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened]
99

10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
1015
jobs:
1116
check-pr-size:
1217
runs-on: ubuntu-latest

.github/workflows/pr-size-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
712
jobs:
813
check-pr-size:
914
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: npx semantic-release

.releaserc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
branches:
2+
- main
3+
4+
plugins:
5+
- '@semantic-release/commit-analyzer'
6+
- '@semantic-release/release-notes-generator'
7+
- '@semantic-release/changelog'
8+
- - '@semantic-release/npm'
9+
- npmPublish: false
10+
- - '@semantic-release/git'
11+
- assets:
12+
- package.json
13+
- package-lock.json
14+
- CHANGELOG.md
15+
- dist/**/*
16+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
17+
- '@semantic-release/github'

README.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,29 +122,74 @@ The action automatically creates the following labels:
122122

123123
```bash
124124
npm install
125+
npm run build
125126
```
126127

128+
### Building
129+
130+
The action uses [@vercel/ncc](https://github.com/vercel/ncc) to compile the code and dependencies into a single file. This eliminates the need to commit `node_modules`.
131+
132+
```bash
133+
npm run build
134+
```
135+
136+
This creates a `dist/index.js` file that includes all dependencies bundled together.
137+
127138
### File Structure
128139

129140
```
130141
github-custom-action-examples/
131-
├── action.yml # Action metadata
132-
├── index.js # Main logic
142+
├── action.yml # Action metadata (points to dist/index.js)
143+
├── index.js # Main logic (source)
144+
├── dist/
145+
│ └── index.js # Bundled code with dependencies (commit this!)
133146
├── package.json # Dependencies
134147
├── README.md # Documentation
135148
└── .github/
136149
└── workflows/
150+
├── release.yml # Semantic Release workflow
137151
├── pr-size-check.yml # Local usage example
138152
└── pr-size-check-external.yml # External usage example
139153
```
140154
155+
## Releases and Versioning
156+
157+
This project uses [Semantic Release](https://semantic-release.gitbook.io/) for automated versioning and releases.
158+
159+
### Commit Message Format
160+
161+
Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
162+
163+
- `feat:` - A new feature (triggers minor version bump)
164+
- `fix:` - A bug fix (triggers patch version bump)
165+
- `docs:` - Documentation changes
166+
- `chore:` - Maintenance tasks
167+
- `BREAKING CHANGE:` - Breaking changes (triggers major version bump)
168+
169+
**Examples:**
170+
171+
```bash
172+
feat: add support for custom label colors
173+
fix: resolve issue with label removal
174+
docs: update README with new examples
175+
chore: update dependencies
176+
```
177+
178+
### How It Works
179+
180+
1. Push commits to `main` branch using conventional commit format
181+
2. Semantic Release analyzes commits and determines version bump
182+
3. Automatically generates CHANGELOG.md
183+
4. Creates a GitHub release with release notes
184+
5. Updates version in package.json
185+
141186
## Contributing
142187

143188
Contributions are welcome! Please:
144189

145190
1. Fork the repository
146191
2. Create a branch for your feature
147-
3. Commit your changes
192+
3. Commit your changes using conventional commit format
148193
4. Open a Pull Request
149194

150195
## License

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ outputs:
3535

3636
runs:
3737
using: 'node20'
38-
main: 'index.js'
38+
main: 'dist/index.js'

0 commit comments

Comments
 (0)