diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 2f0ec99..9f6c009 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -16,6 +16,14 @@ jobs: with: distribution: 'adopt' java-version: 17 + - 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 + sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties - name: Github Packages Publish env: publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }}