Skip to content

Commit d7fa6fe

Browse files
authored
Permit alpha, beta, and RC releases (#22)
1 parent 303046e commit d7fa6fe

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

.github/workflows/create_release.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ on:
3030
description: "Hash of 'Release version x.y.z' commit"
3131
required: true
3232

33+
permissions:
34+
contents: write
35+
pull-requests: write
36+
issues: write
37+
3338
jobs:
3439
build:
3540
name: Create Release
3641
runs-on: ubuntu-latest
3742
steps:
38-
- name: Setup Java SDK
39-
uses: actions/[email protected]
40-
with:
41-
java-version: 11
42-
4343
- name: Checkout code
4444
uses: actions/checkout@v2
4545
with:
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
export commit_title=$(git log --pretty=format:%s -1 ${{ github.event.inputs.commit_hash }})
5151
echo "Commit title: $commit_title"
52-
if [[ $commit_title =~ ^Release\ version\ [0-9]*\.[0-9]*\.[0-9]*$ ]]; then
52+
if [[ $commit_title =~ ^Release\ version\ [0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc[0-9]+))?$ ]]; then
5353
echo "Valid commit title"
5454
else
5555
echo "Invalid commit title"
@@ -59,6 +59,13 @@ jobs:
5959
echo "Will use version ${version}"
6060
echo "version=${version}" >> $GITHUB_ENV
6161
62+
- name: Set up JDK 8
63+
uses: actions/setup-java@v4
64+
with:
65+
distribution: 'adopt'
66+
java-version: 8
67+
cache: maven
68+
6269
- name: Build
6370
run: |
6471
mvn -f kcbq-connector clean package assembly:single@release-artifacts -DskipTests

.github/workflows/release_pr_workflow.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ on:
3333
description: "Snapshot version '0.2.0-SNAPSHOT' (without 'v')"
3434
required: true
3535

36+
permissions:
37+
contents: write
38+
pull-requests: write
39+
issues: write
40+
3641
jobs:
3742
create_release_pr:
3843
name: Create release PR (job)
@@ -41,7 +46,7 @@ jobs:
4146
- name: Check versions
4247
run: |
4348
echo "Checking release version..."
44-
if echo ${{ github.event.inputs.release_version }} | grep --invert-match '^[0-9]\+\.[0-9]\+\.[0-9]\+$' > /dev/null; then
49+
if echo ${{ github.event.inputs.release_version }} | '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\(alpha\|beta\|rc[0-9]\+\)\)\?$' > /dev/null; then
4550
echo "Release version is invalid"
4651
exit 1
4752
fi
@@ -58,6 +63,13 @@ jobs:
5863
ref: master
5964
fetch-depth: 0
6065

66+
- name: Set up JDK 8
67+
uses: actions/setup-java@v4
68+
with:
69+
distribution: 'adopt'
70+
java-version: 8
71+
cache: maven
72+
6173
- name: Create release commits
6274
run: |
6375
git config --local user.name "GitHub Action"

0 commit comments

Comments
 (0)