diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index d05f683bb..a714df0c1 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -1,41 +1,19 @@ name: Build + on: push: branches: - master + paths-ignore: + - "*.md" + - "docs/**" + - "load-tests/**" + workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest - if: github.repository_owner == 'ballerina-platform' - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: 17.0.7 - - 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 }} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} - REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} - run: | - ./gradlew clean build publish codeCoverageReport --stacktrace --scan --console=plain - - name: Generate CodeCov Report - uses: codecov/codecov-action@v1 + call_workflow: + name: Run Build Workflow + if: ${{ github.repository_owner == 'ballerina-platform' }} + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main + secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml new file mode 100644 index 000000000..458aab57b --- /dev/null +++ b/.github/workflows/trivy-scan.yml @@ -0,0 +1,13 @@ +name: Trivy + +on: + workflow_dispatch: + schedule: + - cron: "30 20 * * *" + +jobs: + call_workflow: + name: Run Trivy Scan Workflow + if: ${{ github.repository_owner == 'ballerina-platform' }} + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main + secrets: inherit