Skip to content

Commit

Permalink
Merge pull request #10 from NipunaMadhushan/master
Browse files Browse the repository at this point in the history
Fix publishing timestamp versions
  • Loading branch information
NipunaMadhushan authored Oct 13, 2023
2 parents d959c89 + 83db056 commit d99ae4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
wget https://github.com/ballerina-platform/ballerina-distribution/releases/download/v${{ env.BALLERINA_DISTRIBUTION_VERSION }}/ballerina-${{ steps.ballerina-version.outputs.version }}-swan-lake-linux-x64.deb
sudo dpkg -i ballerina-*-linux-x64.deb
bal -v
- name: Change to Timestamped Version
run: |
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00')
latestCommit=$(git log -n 1 --pretty=format:"%h")
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)
updatedVersion=$VERSION-$startTime-$latestCommit
echo $updatedVersion
echo TIMESTAMPED_VERSION=$updatedVersion >> $GITHUB_ENV
sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set Docker Host env variable
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/zipkin-server-tests/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function testHttpCachingClientSpanTags() returns error? {
test:assertTrue(containsTag("src.function.name", httpCachingClientSpanTagKeys));
test:assertEquals(httpCachingClientSpanTags["src.function.name"], "get");
test:assertTrue(containsTag("src.module", httpCachingClientSpanTagKeys));
test:assertEquals(httpCachingClientSpanTags["src.module"], "ballerina/http:2.10.2");
test:assertEquals(httpCachingClientSpanTags["src.module"], "ballerina/http:2.10.3");
test:assertTrue(containsTag("src.object.name", httpCachingClientSpanTagKeys));
test:assertEquals(httpCachingClientSpanTags["src.object.name"], "ballerina/http/HttpCachingClient");
test:assertTrue(containsTag("src.position", httpCachingClientSpanTagKeys));
Expand Down Expand Up @@ -411,7 +411,7 @@ function testHttpClientSpanTags() returns error? {
test:assertTrue(containsTag("src.function.name", httpClientSpanTagKeys));
test:assertEquals(httpClientSpanTags["src.function.name"], "get");
test:assertTrue(containsTag("src.module", httpClientSpanTagKeys));
test:assertEquals(httpClientSpanTags["src.module"], "ballerina/http:2.10.2");
test:assertEquals(httpClientSpanTags["src.module"], "ballerina/http:2.10.3");
test:assertTrue(containsTag("src.object.name", httpClientSpanTagKeys));
test:assertEquals(httpClientSpanTags["src.object.name"], "ballerina/http/HttpClient");
test:assertTrue(containsTag("src.position", httpClientSpanTagKeys));
Expand Down
2 changes: 1 addition & 1 deletion ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ task ballerinaPublish {
finalizedBy(revertTomlFile)

doLast {
if (project.version.endsWith('-SNAPSHOT')) {
if (project.version.toString().split("-").length > 1) {
return
}
if (ballerinaCentralAccessToken != null) {
Expand Down

0 comments on commit d99ae4c

Please sign in to comment.