mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 21:18:17 +00:00
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
|
|
jobs:
|
|
create:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Calculate semantic version
|
|
id: version
|
|
uses: 3h4x/semantic-version@master
|
|
with:
|
|
tag_prefix: "v"
|
|
major_pattern: "/^(feat|refactor)!:/"
|
|
minor_pattern: "/^(feat|refactor):/"
|
|
version_format: "${major}.${minor}.${patch}"
|
|
bump_each_commit: false
|
|
search_commit_body: false
|
|
user_format_type: "json"
|
|
|
|
- name: Push tag
|
|
run: |
|
|
git tag v${{ steps.version.outputs.version }}
|
|
git push origin v${{ steps.version.outputs.version }}
|
|
|
|
- name: Update CHANGELOG
|
|
id: changelog
|
|
uses: requarks/changelog-action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag: v${{ steps.version.outputs.version }}
|
|
|
|
- name: Create Release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
allowUpdates: true
|
|
draft: false
|
|
name: v${{ steps.version.outputs.version }}
|
|
tag: v${{ steps.version.outputs.version }}
|
|
body: ${{ steps.changelog.outputs.changes }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Commit CHANGELOG.md
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
branch: master
|
|
commit_message: "build(release): update CHANGELOG.md for v${{ steps.version.outputs.version }} [skip ci]"
|
|
file_pattern: CHANGELOG.md
|