-
Notifications
You must be signed in to change notification settings - Fork 49
64 lines (54 loc) · 1.65 KB
/
release.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
name: Deployment
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: 2201.8.4
# 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
# Perform Trivy scan
- 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'
# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Push to Ballerina Central
- name: Ballerina Push
run: bal push
working-directory: ./ballerina
env:
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm