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