Skip to content

Commit

Permalink
refactor: add automatic releases
Browse files Browse the repository at this point in the history
Add an automatic release workflow and conventional commits. The release workflow determines the
version from the type of commits and then links each commit to a changelog entry in the appropriate
section, according to the type of the latter.
  • Loading branch information
Lanhild committed Dec 2, 2024
1 parent 1367d95 commit e0fbe9c
Show file tree
Hide file tree
Showing 7 changed files with 8,666 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish GitHub release
run-name: Release by @${{ github.actor }}

on:
push:
branches:
- main

jobs:
publish-release:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUSKY: 0
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ pipelines/*
.DS_Store

.venv
venv/
venv/

# Dependency directories
node_modules/

# Optional npm cache directory
.npm
2 changes: 2 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec < /dev/tty && npx cz --hook || true
32 changes: 32 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"successComment": false,
"failTitle": false
}
]
],
"preset": "angular"
}
Empty file added CHANGELOG.md
Empty file.
Loading

0 comments on commit e0fbe9c

Please sign in to comment.