Merge pull request #581 from ballerina-platform/automated/dependency_… #373
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'ballerina-platform' | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'adopt' | |
| java-version: 21.0.3 | |
| - 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: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| env: | |
| packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | |
| packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | |
| publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | |
| publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | |
| run: | | |
| ./gradlew publish -PpublishToCentral=false | |
| - name: Generate Codecov Report | |
| uses: codecov/codecov-action@v2 | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ballerinai-transaction | |
| path: target/ballerinai-transaction/ |