Skip to content

Commit

Permalink
ci: add GitHub Action with semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
nikAizuddin committed May 13, 2023
1 parent c10c92e commit 31dbaf3
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm i -D semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/npm @semantic-release/github @semantic-release/git @semantic-release/exec @commitlint/cli @commitlint/config-conventional @google/semantic-release-replace-plugin
- run: npx semantic-release
env:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
79 changes: 79 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"branches": [
{"name": "master"},
{"name": "rc", "channel": "rc", "prerelease": "rc"},
{"name": "beta", "channel": "beta", "prerelease": "beta"},
{"name": "alpha", "channel": "alpha", "prerelease": "alpha"}
],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "angular",
"releaseRules": [
{"breaking": "true", "release": "major"},
{"type": "refactor", "release": "patch"},
{"type": "perf", "release": "patch"}
]
}],
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog"
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{"type": "feat", "section": "Features", "hidden": false},
{"type": "fix", "section": "Fixes", "hidden": false},
{"type": "docs", "section": "Documentations", "hidden": false},
{"type": "refactor", "section": "Code Refactoring", "hidden": false},
{"type": "style", "section": "Styles", "hidden": false},
{"type": "chore", "section": "Maintenance", "hidden": false},
{"type": "perf", "section": "Performance Improvements", "hidden": false},
{"type": "ci", "section": "Continuous Integrations", "hidden": false}
]
}
}],
"@semantic-release/github",
["@semantic-release/exec", {
"generateNotesCmd": "echo ${nextRelease.version} > VERSION"
}],
[
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["package.xml"],
"from": "<version>.*</version>",
"to": "<version>${nextRelease.version}</version>",
"results": [
{
"file": "package.xml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
{
"files": ["setup.py"],
"from": "version='.*',",
"to": "version='${nextRelease.version}',",
"results": [
{
"file": "setup.py",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "VERSION", "package.xml", "setup.py"]
}]
]
}

0 comments on commit 31dbaf3

Please sign in to comment.