This repository has been archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (78 loc) · 3.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Egeria project.
---
name: "Release"
# Trigger after code is merged. only on main repo
# - does not run on modification (may be just text)
on:
# No checks for branch or repo - assuming release creation is manual, controlled
release:
types:
- created
# Also allow for manual invocation for testing
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: "Release"
steps:
- uses: actions/checkout@v3
name: Checkout source
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle & Release artifacts
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: publish -Dorg.gradle.parallel=false -Dorg.gradle.caching=false
# Import secrets needed for code signing and distribution
env:
OSSRH_GPG_KEYID: ${{ secrets.OSSRH_GPG_KEYID }}
OSSRH_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
OSSRH_GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to container registry (Quay.io)
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_ACCESS_TOKEN }}
- name: Login to container registry (Docker Hub)
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# QEMU is needed for ARM64 build for egeria-configure
# egeria-configure needs to install utilities
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set Release version env variable
run: |
echo "CONNECTOR_VERSION=$(./gradlew properties --no-daemon --console=plain -q | grep '^version:' | awk '{printf $2}')" >> $GITHUB_ENV
echo "EGERIA_BASE_IMAGE=quay.io/odpi/egeria" >> $GITHUB_ENV
echo "EGERIA_VERSION=$(./gradlew :egeria-connector-integration-jdbc:dependencies | grep org.odpi.egeria:open-connector-framework | awk -F':' '{if ($3) print $3}' | awk -F' ' '{print $1}' | uniq| head -1)" >> $GITHUB_ENV
- name: Build and push( to quay.io and docker.io (no tag latest)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}, quay.io/odpi/egeria-connector-jdbc:${{ env.CONNECTOR_VERSION }}
platforms: linux/amd64,linux/arm64
build-args: |
egeria_base_image=${{ env.EGERIA_BASE_IMAGE }}
connector_version=${{ env.CONNECTOR_VERSION }}
egeria_version=${{ env.EGERIA_VERSION }}
# Upload the library so that build results can be viewed
- name: Upload Connector
uses: actions/upload-artifact@v3
with:
# TODO: release - Update name & artifacts to upload
name: Jar
path: '**/build/libs/*.jar'