Skip to content

Commit 957892a

Browse files
committed
ci: GitHub Actions workflows
- Update build.yml to use redis-om-spring style with -S flag and simplified cache keys - Update release.yml to use jreleaser/release-action@v2 with separate assemble step - Update early-access.yml to use sophisticated version checking and conditional snapshot releases - Add cancel-workflow-action to prevent concurrent release workflows - Standardize secret names (SONATYPE_USERNAME/PASSWORD, GIT_ACCESS_TOKEN) - Add SLACK_WEBHOOK integration for release notifications - Switch to out/jreleaser/ output path - Use peter-evans/repository-dispatch@v2 for docs trigger
1 parent f6e62d8 commit 957892a

File tree

8 files changed

+364
-16
lines changed

8 files changed

+364
-16
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Java
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: 21
18+
distribution: 'zulu'
19+
20+
- name: Cache Gradle
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.gradle/caches
24+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
25+
restore-keys: |
26+
${{ runner.os }}-gradle-
27+
28+
- name: Cache Gradle wrapper
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.gradle/wrapper
32+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
33+
restore-keys: ${{ runner.os }}-gradlew-
34+
35+
- name: Code Style Check
36+
run: |
37+
./gradlew spotlessCheck -S
38+
39+
- name: Build
40+
run: |
41+
./gradlew build -S
42+
43+
- name: Upload test reports
44+
if: failure()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-reports
48+
path: |
49+
build/reports/tests/aggregate/

.github/workflows/docs.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: Deploy Docs
22
on:
33
workflow_dispatch:
4-
release:
5-
types: [published]
64
repository_dispatch:
7-
types: [build-docs]
5+
types: [docs-build]
86

97
permissions:
108
contents: read
@@ -40,20 +38,22 @@ jobs:
4038
with:
4139
node-version: 20
4240

43-
- name: Cache Gradle
41+
- name: Cache Gradle dependencies
4442
uses: actions/cache@v4
4543
with:
4644
path: ~/.gradle/caches
47-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
45+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
4846
restore-keys: |
4947
${{ runner.os }}-gradle-
5048
5149
- name: Cache Gradle wrapper
5250
uses: actions/cache@v4
5351
with:
5452
path: ~/.gradle/wrapper
55-
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
56-
restore-keys: ${{ runner.os }}-gradlew-
53+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
54+
55+
- name: Fetch all tags
56+
run: git fetch --tags --force
5757

5858
- name: Set Release Version in Docs
5959
run: |
@@ -62,9 +62,11 @@ jobs:
6262
sed -i "s/display_version: '.*'/display_version: '$VERSION'/" docs/content/antora.yml
6363
sed -i "s/redisvl-version: '.*'/redisvl-version: '$VERSION'/" docs/content/antora.yml
6464
65+
- name: Generate Javadoc
66+
run: ./gradlew aggregateJavadoc --console=plain
67+
6568
- name: Build Documentation
66-
run: |
67-
./gradlew :docs:build
69+
run: ./gradlew :docs:build --console=plain
6870

6971
- name: Add .nojekyll file
7072
run: touch docs/build/site/.nojekyll

