-
Notifications
You must be signed in to change notification settings - Fork 85
122 lines (105 loc) · 4.92 KB
/
build-with-ballerina-lang.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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 build 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 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21.0.3
- 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 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21.0.3
- 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 }}