Merge pull request #126 from premisedata/DA-342-Add-semantic-versioni… #136
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Semantic Versioning - Minor/Patch | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy: | |
name: Minor/Patch release | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Changelog Enforcer | |
uses: dangoslen/changelog-enforcer@v2 | |
with: | |
changeLogPath: 'project_1/changelog.md' | |
- name: Increment version | |
id: increment_version | |
uses: paulhatch/[email protected] | |
with: | |
tag_prefix: "" | |
major_pattern: (MAJOR) | |
minor_pattern: (MINOR) | |
version_format: ${major}.${minor}.${patch} | |
debug: true | |
- name: Tag | |
if: ${{ steps.increment_version.outputs.version_type == 'minor' || steps.increment_version.outputs.version_type == 'patch' }} | |
run: | | |
git tag ${{ steps.increment_version.outputs.version }} | |
git push origin ${{ steps.increment_version.outputs.version }} | |
- name: Release | |
if: ${{ steps.increment_version.outputs.version_type == 'minor' || steps.increment_version.outputs.version_type == 'patch' }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.increment_version.outputs.version }} | |
release_name: Release ${{ steps.increment_version.outputs.version }} | |
body: ${{ github.event.head_commit.message }} | |
draft: false | |
prerelease: false | |