-
Notifications
You must be signed in to change notification settings - Fork 191
77 lines (75 loc) · 3.01 KB
/
main.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
name: Build
on:
push:
branches:
- master
- stage
- ballerina-1.1.x
workflow_dispatch:
inputs:
skipTests:
description: 'Skip Tests during build'
required: false
default: 'false'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.0.7'
- name: Get project version
id: project-version
run: |
SHORT_VERSION=$((grep -w "version" | cut -d= -f2 | cut -d- -f1) < gradle.properties)
DIST_VERSION=$((grep -w "version" | cut -d= -f2) < gradle.properties)
CODE_NAME=$((grep -w 'codeName' | cut -d= -f2) < gradle.properties)
RELEASE_VERSION=$DIST_VERSION-$CODE_NAME
echo "::set-output name=version::$RELEASE_VERSION"
echo "::set-output name=sversion::$SHORT_VERSION"
- name: Build Ballerina Distribution
if: ${{ github.event.inputs.skipTests == '' || github.event.inputs.skipTests == 'false' }}
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue -x project-api-tests:test
- name: Build Ballerina Distribution Skip Tests
if: ${{ github.event.inputs.skipTests == 'true' }}
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue -x test
- name: Archive Ballerina ZIP
uses: actions/upload-artifact@v4
with:
name: Ballerina ZIP
path: ballerina/build/distributions/ballerina-*-swan-lake.zip
- name: Archive Ballerina Short Name ZIP
uses: actions/upload-artifact@v4
with:
name: Ballerina Short Name ZIP
path: ballerina/build/distributions/ballerina-${{ steps.project-version.outputs.sversion }}.zip
- name: Archive Linux installer ZIP
uses: actions/upload-artifact@v4
with:
name: Linux installer ZIP
path: ballerina/build/distributions/ballerina-*-linux.zip
- name: Archive MacOS installer ZIP
uses: actions/upload-artifact@v4
with:
name: MacOS installer ZIP
path: ballerina/build/distributions/ballerina-*-macos.zip
- name: Archive Windows Installer ZIP
uses: actions/upload-artifact@v4
with:
name: Windows Installer ZIP
path: ballerina/build/distributions/ballerina-*-windows.zip