(json) }
}
}
diff --git a/onebusaway-sdk-java-proguard-test/build.gradle.kts b/onebusaway-sdk-java-proguard-test/build.gradle.kts
index 8d4f83f..f49a190 100644
--- a/onebusaway-sdk-java-proguard-test/build.gradle.kts
+++ b/onebusaway-sdk-java-proguard-test/build.gradle.kts
@@ -19,7 +19,7 @@ dependencies {
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.assertj:assertj-core:3.25.3")
- testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4")
+ testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0")
}
tasks.shadowJar {
diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts
index 729e6f2..548d152 100755
--- a/scripts/upload-artifacts
+++ b/scripts/upload-artifacts
@@ -7,6 +7,8 @@ GREEN='\033[32m'
RED='\033[31m'
NC='\033[0m' # No Color
+MAVEN_REPO_PATH="./build/local-maven-repo"
+
log_error() {
local msg="$1"
local headers="$2"
@@ -24,7 +26,7 @@ upload_file() {
if [ -f "$file_name" ]; then
echo -e "${GREEN}Processing file: $file_name${NC}"
- pkg_file_name="mvn${file_name#./build/local-maven-repo}"
+ pkg_file_name="mvn${file_name#"${MAVEN_REPO_PATH}"}"
# Get signed URL for uploading artifact file
signed_url_response=$(curl -X POST -G "$URL" \
@@ -47,18 +49,20 @@ upload_file() {
md5|sha1|sha256|sha512) content_type="text/plain" ;;
module) content_type="application/json" ;;
pom|xml) content_type="application/xml" ;;
+ html) content_type="text/html" ;;
*) content_type="application/octet-stream" ;;
esac
# Upload file
upload_response=$(curl -v -X PUT \
--retry 5 \
+ --retry-all-errors \
-D "$tmp_headers" \
-H "Content-Type: $content_type" \
--data-binary "@${file_name}" "$signed_url" 2>&1)
if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then
- log_error "Failed upload artifact file" "$tmp_headers" "$upload_response"
+ log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response"
fi
# Insert small throttle to reduce rate limiting risk
@@ -81,6 +85,45 @@ walk_tree() {
done
}
+generate_instructions() {
+ cat << EOF > "$MAVEN_REPO_PATH/index.html"
+
+
+
+ Maven Repo
+
+
+ Stainless SDK Maven Repository
+ This is the Maven repository for your Stainless Java SDK build.
+
+ Directions
+ To use the uploaded Maven repository, add the following to your project's pom.xml:
+ <repositories>
+ <repository>
+ <id>stainless-sdk-repo</id>
+ <url>https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn</url>
+ </repository>
+</repositories>
+
+ If you're using Gradle, add the following to your build.gradle file:
+ repositories {
+ maven {
+ url 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'
+ }
+}
+
+ Once you've added the repository, you can include dependencies from it as usual. See your
+ project README
+ for more details.
+
+
+EOF
+ upload_file "${MAVEN_REPO_PATH}/index.html"
+
+ echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'"
+ echo "For more details, see the directions in https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn/index.html"
+}
+
cd "$(dirname "$0")/.."
echo "::group::Creating local Maven content"
@@ -88,9 +131,9 @@ echo "::group::Creating local Maven content"
echo "::endgroup::"
echo "::group::Uploading to pkg.stainless.com"
-walk_tree "./build/local-maven-repo"
+walk_tree "$MAVEN_REPO_PATH"
echo "::endgroup::"
echo "::group::Generating instructions"
-echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'"
+generate_instructions
echo "::endgroup::"