Skip to content

Commit 80a32d7

Browse files
committed
refactor: create a v2 branch
1 parent cd91ee4 commit 80a32d7

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/publish-snapshot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ jobs:
3232
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
3333
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
3434
SNAPSHOT: true
35+
- name: Show snapshot version
36+
run: ./scripts/show-last-snapshot-update.sh
37+
env:
38+
SNAPSHOT: true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Run the Gradle task to get the artifact list and process the output line by line
4+
./gradlew -q printAllArtifacts | while IFS= read -r artifact; do
5+
# Extract groupId, artifactId, and snapshot version from the artifact string
6+
groupId=$(echo $artifact | cut -d: -f1)
7+
artifactId=$(echo $artifact | cut -d: -f2)
8+
snapshotVersion=$(echo $artifact | cut -d: -f3)
9+
10+
# Format the URL for the maven-metadata.xml file in the Nexus repository
11+
url="https://oss.sonatype.org/content/repositories/snapshots/$(echo $groupId | tr '.' '/')/$artifactId/$snapshotVersion/maven-metadata.xml"
12+
13+
# Fetch the maven-metadata.xml using curl and extract the latest release version using sed
14+
latest_version=$(curl -s "$url" | sed -n 's|.*<value>\(.*\)</value>.*|\1|p' | head -n 1)
15+
16+
# Print the result with the latest stable version
17+
if [ -n "$latest_version" ]; then
18+
echo "$groupId:$artifactId:$latest_version"
19+
else
20+
echo "No version found for $artifact"
21+
fi
22+
done

0 commit comments

Comments
 (0)