Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Dec 3, 2023
1 parent 8a32aad commit 23de11f
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 'Release'
on:
push:
branches:
- main

jobs:
release:
name: 'Release'
runs-on: ubuntu-latest
# Skip running release workflow on forks
if: github.repository_owner == 'antmelekhin'
steps:
- name: 'Checkout the codebase'
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: 'Semantic Release'
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/git@10.0.1
@semantic-release/changelog@6.0.3
conventional-changelog-conventionalcommits@5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
94 changes: 94 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
branches: ['main']
preset: 'conventionalcommits'
ci: false

verifyConditions:
- '@semantic-release/changelog'
- '@semantic-release/git'
- '@semantic-release/github'

analyzeCommits:
- path: '@semantic-release/commit-analyzer'
releaseRules:
- type: 'breaking'
release: 'major'
- type: 'chore'
release: false
- type: 'ci'
release: false
- type: 'docs'
release: false
- type: 'feat'
release: 'minor'
- type: 'fix'
release: 'patch'
- type: 'improv'
release: 'minor'
- type: 'refactor'
release: 'patch'
- type: 'revert'
release: 'patch'
- type: 'style'
release: false
- type: 'test'
release: false

generateNotes:
- path: '@semantic-release/release-notes-generator'
writerOpts:
groupBy: 'type'
commitGroupsSort: 'title'
commitsSort: 'header'
linkCompare: true
linkReferences: true
presetConfig:
types:
- type: 'breaking'
section: 'Breaking changes!'
hidden: false
- type: 'chore'
section: 'Miscellaneous Chores'
hidden: true
- type: 'ci'
section: 'Continuous Integration'
hidden: false
- type: 'docs'
section: 'Documentation'
hidden: false
- type: 'feat'
section: 'Features'
hidden: false
- type: 'fix'
section: 'Fixes'
hidden: false
- type: 'improv'
section: 'Improvements'
hidden: false
- type: 'refactor'
section: 'Code Refactoring'
hidden: false
- type: 'revert'
section: 'Reverts'
hidden: false
- type: 'style'
section: 'Styles'
hidden: false
- type: 'test'
section: 'Tests'
hidden: false

prepare:
- path: '@semantic-release/changelog'
changelogFile: 'CHANGELOG.md'
changelogTitle: '# Changelog'
- path: '@semantic-release/git'
assets: ['CHANGELOG.md']
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

publish:
- path: '@semantic-release/github'

success: false

fail: false

0 comments on commit 23de11f

Please sign in to comment.