Skip to content

Daily build

Daily build #51

Workflow file for this run

name: Daily build
on:
schedule:
- cron: '30 2 * * *'
workflow_dispatch:
env:
BALLERINA_DISTRIBUTION_VERSION: 2201.8.0-rc1 # Update this with the latest Ballerina version
jobs:
build:
if: github.repository_owner == 'ballerina-platform'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17.0.7
- name: Ballerina Version
id: ballerina-version
run: |
BALLERINA_VERSION=$(cut -d '-' -f1 <<< "${{ env.BALLERINA_DISTRIBUTION_VERSION }}")
echo "::set-output name=version::$BALLERINA_VERSION"
- name: Install Ballerina
run: |
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: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew clean build
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'rootfs'
scan-ref: '/github/workspace/ballerina/lib'
format: 'table'
timeout: '10m0s'
exit-code: '1'
- name: Notify failure
if: ${{ failure() }}
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"notify-build-failure\",
\"client_payload\": {
\"repoName\": \"module-ballerinax-zipkin\"
}
}"