Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the new version and the 10.2 base version #7

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pentaho-generic-file-system merge workflow
on:
push:
branches: # Specify branches so that it doesn't get executed when a tag is pushed
- "*"
- master
paths-ignore:
- .github/**

Expand All @@ -17,10 +17,11 @@ jobs:
reusable-merge-workflow:
uses: pentaho/actions-common/.github/workflows/merge.yml@stable
with:
version: "10.3.1.0"
base_version: "[10.3,10.4)"
base_version: "10.2.0.1-255"
slack_channels: ""
sonar_project_key: "pentaho-generic-file-system"
modules_to_build: ${{ inputs.modules_to_build }}
run_release_candidate: true
add_github_run_number: false
use_semver_release_candidate: true
secrets: inherit
27 changes: 22 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,36 @@ name: pentaho-generic-file-system release workflow
on:
workflow_dispatch:
inputs:
release_version:
required: true
description: "The version to be released"
type: string
dry_run:
type: boolean
default: true
description: "Dry run. No real changes should occur."

jobs:
reusable-merge-workflow:
uses: pentaho/actions-common/.github/workflows/merge.yml@stable
with:
base_version: "10.2.0.1-255"
slack_channels: ""
sonar_project_key: "pentaho-generic-file-system"
modules_to_build: ${{ inputs.modules_to_build }}
run_release_candidate: true
run_snapshot: false
add_github_run_number: false
use_semver_release_candidate: false
secrets: inherit

release:
needs: [reusable-merge-workflow]
uses: pentaho/actions-common/.github/workflows/release.yml@stable
with:
release_version: ${{ inputs.release_version }}
release_version: ${{ needs.reusable-merge-workflow.outputs.current-version }}
dry_run: ${{ inputs.dry_run }}
secrets: inherit

update-version:
needs: [release]
uses: ./.github/workflows/update-version.yml
with:
dry_run: ${{ inputs.dry_run }}
secrets: inherit
75 changes: 75 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Pentaho update version workflow
on:
workflow_call:
inputs:
dry_run:
type: boolean
default: true
description: "Dry run. No real changes should occur."
jobs:
bump-version:
runs-on: [ k8s ]
container:
image: one.hitachivantara.com/devops-docker-release/pentaho/actions-common:20240305.137
credentials:
username: ${{ secrets.PENTAHO_CICD_ONE_USER }}
password: ${{ secrets.PENTAHO_CICD_ONE_KEY }}
volumes:
- /home/runner/caches/pentaho/.m2:/root/.m2
steps:
- name: Retrieve settings file
id: common-maven
uses: pentaho/actions-common@stable

- name: Copy settings.xml to .m2 directory
shell: sh
run: |
cp "${{ steps.common-maven.outputs.settings-file-path }}" /root/.m2

- name: Checkout source repo
uses: actions/checkout@v4

- name: Get current version
id: get-version
run: |
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Current version: $current_version"
echo "current_version=$current_version" >> $GITHUB_OUTPUT

- name: Increment patch version
id: increment-version
shell: bash
run: |
current_version=${{ steps.get-version.outputs.current_version }}

# Remove the -SNAPSHOT suffix if present
base_version=${current_version%-SNAPSHOT}

version_parts=$(echo $base_version | tr '.' ' ')
version_major=$(echo $version_parts | awk '{print $1}')
version_minor=$(echo $version_parts | awk '{print $2}')
version_patch=$(echo $version_parts | awk '{print $3 + 1}')
new_version="${version_major}.${version_minor}.${version_patch}"

# Reattach the -SNAPSHOT suffix if it was present
if [[ "$current_version" == *"-SNAPSHOT" ]]; then
new_version="$new_version-SNAPSHOT"
fi

echo "New version: $new_version"
echo "new_version=$new_version" >> $GITHUB_OUTPUT

- name: Update Maven version
run: mvn versions:set -DnewVersion=${{ steps.increment-version.outputs.new_version }}

- name: Commit changes
if: ${{ inputs.dry_run == false }}
run: |
git config --global --add safe.directory /__w/pentaho-generic-file-system/pentaho-generic-file-system
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add 'pom.xml' '**/pom.xml'
git commit -m "Update version to ${{ steps.increment-version.outputs.new_version }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>pentaho</groupId>
<artifactId>pentaho-generic-file-system-parent</artifactId>
<version>10.3.0.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>pentaho-generic-file-system-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>pentaho</groupId>
<artifactId>pentaho-generic-file-system-parent</artifactId>
<version>10.3.0.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>pentaho-generic-file-system-impl</artifactId>
Expand Down
20 changes: 17 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
<parent>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-ce-jar-parent-pom</artifactId>
<version>10.3.0.0-SNAPSHOT</version>
<version>10.2.0.0-SNAPSHOT</version>
</parent>

<groupId>pentaho</groupId>
<artifactId>pentaho-generic-file-system-parent</artifactId>
<version>10.3.0.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<platform.version>10.2.0.0-SNAPSHOT</platform.version>
<mockito-core.version>4.0.0</mockito-core.version>
<com.github.spotbugs.annotations.version>4.2.3</com.github.spotbugs.annotations.version>
<artifactory-maven-plugin.version>3.6.1</artifactory-maven-plugin.version>
<platform.version>10.3.0.0-SNAPSHOT</platform.version>
<versions-maven-plugin.version>2.17.1</versions-maven-plugin.version>
</properties>

<dependencyManagement>
Expand All @@ -39,6 +40,19 @@
<module>impl</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>cicd-release</id>
Expand Down
Loading