Skip to content

Build with Ballerina Lang #12

Build with Ballerina Lang

Build with Ballerina Lang #12

name: Build with Ballerina Lang
on:
workflow_dispatch:
inputs:
lang_tag:
description: Branch/Release Tag of the Ballerina Lang
required: false
default: master
lang_version:
description: Ballerina Lang Version (If given ballerina lang buid will be skipped)
required: false
default: ''
build_properties:
description: Additional build properties
required: false
default: ''
jobs:
ubuntu-build-with-bal-test-native:
name: Build with Ballerina Lang on Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout Ballerina Lang Repository
if: ${{ inputs.lang_version == '' }}
uses: actions/checkout@v3
with:
repository: 'ballerina-platform/ballerina-lang'
ref: ${{ inputs.lang_tag || 'master' }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
- name: Set Ballerina Lang version
run: |
if ${{ inputs.lang_version != ''}}; then
LANG_VERSION=${{ inputs.lang_version }}
else
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)
LANG_VERSION=$VERSION-NATIVE
fi
echo "BALLERINA_LANG_VERSION=$LANG_VERSION" >> $GITHUB_ENV
echo "BALLERINA_LANG_VERSION: $LANG_VERSION"
- name: Build Ballerina Lang
if: ${{ inputs.lang_version == '' }}
run: |
perl -pi -e "s/^\s*version=.*/version=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties
./gradlew build -x check -x test publishToMavenLocal --scan --no-daemon
- name: Checkout Module Repository
uses: actions/checkout@v3
- name: Build Module
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: |
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties
./gradlew build ${{ inputs.build_properties }}
windows-build-with-bal-test-native:
name: Build with Ballerina Lang on Windows
runs-on: windows-latest
timeout-minutes: 90
steps:
- name: Checkout Ballerina Lang Repository
if: ${{ inputs.lang_version == '' }}
uses: actions/checkout@v3
with:
repository: 'ballerina-platform/ballerina-lang'
ref: ${{ inputs.lang_tag || 'master' }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
- name: Set Ballerina Lang version
run: |
if ("${{ inputs.lang_version }}" -eq "") {
$properties = convertfrom-stringdata (get-content ./gradle.properties -raw)
$LANG_VERSION = $properties.'version'.split("-",2)[0] + "-NATIVE"
} else {
$LANG_VERSION = "${{ inputs.lang_version }}"
}
"BALLERINA_LANG_VERSION=$LANG_VERSION" >> $env:GITHUB_ENV
Write-Output "BALLERINA_LANG_VERSION: $LANG_VERSION"
- name: Configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 10GB
maximum-size: 16GB
- name: Get configured pagefile base size
run: (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
- name: Build Ballerina Lang
if: ${{ inputs.lang_version == '' }}
run: |
perl -pi -e "s/^\s*version=.*/version=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties
./gradlew.bat build -x check -x test publishToMavenLocal --continue -x createJavadoc --stacktrace -scan --console=plain --no-daemon --no-parallel
- name: Checkout Module Repository
uses: actions/checkout@v3
- name: Build Module
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
run: |
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ env.BALLERINA_LANG_VERSION }}/" gradle.properties
./gradlew.bat build ${{ inputs.build_properties }}