Skip to content

(Manually) Publish Timestamped Snapshot Artifacts #2363

(Manually) Publish Timestamped Snapshot Artifacts

(Manually) Publish Timestamped Snapshot Artifacts #2363

name: (Manually) Publish Timestamped Snapshot Artifacts
on:
push:
branches:
- query-grouping-aggregation
workflow_dispatch:
jobs:
publish-ballerina-lang:
name: Build and Publish Ballerina Lang
runs-on: ubuntu-latest
timeout-minutes: 240
if: github.repository_owner == 'ballerina-platform'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17.0.7'
- name: Checkout To Lang Branch
run: |
git checkout ${{ github.event.inputs.ballerina_lang_branch }}
- name: Initialize Sub Modules
run: git submodule update --init
- 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: Build and Publish
env:
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
./gradlew clean build -x check -x test -x javadoc --scan --continue --rerun-tasks
./gradlew publish
./gradlew createCodeCoverageReport
- name: Generate Codecov Report
uses: codecov/codecov-action@v4
with:
files: ./.jacoco/reports/jacoco/report.xml