-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Copy pathaction.yml
63 lines (56 loc) · 2.56 KB
/
action.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
name: "Build OSS Branch and Push Minimum Required OSS Images"
description: "Build jars and docker images tagged for a particular branch. Primarily used for running OSS branch code in Cloud."
inputs:
branch_version_tag:
description: 'Used to tag jars and docker images with a branch-specific version (should use the form "dev-<commit_hash>" to pass AirbyteVersion validation)'
required: false
dockerhub_token:
description: "Used to log in to dockerhub for pushing images"
required: true
runs:
using: "composite"
steps:
- name: "Parse Input"
id: parse-input
shell: bash
run: |-
# if the *branch_version_tag* input param is not specified, then generate it as 'dev-<commit_hash>`
#
[[ "${{ inputs.branch_version_tag }}" != '' ]] && echo "::set-output name=branch_version_tag::${{ inputs.branch_version_tag }}" \
|| { short_hash=$(git rev-parse --short HEAD); echo "::set-output name=branch_version_tag::dev-$short_hash"; }
- uses: actions/setup-java@v1
with:
java-version: "17"
- uses: actions/setup-node@v1
with:
node-version: "16.13.0"
- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
shell: bash
- name: Build
run: VERSION=${{ steps.parse-input.outputs.branch_version_tag }} SUB_BUILD=PLATFORM ./gradlew build --scan
shell: bash
- name: Publish to Maven Local
run: VERSION=${{ steps.parse-input.outputs.branch_version_tag }} SUB_BUILD=PLATFORM ./gradlew publishToMavenLocal
shell: bash
- name: Login to Docker (on Master)
uses: docker/login-action@v1
with:
username: airbytebot
password: ${{ inputs.dockerhub_token }}
- name: Push Docker Images
run: |
GIT_REVISION=$(git rev-parse HEAD)
[ [ -z "$GIT_REVISION" ] ] && echo "Couldn't get the git revision..." && exit 1
VERSION=${{ steps.parse-input.outputs.branch_version_tag }} GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose-cloud.build.yaml push
shell: bash