Skip to content

Commit 0bd090d

Browse files
committed
Using hooks
1 parent 5fa9077 commit 0bd090d

File tree

2 files changed

+10
-104
lines changed

2 files changed

+10
-104
lines changed

.github/pre-prepare-release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
while IFS= read -r -d '' pom
2+
do
3+
./mvnw org.codehaus.mojo:versions-maven-plugin:2.16.2:set-property -Dproperty=quarkus-langchain4j.version -DnewVersion=${CURRENT_VERSION} -f "$(dirname "$pom")";
4+
done < <(find samples/ -name pom.xml -print0)
5+
git commit -a -m "Update dependencies in samples"

.github/workflows/release-prepare.yml

Lines changed: 5 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -12,108 +12,9 @@ concurrency:
1212

1313
jobs:
1414
prepare-release:
15-
runs-on: ubuntu-latest
1615
name: Prepare Release
17-
if: ${{github.event.pull_request.merged == true}}
18-
19-
steps:
20-
- uses: actions/create-github-app-token@v1
21-
id: app-token
22-
name: Create GitHub App Token
23-
with:
24-
app-id: ${{ vars.CI_APP_ID }}
25-
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
26-
27-
- uses: actions/checkout@v4
28-
with:
29-
token: ${{ steps.app-token.outputs.token }}
30-
31-
- name: Get GitHub App User ID
32-
id: get-user-id
33-
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
34-
env:
35-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
36-
37-
- name: Configure Git author
38-
run: |
39-
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
40-
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
41-
42-
- uses: radcortez/project-metadata-action@main
43-
name: Retrieve project metadata
44-
id: metadata
45-
with:
46-
github-token: ${{secrets.GITHUB_TOKEN}}
47-
metadata-file-path: '.github/project.yml'
48-
local-file: true
49-
50-
- name: Set environment variables
51-
run: |
52-
echo "CURRENT_VERSION=${{steps.metadata.outputs.current-version}}" >> $GITHUB_ENV
53-
echo "NEXT_VERSION=${{steps.metadata.outputs.next-version}}" >> $GITHUB_ENV
54-
55-
- name: Set up JDK 23
56-
uses: actions/setup-java@v4
57-
with:
58-
distribution: temurin
59-
java-version: 23 # use 23 so we can support running the Llama3 module on anything 21+
60-
cache: 'maven'
61-
62-
- name: Detect Maven Executable
63-
run: |
64-
echo "MAVEN_EXEC=./mvnw" >> $GITHUB_ENV
65-
66-
- name: Update latest release version in docs
67-
if: ${{ hashFiles('docs/pom.xml') != '' }}
68-
run: |
69-
$MAVEN_EXEC -B -ntp -pl docs -am package -DskipTests -DskipITs -Denforcer.skip -Dformatter.skip -Dimpsort.skip
70-
if [[ `git status --porcelain` ]]; then
71-
git commit -a -m "Update the latest release version ${{env.CURRENT_VERSION}} in documentation"
72-
fi
73-
74-
- name: Bump .md files to ${{env.CURRENT_VERSION}}
75-
run: |
76-
find -name '*.md' -exec sed -i 's/${{env.NEXT_VERSION}}/${{env.CURRENT_VERSION}}/g' {} +
77-
find -name '*.md' -exec sed -i 's|raw.githubusercontent.com/${{ github.repository }}/main|raw.githubusercontent.com/${{ github.repository }}/${{env.CURRENT_VERSION}}|g' {} +
78-
if [[ `git status --porcelain` ]]; then
79-
git commit -a -m "Bump .md files to ${{env.CURRENT_VERSION}}"
80-
fi
81-
82-
- name: Update dependency versions for the samples
83-
run: |
84-
while IFS= read -r -d '' pom
85-
do
86-
$MAVEN_EXEC org.codehaus.mojo:versions-maven-plugin:2.16.2:set-property -Dproperty=quarkus-langchain4j.version -DnewVersion=${{steps.metadata.outputs.current-version}} -f "$(dirname "$pom")";
87-
done < <(find samples/ -name pom.xml -print0)
88-
git commit -a -m "Update dependencies in samples"
89-
90-
- name: Maven release ${{env.CURRENT_VERSION}}
91-
run: |
92-
$MAVEN_EXEC -B release:prepare -Prelease -Dgpg.skip=true -DreleaseVersion=${CURRENT_VERSION} -DdevelopmentVersion=${NEXT_VERSION} -Darguments="-Dgpg.skip=true -DprepareRelease=true" -DprepareRelease=true
93-
$MAVEN_EXEC -B release:clean
94-
95-
- name: Bump .md files to ${{env.NEXT_VERSION}}
96-
run: |
97-
find -name '*.md' -exec sed -i 's|raw.githubusercontent.com/${{ github.repository }}/${{env.CURRENT_VERSION}}|raw.githubusercontent.com/${{ github.repository }}/main|g' {} +
98-
find -name '*.md' -exec sed -i 's/${{env.CURRENT_VERSION}}/${{env.NEXT_VERSION}}/g' {} +
99-
if [[ `git status --porcelain` ]]; then
100-
git commit -a -m "Bump .md files to ${{env.NEXT_VERSION}}"
101-
fi
102-
103-
- name: Push changes to ${{github.base_ref}} branch and tag ${{env.CURRENT_VERSION}}
104-
run: |
105-
git push
106-
git push origin ${CURRENT_VERSION}
107-
108-
- name: Output release version
109-
id: out
110-
run: |
111-
echo "release-version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
112-
echo "next-version=${NEXT_VERSION}" >> $GITHUB_OUTPUT
113-
114-
- name: Create GitHub Release
115-
run: gh release create ${CURRENT_VERSION} --generate-notes --latest=${LATEST_RELEASE} --prerelease=${PRE_RELEASE}
116-
env:
117-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
118-
PRE_RELEASE: ${{ steps.metadata.outputs.pre-release == 'true' }}
119-
LATEST_RELEASE: ${{ !steps.metadata.outputs.latest || (steps.metadata.outputs.latest == 'true') }}
16+
if: ${{ github.event.pull_request.merged == true}}
17+
uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main
18+
with:
19+
java_version: 23 # use 23 so we can support running the Llama3 module on anything 21+
20+
secrets: inherit

0 commit comments

Comments
 (0)