Skip to content

Commit 86722b5

Browse files
committed
test syntax for separate kn and regular releases
1 parent 1a6e6e3 commit 86722b5

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/run-release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: Release
22

33
on:
4+
pull_request:
45
workflow_dispatch:
56
inputs:
67
version-override:
78
type: string
89
required: false
910
description: 'Optionally specify a custom release version (minor version bump e.g.)'
11+
kn-release:
12+
type: boolean
13+
required: false
14+
default: false
15+
description: 'Whether the release is a KN variant of repo tools'
1016

1117
permissions:
1218
id-token: write
@@ -30,12 +36,20 @@ jobs:
3036
exit 0
3137
fi
3238
33-
CURRENT_VERSION=$(git tag --sort=-creatordate | head -n 1)
39+
if [ "${{ inputs.kn-release }}" == "true" ]; then
40+
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -- '-kn$' | head -n 1)
41+
else
42+
CURRENT_VERSION=$(git tag --sort=-creatordate | head -n 1)
43+
fi
3444
3545
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
36-
PATCH=$((PATCH + 1))
37-
RESOLVED_VERSION="$MAJOR.$MINOR.$PATCH"
3846
47+
PATCH_NUMBER=${PATCH%%[^0-9]*}
48+
SUFFIX=${PATCH#$PATCH_NUMBER}
49+
((PATCH_NUMBER++))
50+
PATCH="${PATCH_NUMBER}${SUFFIX}"
51+
52+
RESOLVED_VERSION="$MAJOR.$MINOR.$PATCH"
3953
echo "NEW_VERSION=$RESOLVED_VERSION" >> "$GITHUB_OUTPUT"
4054
4155
- name: Configure git
@@ -49,6 +63,7 @@ jobs:
4963
run: |
5064
git tag "$NEW_VERSION"
5165
git push origin "$NEW_VERSION"
66+
exit 1
5267
5368
- name: Configure Gradle
5469
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main

0 commit comments

Comments
 (0)