Skip to content

Commit

Permalink
Merge pull request #322 from ballerina-platform/revamp-2023
Browse files Browse the repository at this point in the history
Update Release workflow and update examples
  • Loading branch information
sahanHe authored Feb 26, 2024
2 parents b99da1f + a312931 commit febc0e2
Show file tree
Hide file tree
Showing 109 changed files with 670 additions and 3,938 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# See: https://help.github.com/articles/about-codeowners/

# These owners will be the default owners for everything in the repo.
* @indikasampath2000 @abeykoon @sachinira
* @aashikam @niveathika @sahanHe
21 changes: 21 additions & 0 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: GraalVM Check

on:
schedule:
- cron: "30 18 * * *"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
with:
additional-build-flags: "-x :salesforce-examples:build"


59 changes: 0 additions & 59 deletions .github/workflows/build-with-bal-test-native.yml

This file was deleted.

74 changes: 9 additions & 65 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,15 @@ name: Daily build

on:
schedule:
- cron: '30 2 * * *'
- cron: "30 2 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest

# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test
# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
call_workflow:
name: Run Daily Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/daily-build-connector-template.yml@main
secrets: inherit
with:
repo-name: module-ballerinax-sfdc

# Test Ballerina Project
- name: Ballerina Test
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
EP_URL: ${{ secrets.EP_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
REFRESH_URL: ${{ secrets.REFRESH_URL }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

# Send notification when build fails
- 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-sfdc\"
}
}"

79 changes: 15 additions & 64 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,23 @@
name: Dev/Staging BCentral Release
name: Publish to the Ballerina Dev\Stage Central

on:
workflow_dispatch:
inputs:
bal_central_environment:
description: Ballerina Central Environment
environment:
type: choice
options:
- STAGE
- DEV
description: Select Environment
required: true
options:
- DEV CENTRAL
- STAGE CENTRAL

jobs:
release:
runs-on: ubuntu-latest
env:
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: 2201.8.0

- 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 }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test -x :salesforce-examples:build
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'rootfs'
scan-ref: '.'
skip-dirs: 'gradle/'
format: 'table'
timeout: '10m0s'
exit-code: '1'

- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Push to Staging
if: github.event.inputs.bal_central_environment == 'STAGE'
working-directory: ./ballerina
run: bal push
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Push to Dev
if: github.event.inputs.bal_central_environment == 'DEV'
run: bal push
working-directory: ./ballerina
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
call_workflow:
name: Run Dev\Stage Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/dev-stage-central-publish-connector-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
additional-publish-flags: "-x :salesforce-examples:build"

66 changes: 12 additions & 54 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,15 @@
name: CI_pull_request
name: PR Build

on: [ pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17.0.7

# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest
on: pull_request

# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test
# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm

# Test Ballerina Project
- name: Ballerina Test
# tests will be skipped if the PR is from a forked repository (as the secrets are not available)
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
EP_URL: ${{ secrets.EP_URL }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
REFRESH_URL: ${{ secrets.REFRESH_URL }}
JAVA_HOME: /usr/lib/jvm/default-jvm

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/pr-build-connector-template.yml@main
secrets: inherit

Loading

0 comments on commit febc0e2

Please sign in to comment.