Skip to content

Commit

Permalink
Add: release tag toml
Browse files Browse the repository at this point in the history
Adds function to automatically add release labels based on a
configuration.
  • Loading branch information
nichtsfrei committed Mar 18, 2024
1 parent 53cd197 commit 38892ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
with:
token: ${{ secrets.token }}
fetch-depth: '0'

- name: set git credentials
run: |
git config --global user.email "${{ secrets.email }}"
Expand All @@ -77,15 +78,13 @@ jobs:
git checkout "v${{ env.LATEST_VERSION }}"
# get just the major version of latest version
export BRANCH_NAME=$(echo "${{ env.LATEST_VERSION }}" | sed 's/^\([0-9]*\).*/v\1/')
git checkout -b "$BRANCH_NAME"
git push origin "$BRANCH_NAME"
git checkout -b "$BRANCH_NAME" && git push origin "$BRANCH_NAME" || true
# create branch of version
- uses: greenbone/actions/setup-pontos@v3
- name: prepare project version ${{ env.RELEASE_REF }} ${{ env.LATEST_VERSION }} -> ${{ env.NEW_VERSION }}
run: |
# jump back for the case that we switched to a tag
git checkout "${{ env.RELEASE_REF }}"
# change version
python3 -m pip install pontos
# ignore failure on setting version
pontos-version update ${{ env.NEW_VERSION }} || true
# set app version on chart
Expand All @@ -107,7 +106,6 @@ jobs:
with:
name: rs-binaries
path: assets
- uses: greenbone/actions/setup-pontos@v3
- name: release ${{ env.PROJECT }} ${{ env.LATEST_VERSION }} -> ${{ env.NEW_VERSION }}
run: |
pontos-changelog \
Expand Down
22 changes: 22 additions & 0 deletions release_tag.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# the name functions as a key and should be unique.
# The priority is used when only_highest_priority is set to true
labels = [
{ name = "patch_release", priority = 1 },
{ name = "minor_release", priority = 2 },
{ name = "major_release", priority = 3 },
]

# group within groups must be defined in `changelog.toml`
# label within groups must be defined in `labels`
groups = [
{ group = "Added", label = "minor_release" },
{ group = "Changed", label = "minor_release" }, # maybe major?
{ group = "Removed", label = "minor_release" }, # maybe major?
{ group = "Bug Fix", label = "major_release" },
]

# when set to false all unique labels will be set
# otherwise only one label with the highest priority
# will be set
only_highest_priority = true

0 comments on commit 38892ed

Please sign in to comment.