.github/workflows/early-access.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: 'Early Access'
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
earlyaccess:
9+
name: 'Early Access'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Cancel previous run
13+
uses: styfle/cancel-workflow-action@0.12.1
14+
with:
15+
access_token: ${{ secrets.GIT_ACCESS_TOKEN }}
16+
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Java
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 21
26+
distribution: 'zulu'
27+
28+
- name: Cache Gradle
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.gradle/caches
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
33+
restore-keys: |
34+
${{ runner.os }}-gradle-
35+
36+
- name: Cache Gradle wrapper
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.gradle/wrapper
40+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
41+
restore-keys: ${{ runner.os }}-gradlew-
42+
43+
- name: Build
44+
run: |
45+
./gradlew build test -S
46+
47+
- name: Upload test reports
48+
if: failure()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: test-report
52+
path: |
53+
build/reports/tests/aggregate
54+
55+
- name: Version
56+
id: vars
57+
shell: bash
58+
run: |
59+
BASE_VERSION=$(grep '^version\s*=\s*' gradle.properties | cut -d'=' -f2 | xargs)
60+
echo "BASE_VERSION=$BASE_VERSION" >> "$GITHUB_OUTPUT"
61+
62+
# Check if current version is already a release (RC, SNAPSHOT, or tagged release)
63+
if [[ "$BASE_VERSION" == *-SNAPSHOT ]] || [[ "$BASE_VERSION" == *-RC* ]]; then
64+
echo "SHOULD_RELEASE_SNAPSHOT=false" >> "$GITHUB_OUTPUT"
65+
echo "Skipping snapshot release: version is already a pre-release ($BASE_VERSION)"
66+
else
67+
# Check if this exact version has been released as a tag
68+
if git tag --list | grep -q "^v${BASE_VERSION}$"; then
69+
echo "SHOULD_RELEASE_SNAPSHOT=false" >> "$GITHUB_OUTPUT"
70+
echo "Skipping snapshot release: version $BASE_VERSION has already been released"
71+
else
72+
# Create snapshot version
73+
SNAPSHOT_VERSION="${BASE_VERSION}-SNAPSHOT"
74+
echo "VERSION=$SNAPSHOT_VERSION" >> "$GITHUB_OUTPUT"
75+
echo "SHOULD_RELEASE_SNAPSHOT=true" >> "$GITHUB_OUTPUT"
76+
echo "Will release snapshot version: $SNAPSHOT_VERSION"
77+
fi
78+
fi
79+
80+
- name: Release Snapshot
81+
if: ${{ steps.vars.outputs.SHOULD_RELEASE_SNAPSHOT == 'true' }}
82+
uses: jreleaser/release-action@v2
83+
with:
84+
arguments: release
85+
version: 'latest'
86+
env:
87+
JRELEASER_GITHUB_PASSWORD: ${{ secrets.GIT_ACCESS_TOKEN }}
88+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
89+
JRELEASER_GITHUB_USERNAME: ${{ secrets.GIT_USER }}
90+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
91+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
92+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
93+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
94+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
95+
JRELEASER_PROJECT_VERSION: ${{ steps.vars.outputs.VERSION }}
96+
JRELEASER_SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
97+
98+
- name: JReleaser output
99+
if: always()
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: artifact
103+
path: |
104+
out/jreleaser/trace.log
105+
out/jreleaser/output.properties

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to release"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel previous run
17+
uses: styfle/cancel-workflow-action@0.12.1
18+
with:
19+
access_token: ${{ secrets.GIT_ACCESS_TOKEN }}
20+
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Java
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: 21
30+
distribution: 'zulu'
31+
32+
- name: Cache Gradle
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.gradle/caches
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-
39+
40+
- name: Cache Gradle wrapper
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.gradle/wrapper
44+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
45+
restore-keys: ${{ runner.os }}-gradlew-
46+
47+
- name: Set up Git
48+
run: |
49+
git config user.name "GitHub Actions"
50+
git config user.email "actions@github.com"
51+
52+
- name: Bump version in gradle.properties
53+
id: bump
54+
run: |
55+
sed -i "s/^version\s*=.*/version = ${{ inputs.version }}/" gradle.properties
56+
git add gradle.properties
57+
git commit --allow-empty -m "release: Releasing version ${{ inputs.version }}"
58+
git push origin HEAD
59+
60+
- name: Build
61+
run: |
62+
./gradlew build test publish -S
63+
env:
64+
GRGIT_USER: ${{ secrets.GIT_USER }}
65+
GRGIT_PASS: ${{ secrets.GIT_ACCESS_TOKEN }}
66+
67+
- name: Upload test reports
68+
if: failure()
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: test-reports
72+
path: |
73+
build/reports/tests/aggregate/
74+
75+
- name: Assemble
76+
uses: jreleaser/release-action@v2
77+
with:
78+
arguments: assemble
79+
env:
80+
JRELEASER_PROJECT_VERSION: ${{ inputs.version }}
81+
82+
- name: Release
83+
uses: jreleaser/release-action@v2
84+
with:
85+
arguments: full-release
86+
env:
87+
JRELEASER_GITHUB_PASSWORD: ${{ secrets.GIT_ACCESS_TOKEN }}
88+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
89+
JRELEASER_GITHUB_USERNAME: ${{ secrets.GIT_USER }}
90+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
91+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
92+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
93+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
94+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
95+
JRELEASER_PROJECT_VERSION: ${{ inputs.version }}
96+
JRELEASER_SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
97+
98+
- name: JReleaser output
99+
if: always()
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: artifact
103+
path: |
104+
out/jreleaser/trace.log
105+
out/jreleaser/output.properties
106+
107+
- name: Trigger documentation build
108+
uses: peter-evans/repository-dispatch@v2
109+
with:
110+
token: ${{ secrets.GIT_ACCESS_TOKEN }}
111+
event-type: docs-build

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ plugins {
1010

1111
allprojects {
1212
group = "com.redis"
13-
version = "0.0.1"
1413

1514
repositories {
1615
mavenCentral()

core/build.gradle.kts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,24 @@ publishing {
138138

139139
developers {
140140
developer {
141-
id.set("redis")
142-
name.set("Redis Team")
143-
email.set("oss@redis.com")
141+
id = "bsbodden"
142+
name = "Brian Sam-Bodden"
143+
email = "bsb at redis.com"
144144
}
145145
}
146146

147147
scm {
148-
connection.set("scm:git:git://github.com/redis/redisvl.git")
149-
developerConnection.set("scm:git:ssh://github.com:redis/redisvl.git")
150-
url.set("https://github.com/redis/redisvl")
148+
connection.set("scm:git:git://github.com/redis/redis-vl-java.git")
149+
developerConnection.set("scm:git:ssh://github.com:redis/redis-vl-java.git")
150+
url.set("https://github.com/redis/redis-vl-java")
151151
}
152152
}
153153
}
154154
}
155+
156+
repositories {
157+
maven {
158+
url = uri(rootProject.layout.buildDirectory.dir("staging-deploy"))
159+
}
160+
}
155161
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = 0.0.1

0 commit comments

Comments
 (0)