-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (51 loc) · 1.84 KB
/
build.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
name: Build
on:
workflow_call:
inputs:
branch:
type: string
required: false
description: Reference or branch to build
outputs:
uber-jar:
description: Generated jar
value: ${{ jobs.build.outputs.uber-jar }}
sources-jar:
description: Jar that contains only the source code
value: ${{ jobs.build.outputs.sources-jar }}
push:
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.project-version.outputs.PROJECT_VERSION }}
uber-jar: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}.jar
sources-jar: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}-sources.jar
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Build and test
uses: gradle/gradle-build-action@v2
with:
arguments: build --scan
- name: Get project version
id: project-version
run: |
echo "PROJECT_VERSION=$(./gradlew printVersion | grep -A1 '> Configure project :'| grep -v "> Configure project :")" >> $GITHUB_OUTPUT
- name: Upload uber-jar
uses: actions/upload-artifact@v3
with:
name: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}.jar
path: build/libs/firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}.jar
- name: Upload sources-jar
uses: actions/upload-artifact@v3
with:
name: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}-sources.jar
path: build/libs/firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}-sources.jar