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@v4 - uses: actions/cache@v4 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@v4 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