-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add semantic versioning enforcement to repo
- Loading branch information
1 parent
c86d837
commit c3d0701
Showing
6 changed files
with
104 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
titleOnly: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Check Release | ||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
check-release: | ||
name: Check Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0 | ||
with: | ||
versionSpec: '5.x' | ||
- name: Adding PR commit message | ||
run: | | ||
echo "Checking PR title for $GITHUB_HEAD_REF based PR..." | ||
squash_commit_name=$(gh pr view $GITHUB_HEAD_REF --json title -q '.title') | ||
git config --global user.email $(git log -1 --pretty=format:'%ae') | ||
git config --global user.name $(git log -1 --pretty=format:'%an') | ||
git commit --amend -m "$squash_commit_name" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Determine Version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/execute@v0 | ||
- name: Create Release | ||
run: | | ||
latest_tag=$(git tag -l --sort -version:refname | head -n 1) | ||
echo "Latest tag: $latest_tag" | ||
upcoming_tag="v${{ steps.gitversion.outputs.GitVersion_MajorMinorPatch }}" | ||
echo "Upcoming tag: $upcoming_tag" | ||
if [ -z "$(git tag -l | grep $upcoming_tag)" ]; then | ||
echo "Version does not clash with any existing tag" | ||
echo "$upcoming_tag is the new version to release" | ||
else | ||
echo "The version clashes with an existing tag" | ||
exit 1 | ||
fi | ||
if [ "$latest_tag" != "$upcoming_tag" ]; then | ||
echo "Version does not clash with the latest created tag" | ||
echo "$upcoming_tag is the new version to release" | ||
else | ||
echo "The version clashes with the latest created tag" | ||
exit 1 | ||
fi |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
paths: | ||
- ".github/workflows/push-helm.yaml" | ||
- "charts/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
mode: Mainline | ||
major-version-bump-message: '(feat|fix)(\(.*\))?!:' | ||
minor-version-bump-message: 'feat(\(.*\))?:' | ||
patch-version-bump-message: 'fix(\(.*\))?:' | ||
no-bump-message: '(none|skip|test|refactor|docs|build|ci|style)(\(.*\))?:' | ||
commit-message-incrementing: Disabled |