Skip to content

Commit 7183c97

Browse files
Fix CI to display the correct Sonatype-assigned snapshot version (#1557)
* update snapshot url * print version name * remove timestamp * refactor timestamp with MMddHHmm * correct the logic to render snapshot version on ci * refactor * refactor * refactor * refactor * fix snapshot version --------- Co-authored-by: Aleksandar Apostolov <apostolov.alexandar@gmail.com>
1 parent 12a6d89 commit 7183c97

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
- develop
77
workflow_dispatch:
88

9+
# 👇 This line ensures only one snapshot publish runs at a time.
10+
concurrency:
11+
group: snapshot-publish
12+
cancel-in-progress: false
13+
914
jobs:
1015
publish:
1116
name: Snapshot build and publish

scripts/show-last-snapshot-update.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
# Extract groupId, artifactId, and snapshot version from the artifact string
66
groupId=$(echo $artifact | cut -d: -f1)
77
artifactId=$(echo $artifact | cut -d: -f2)
8-
snapshotVersion=$(echo $artifact | cut -d: -f3)
98

109
# 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"
10+
url="https://central.sonatype.com/repository/maven-snapshots/io/getstream/stream-video-android-bom/maven-metadata.xml"
1211

1312
# 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)
13+
latest_version=$(curl -s "$url" | sed -n 's/.*<latest>\(.*\)<\/latest>.*/\1/p')
1514

1615
# Print the result with the latest stable version
1716
if [ -n "$latest_version" ]; then

0 commit comments

Comments
 (0)