-
Notifications
You must be signed in to change notification settings - Fork 46
feat(ci): configure maven publish job #653
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ variables: | |
|
|
||
| stages: | ||
| - build | ||
| - deploy | ||
|
|
||
| default: | ||
| image: ${CI_IMAGE}:${CI_IMAGE_VER} # set in CI env vars | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||||
| # maven credentials and gpg settings | ||||||||||||||||||||||||
| # in runner's ~/.gradle/gradle.properties | ||||||||||||||||||||||||
| publish_to_maven: | ||||||||||||||||||||||||
| stage: deploy | ||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||
| - m4 | ||||||||||||||||||||||||
| rules: | ||||||||||||||||||||||||
| - if: "$CI_COMMIT_TAG" | ||||||||||||||||||||||||
| when: manual | ||||||||||||||||||||||||
| needs: [] | ||||||||||||||||||||||||
| script: | ||||||||||||||||||||||||
| - cd libs/gl-sdk-android | ||||||||||||||||||||||||
| - ./gradlew publish --no-daemon | ||||||||||||||||||||||||
| artifacts: | ||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||
| - libs/gl-sdk-android/lib/build/libs | ||||||||||||||||||||||||
| - libs/gl-sdk-android/lib/build/outputs | ||||||||||||||||||||||||
| - libs/gl-sdk-android/lib/build/publications | ||||||||||||||||||||||||
| when: always | ||||||||||||||||||||||||
| expire_in: 7 days | ||||||||||||||||||||||||
|
Comment on lines
+14
to
+20
|
||||||||||||||||||||||||
| allow_failure: true | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| allow_failure: true | |
| allow_failure: false |
Copilot
AI
Jan 20, 2026
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.
The version extraction logic assumes the version follows a semantic versioning pattern. The sed command on line 35 will strip any suffix after the numeric version (e.g., -alpha, -beta), which may not be the intended behavior if the project uses such suffixes. Consider validating that the version format matches expectations or documenting this assumption.
| - VERSION_CORE=$(echo "$BASE_VERSION" | sed -E 's/[^0-9.].*$//') | |
| - if ! echo "$BASE_VERSION" | grep -Eq '^[0-9]+(\.[0-9]+){0,2}$'; then echo "Unsupported libraryVersion format: $BASE_VERSION" >&2; exit 1; fi | |
| - VERSION_CORE="$BASE_VERSION" |
Copilot
AI
Jan 20, 2026
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.
The version parsing logic doesn't validate that the version format is valid before processing. If VERSION_CORE is empty or malformed, the script will continue with default values (0.0.0), potentially publishing an incorrect snapshot version. Consider adding validation to ensure the version from gradle.properties is in the expected format before proceeding.
| - BASE_VERSION=${RAW_VERSION%-SNAPSHOT} | |
| - VERSION_CORE=$(echo "$BASE_VERSION" | sed -E 's/[^0-9.].*$//') | |
| - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION_CORE" | |
| - MAJOR=${MAJOR:-0} | |
| - MINOR=${MINOR:-0} | |
| - PATCH=${PATCH:-0} | |
| - if [ -z "$RAW_VERSION" ]; then echo "Error: libraryVersion not found in gradle.properties"; exit 1; fi | |
| - BASE_VERSION=${RAW_VERSION%-SNAPSHOT} | |
| - VERSION_CORE=$(echo "$BASE_VERSION" | sed -E 's/[^0-9.].*$//') | |
| - if ! echo "$VERSION_CORE" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then echo "Error: Invalid version format '$RAW_VERSION' (expected MAJOR.MINOR.PATCH[-suffix])"; exit 1; fi | |
| - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION_CORE" |
Copilot
AI
Jan 20, 2026
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.
The artifacts section captures build outputs including build/publications. These artifacts may contain signed artifacts or sensitive metadata. Consider whether these artifacts should be available for download or if they should be restricted, especially since this is a publishing job where the primary goal is to push artifacts to Maven Central, not to store them as CI artifacts.
Uh oh!
There was an error while loading. Please reload this page.