Skip to content

Commit 259fb3a

Browse files
committed
Automate updating versions for next dev iteration
1 parent 10f9e10 commit 259fb3a

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Update versions for next dev iteration
2+
3+
on:
4+
repository_dispatch:
5+
types: [ trigger-update-versions-next-dev-iteration ]
6+
workflow_dispatch:
7+
inputs:
8+
nextStableVersion:
9+
description: "Next stable SNAPSHOT version (e.g., 1.9.0-SNAPSHOT)"
10+
required: true
11+
nextBetaVersion:
12+
description: "Next beta SNAPSHOT version (e.g., 1.9.0-beta16-SNAPSHOT)"
13+
required: true
14+
15+
env:
16+
NEXT_STABLE_VERSION: ${{ github.event.inputs.nextStableVersion || github.event.client_payload.nextStableVersion }}
17+
NEXT_BETA_VERSION: ${{ github.event.inputs.nextBetaVersion || github.event.client_payload.nextBetaVersion }}
18+
19+
jobs:
20+
update_versions:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set up JDK 25
29+
uses: actions/setup-java@v4
30+
with:
31+
java-version: '25'
32+
distribution: 'temurin'
33+
cache: maven
34+
35+
- name: Show inputs
36+
run: |
37+
echo "Next stable version: ${{ env.NEXT_STABLE_VERSION }}"
38+
echo "Next beta version: ${{ env.NEXT_BETA_VERSION }}"
39+
40+
- name: Create and switch to new branch
41+
run: |
42+
BRANCH_NAME=update-versions-${{ env.NEXT_STABLE_VERSION }}
43+
echo "branchName=$BRANCH_NAME" >> $GITHUB_ENV
44+
git checkout -b "$BRANCH_NAME"
45+
46+
- name: Extract current stable version property
47+
id: extract-current-stable
48+
run: |
49+
REVISION=$(mvn help:evaluate -Dexpression=langchain4j.stable.version -q -DforceStdout)
50+
echo "currentStableVersion=$REVISION" >> $GITHUB_OUTPUT
51+
52+
- name: Extract current beta version property
53+
id: extract-current-beta
54+
run: |
55+
REVISION=$(mvn help:evaluate -Dexpression=langchain4j.beta.version -q -DforceStdout)
56+
echo "currentBetaVersion=$REVISION" >> $GITHUB_OUTPUT
57+
58+
- name: Update stable versions
59+
run: |
60+
mvn versions:set \
61+
-DnewVersion=${{ env.NEXT_STABLE_VERSION }} \
62+
-DoldVersion=${{ steps.extract-current-stable.outputs.currentStableVersion }} \
63+
-DgroupId=* -DartifactId=* -DgenerateBackupPoms=false
64+
65+
- name: Update stable version property
66+
run: |
67+
mvn versions:set-property \
68+
-Dproperty=langchain4j.stable.version \
69+
-DnewVersion=${{ env.NEXT_STABLE_VERSION }} \
70+
-DgenerateBackupPoms=false
71+
72+
- name: Update beta versions
73+
run: |
74+
mvn versions:set \
75+
-DnewVersion=${{ env.NEXT_BETA_VERSION }} \
76+
-DoldVersion=${{ steps.extract-current-beta.outputs.currentBetaVersion }} \
77+
-DgroupId=* -DartifactId=* -DgenerateBackupPoms=false
78+
79+
- name: Update beta version property
80+
run: |
81+
mvn versions:set-property \
82+
-Dproperty=langchain4j.beta.version \
83+
-DnewVersion=${{ env.NEXT_BETA_VERSION }} \
84+
-DgenerateBackupPoms=false
85+
86+
- name: Commit and push changes
87+
run: |
88+
git config user.name "github-actions[bot]"
89+
git config user.email "github-actions[bot]@users.noreply.github.com"
90+
91+
git add .
92+
git commit -m "Update versions to ${{ env.NEXT_STABLE_VERSION }} and ${{ env.NEXT_BETA_VERSION }}"
93+
git push origin "$branchName"

0 commit comments

Comments
 (0)