Daily build #19
This file contains 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: Daily build | |
on: | |
schedule: | |
- cron: '30 2 * * *' | |
workflow_dispatch: | |
inputs: | |
ballerina_version: | |
description: 'Ballerina version' | |
required: true | |
default: '2201.8.3' | |
env: | |
BALLERINA_DISTRIBUTION_VERSION: 2201.8.3 # 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: 'temurin' | |
java-version: 17.0.7 | |
- name: Set up Ballerina | |
if: github.event_name == 'workflow_dispatch' | |
uses: ballerina-platform/setup-ballerina@v1.1.0 | |
with: | |
version: ${{ github.event.inputs.ballerina_version }} | |
- name: Set up Ballerina | |
if: github.event_name == 'schedule' | |
uses: ballerina-platform/setup-ballerina@v1.1.0 | |
with: | |
version: ${{ env.BALLERINA_DISTRIBUTION_VERSION }} | |
- 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-newrelic\" | |
} | |
}" |