-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #589 from catenax-ng/feature/TRI-1468-enable-full-…
…library-release Feature/tri 1468 enable full library release
- Loading branch information
Showing
5 changed files
with
173 additions
and
1 deletion.
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,61 @@ | ||
name: "Update DEPENDENCIES file" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Cache maven packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Generate Dependencies file | ||
run: mvn org.eclipse.dash:license-tool-plugin:license-check -Ddash.summary=DEPENDENCIES | ||
|
||
- name: Check if file was changed | ||
run: | | ||
if git diff --name-only ${{ github.base_ref }}...${{ github.sha }} | grep -e 'DEPENDENCIES'; then | ||
echo "The file was changed" | ||
echo "was_file_changed=true" >> "$GITHUB_ENV" | ||
git | ||
else | ||
echo "The file was not changed" | ||
echo "was_file_changed=false" >> "$GITHUB_ENV" | ||
fi | ||
- name: Configure Git | ||
if: ${{ env.was_file_changed }} == 'true' | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Create pull request | ||
if: ${{ env.was_file_changed }} == 'true' | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
add-paths: | | ||
DEPENDENCIES | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: chore/update-DEPENDENCIES | ||
commit-message: "chore(dependencies): Update DEPENDENCIES" | ||
delete-branch: true | ||
title: Update DEPENDENCIES | ||
body: | | ||
This PR updates the DEPENDENCIES |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Update irs-registry-client Version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version-type: | ||
type: choice | ||
description: Type of version increment | ||
required: true | ||
options: | ||
- 'major' | ||
- 'minor' | ||
- 'path' | ||
is-release-version: | ||
type: boolean | ||
required: true | ||
default: false | ||
description: Select this if you want to create a release version (x.x.x) instead of a SNAPSHOT. | ||
|
||
jobs: | ||
open-pr-with-version-update: | ||
name: "Open a Pull Request with the updated version of irs-registry-client." | ||
runs-on: ubuntu-latest | ||
needs: | ||
- validate-input-version | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Create new version | ||
env: | ||
TYPE: ${{ inputs.version-type }} | ||
IS_RELEASE_VERSION: ${{ inputs.is-release-version }} | ||
run: | | ||
CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl irs-registry-client) | ||
IFS='.' read -ra version_parts <<<"$CURRENT_VERSION" | ||
major="${version_parts[0]}" | ||
minor="${version_parts[1]}" | ||
patch="${version_parts[2]}" | ||
# Increment the version based on the increment type | ||
if [ "$TYPE" == "major" ]; then | ||
major=$((major + 1)) | ||
minor=0 | ||
patch=0 | ||
elif [ "$TYPE" == "minor" ]; then | ||
minor=$((minor + 1)) | ||
patch=0 | ||
elif [ "$TYPE" == "patch" ]; then | ||
patch=$((patch + 1)) | ||
else | ||
echo "Invalid increment type. Use 'major', 'minor', or 'patch'." | ||
exit 1 | ||
fi | ||
new_version="${major}.${minor}.${patch}-SNAPSHOT" | ||
if [ $IS_RELEASE_VERSION = 'true' ]; then | ||
new_version="${major}.${minor}.${patch}" | ||
fi | ||
echo "$new_version" | ||
- name: Update irs-registry-client version | ||
env: | ||
VERSION: ${{ inputs.next-version }} | ||
run: |- | ||
sed -i -e 's#<irs-registry-client\.version>.*</irs-registry-client\.version>#<irs-registry-client\.version>'$VERSION'</irs-registry-client\.version>#g' pom.xml | ||
- name: Create PR for irs-registry-client version update | ||
uses: peter-evans/create-pull-request@v5 | ||
env: | ||
VERSION: ${{ inputs.next-version }} | ||
with: | ||
commit-message: "chore(dependencies): Update irs-registry-client to $VERSION" | ||
branch: chore/update-irs-registry-client-$VERSION | ||
base: main | ||
delete-branch: true | ||
title: Update irs-registry-client to $VERSION | ||
body: | | ||
This PR updates the irs-registry-client version to $VERSION. |
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