-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/work on release pipeline (#494)
* start work on release pipeline * firsts step release pipelines * update release pipeline * update release pipeline * update release version step * ignore flaky test; remove CircleCI
- Loading branch information
Showing
6 changed files
with
203 additions
and
271 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,85 @@ | ||
name: Create release branch | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: [ develop ] | ||
inputs: | ||
release: | ||
description: 'Type of the release.' | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: minor | ||
|
||
jobs: | ||
create_branch: | ||
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/develop' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Create version | ||
id: createVersion | ||
run: | | ||
CURRENT_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec) | ||
echo "Current version: $CURRENT_VERSION" | ||
MAJOR=`echo $CURRENT_VERSION | cut -d. -f1` | ||
MINOR=`echo $CURRENT_VERSION | cut -d. -f2` | ||
PATCH=`echo $CURRENT_VERSION | cut -d. -f3 | cut -d- -f1` | ||
if [ ${{ inputs.release }} == 'major' ]; then | ||
MAJOR=$((MAJOR+1)) | ||
MINOR=0 | ||
PATCH=0 | ||
elif [ ${{ inputs.release }} == 'minor' ]; then | ||
MINOR=$((MINOR+1)) | ||
PATCH=0 | ||
else | ||
PATCH=$((PATCH+1)) | ||
fi | ||
VERSION=${MAJOR}.${MINOR}.${PATCH} | ||
echo | ||
echo "Release version: $VERSION" | ||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Create release branch | ||
env: | ||
VERSION: ${{ steps.createVersion.outputs.VERSION }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Actions" | ||
git branch release/$VERSION | ||
git checkout release/$VERSION | ||
mvn versions:set -DnewVersion=${VERSION}-SNAPSHOT versions:commit | ||
git add pom.xml | ||
git commit -m "updated project version to ${VERSION}" | ||
git push --set-upstream origin release/$VERSION | ||
wrong_branch: | ||
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/develop' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ERROR | ||
run: echo 'This workflow only runs on develop branch!' |
Oops, something went wrong.