-
Notifications
You must be signed in to change notification settings - Fork 238
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
ci: auto release java #2827
ci: auto release java #2827
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,25 +2,61 @@ name: Bump version for releases | |
description: "Call bumpversion" | ||
inputs: | ||
part: | ||
description: 'What kind of release is this?' | ||
description: "What kind of release is this?" | ||
required: true | ||
default: 'release' | ||
default: "release" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set git configs for bumpversion | ||
shell: bash | ||
run: | | ||
git config user.name 'Lance Release' | ||
git config user.email '[email protected]' | ||
- name: Create release version and tags | ||
working-directory: python | ||
shell: bash | ||
run: | | ||
cargo install cargo-bump | ||
cargo bump ${{ inputs.part }} | ||
- name: Synchronize rust version | ||
shell: bash | ||
run: | | ||
cargo install cargo-workspaces --version 0.2.44 | ||
cargo ws version --no-git-commit -y --exact --force 'lance*' ${{ inputs.part }} | ||
- name: Set git configs for bumpversion | ||
shell: bash | ||
run: | | ||
git config user.name 'Lance Release' | ||
git config user.email '[email protected]' | ||
- name: Create release version and tags | ||
working-directory: python | ||
shell: bash | ||
run: | | ||
cargo install cargo-bump | ||
cargo bump ${{ inputs.part }} | ||
- name: Synchronize rust version | ||
shell: bash | ||
run: | | ||
cargo install cargo-workspaces --version 0.2.44 | ||
cargo ws version --no-git-commit -y --exact --force 'lance*' ${{ inputs.part }} | ||
- name: Bump java version | ||
working-directory: java | ||
shell: bash | ||
run: | | ||
# Get current version | ||
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
current_version=${current_version%\%} | ||
|
||
# Split the version into components using parameter expansion | ||
major=${current_version%%.*} | ||
minor=${current_version#*.} | ||
minor=${minor%%.*} | ||
patch=${current_version##*.} | ||
|
||
case "${{ inputs.part }}" in | ||
patch) | ||
patch=$((patch + 1)) | ||
;; | ||
minor) | ||
minor=$((minor + 1)) | ||
patch=0 | ||
;; | ||
major) | ||
major=$((major + 1)) | ||
minor=0 | ||
patch=0 | ||
;; | ||
*) | ||
echo "Invalid part specified" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
new_version="${major}.${minor}.${patch}" | ||
|
||
mvn versions:set versions:commit -DnewVersion=$new_version |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: Build and publish Java packages | ||
on: | ||
release: | ||
# Use released instead of published, since we don't publish preview/beta | ||
# versions | ||
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to start publishing them later? Feel like it could be useful since we distribute the binaries for Java, right? The only reason we skip Rust is because it's a source-only release, so there's no benefit of publishing over just letting people reference the git repo directly. |
||
types: [released] | ||
pull_request: | ||
paths: | ||
|
@@ -99,7 +101,12 @@ jobs: | |
run: | | ||
git config --global user.email "Lance Github Runner" | ||
git config --global user.name "[email protected]" | ||
- name: Dry run | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
mvn --batch-mode -DskipTests package | ||
- name: Publish with Java 8 | ||
if: github.event_name == 'release' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i am a bit confused here. dont you need to invoke bump version first before running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The release pipeline is
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah i see. i've also see you modified the release_process.md. nice. thanks! |
||
run: | | ||
echo "use-agent" >> ~/.gnupg/gpg.conf | ||
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,4 @@ jobs: | |
-Djdk.reflect.useDirectMethodHandle=false \ | ||
-Dio.netty.tryReflectionSetAccessible=true" | ||
fi | ||
mvn clean test | ||
mvn clean install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my previous experience, we always only auto-bump patch version. all major/minor should be manual commit. but it is up to the lance community :-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, lance community also only auto bump patch version, major/minor needs to be manual commit.
Lancedb release pipeline opens the door for auto bump minor version but is also not recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i might've misunderstood. but looksl ike the code below handles major/minor/patch bump?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the capability to bump other versions, but we generally only automatically increment minor version.