- Update your changelog with the commit messages from the merged PR
- Update the current version in the versionTracker.json file
- Optionally, update the version in your .csproj files
- Optionally, calculate the next release version
if your branch doesn't have protection or required checks you can use the next example:
name: Release New Version
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release-new-version:
name: Releasing new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Creating Release
uses: cangulo-actions/cangulo.nuke.releasecreator@main
with:
releaseSettingsPath: ./cicd/releaseSettings.json
token: ${{ secrets.GITHUB_TOKEN }}
However, if your branch does have protection or required checks you should check it out using a PAT (personal access token) as the next example:
name: Release New Version
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release-new-version:
name: Releasing new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_PAT }} # <-- WORKAROUND
- name: Creaing Release
uses: cangulo-actions/cangulo.nuke.releasecreator@main
with:
releaseSettingsPath: ./cicd/releaseSettings.json
token: ${{ secrets.GITHUB_TOKEN }}
name: Release New Version
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release-new-version:
name: Releasing new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Calculating Next Release Version
uses: cangulo-actions/cangulo.nuke.releasecreator@release/v0.0.1
with:
releaseSettingsPath: ./cicd/releaseSettings.json
token: ${{ secrets.GITHUB_TOKEN }}
onlyCalculateReleaseNumber: true
Please note the last parameter onlyCalculateReleaseNumber
.
- This GH Actions aims to create a new GH Release when a PR is merged. Please add the next triggers in your GH schema:
on:
pull_request:
types:
- closed
branches:
- main
- Define the current version in a json file following the next model:
{
"currentVersion": "0.0.0"
}
- Define the settings for the release in a json file following the next model:
{
"VersionTrackerFilePath": "./cicd/versionTracker.json",
"conventionalCommitsAllowed": [
{
"commitType": "fix",
"releaseType": "patch"
},
{
"commitType": "patch",
"releaseType": "patch"
},
{
"commitType": "refactor",
"releaseType": "patch"
},
{
"commitType": "feat",
"releaseType": "patch"
},
{
"commitType": "major",
"releaseType": "major"
},
{
"commitType": "break",
"releaseType": "major"
},
{
"commitType": "docs"
},
{
"commitType": "ci"
}
],
"changelogSettings": {
"changelogPath": "./CHANGELOG.md",
"commitsMode": "conventionalCommits",
"conventionalCommitsSettings": {
"types": [
"fix",
"patch",
"refactor",
"feat",
"major",
"break",
"docs"
]
}
},
"gitPushReleaseFilesSettings": {
"email": "cangulomas@outlook.com",
"name": "cangulo.nuke.releasecreator"
}
}
Property | Description |
---|---|
VersionTrackerFilePath |
json file where the current version is |
conventionalCommitsAllowed |
List of conventional commits and the release type associated are defined |
changelogSettings |
Settings for the changelog. Please note the commit types here the ones to be listed in the changelog |
gitPushReleaseFilesSettings |
git settings for the the commits done from the pipeline |
Types | Version Increase format | Description |
---|---|---|
patch |
x.y.(z+1 |
A fix or minor change that does not add features is included |
minor |
x.(y+1 ).0 |
A new feature is added |
major |
(x+1 ).0.0 |
A breaking change is included. |
Markdown file where all the changes per version are listed. Next is an example for the version v0.0.1
# v0.0.1 <- `title`
2021-10-24 <- `date`
fix: <- `commit type`
* created initial version <- `commit message`
Please note that only the commits which follows the types defined in changelogSettings.conventionalCommitsSettings.types
will be listed in the changes.
- Only use this GH action with a PR event. This is because solution depends on the PR number provided in the
${{ github.event.number }}
parameter.
The source code is in the next repo: