-
Notifications
You must be signed in to change notification settings - Fork 106
73 lines (62 loc) · 2.24 KB
/
build-java.yml
File metadata and controls
73 lines (62 loc) · 2.24 KB
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
name: Build Java Sources
on:
workflow_call:
workflow_dispatch:
jobs:
build-jar:
name: Build Compiler
runs-on: [k8s-runners-amd64]
permissions:
id-token: write
contents: read
container:
image: ghcr.io/feldera/feldera-dev:sha-db53e1302c944e29edd6d2af516fff7032b90e3b
steps:
- name: Show Kubernetes node
if: always()
run: |
echo "K8S node: ${K8S_NODE_NAME}"
- name: Checkout repository
uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: |
/home/ubuntu/.gradle
./sql-to-dbsp-compiler/calcite
key: sql2dbsp-java-cache-${{ runner.os }}-${{ hashFiles('sql-to-dbsp-compiler/calcite_version.env') }}
restore-keys: |
sql2dbsp-java-cache-${{ runner.os }}-
- name: gradle version
run: |
gradle --version
- name: Build sql2dbsp JARs
run: bash build.sh -pl SQL-compiler
working-directory: ./sql-to-dbsp-compiler
env:
CALCITE_BUILD_DIR: ./calcite
GRADLE_HOME: /home/ubuntu/.gradle
- name: Stop gradle daemon
run: gradle --stop
- name: Copy JAR to artifacts directory
run: |
mkdir -p build-artifacts
cp ./sql-to-dbsp-compiler/SQL-compiler/target/sql2dbsp.jar build-artifacts/
cp ./sql-to-dbsp-compiler/SQL-compiler/target/sql2dbsp-jar-with-dependencies.jar build-artifacts/
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: feldera-sql-compiler
path: build-artifacts
retention-days: 7
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v5.1.0
with:
role-to-assume: ${{ vars.SQL2DBSP_UPLOAD_ROLE }}
role-session-name: gha-${{ github.run_id }}
aws-region: ${{ vars.SQL2DBSP_S3_REGION }}
- name: Upload JAR to S3 with SHA in filename
run: |
JAR_FILE=build-artifacts/sql2dbsp-jar-with-dependencies.jar
DEST_NAME=sql2dbsp-jar-with-dependencies-${{ github.sha }}.jar
aws s3 cp "$JAR_FILE" "s3://${{ vars.SQL2DBSP_S3_BUCKET }}/$DEST_NAME" \
--content-type application/java-archive