forked from odpi/egeria
-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (141 loc) · 6.27 KB
/
merge-v4.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the ODPi Egeria project.
---
name: "Merge v4"
# Trigger after code is merged. only on main repo
# - does not run on modification (may be just text)
on:
push:
branches: [main, egeria-release-4*]
permissions:
contents: read
jobs:
build:
permissions:
# for gh-pages
contents: write
runs-on: ubuntu-latest
name: "Merge v4"
if: startsWith(github.repository,'odpi/')
steps:
- uses: actions/checkout@v4.1.0
name: Checkout source
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# Build first - lombok & other pre-processing may be needed. safer...
- name: build and publish to maven central
if: ${{ github.ref == 'refs/heads/main'}}
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: build publish
# 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 }}
ORG_GRADLE_PROJECT_mavenRepoPass: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_mavenRepoUser: ${{ secrets.OSSRH_USERNAME }}
# In other cases just build but don't publish
- name: build (no publish to maven central)
if: ${{ github.ref != 'refs/heads/main'}}
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: build
# Now aggregate javadoc - main only
- name: build
if: ${{ github.ref == 'refs/heads/main'}}
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: aggregateJavadoc
- name: publish aggregate javadoc
if: ${{ github.ref == 'refs/heads/main'}}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build/docs/javadoc
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to container registry (Quay.io)
uses: docker/login-action@v3
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@v3
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@v3
- name: Set Release version env variable
run: |
echo "VERSION=$(./gradlew properties --no-daemon --console=plain -q | grep '^version:' | awk '{printf $2}')" >> $GITHUB_ENV
# Publish container images(egeria) to quay.io and docker.io
- name: Copy the distribution content to be used in docker copy command
run: |
mkdir -p ./open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly
cp -r open-metadata-distribution/open-metadata-assemblies/build/unpacked/egeria-${{ env.VERSION }}-distribution.tar.gz/. open-metadata-resources/open-metadata-deployment/docker/egeria/build/assembly
- name: Build and push(egeria) to quay.io and docker.io (tag latest only for main!)
if: ${{ github.ref == 'refs/heads/main'}}
uses: docker/build-push-action@v5
with:
push: true
tags: odpi/egeria:${{ env.VERSION }}, odpi/egeria:latest, quay.io/odpi/egeria:${{ env.VERSION }}, quay.io/odpi/egeria:latest
context: ./open-metadata-resources/open-metadata-deployment/docker/egeria
platforms: linux/amd64,linux/arm64
- name: Build and push(egeria) to quay.io and docker.io (no tag latest)
if: ${{ github.ref != 'refs/heads/main'}}
uses: docker/build-push-action@v5
with:
push: true
tags: odpi/egeria:${{ env.VERSION }}, quay.io/odpi/egeria:${{ env.VERSION }}
context: ./open-metadata-resources/open-metadata-deployment/docker/egeria
platforms: linux/amd64,linux/arm64
# Publish container images(egeria-configure) to quay.io and docker.io
- name: Build and push(egeria-configure) to quay.io and docker.io (tag latest)
if: ${{ github.ref == 'refs/heads/main'}}
uses: docker/build-push-action@v5
with:
push: true
tags: odpi/egeria-configure:${{ env.VERSION }}, odpi/egeria-configure:latest, quay.io/odpi/egeria-configure:${{ env.VERSION }}, quay.io/odpi/egeria-configure:latest
context: ./open-metadata-resources/open-metadata-deployment/docker/configure
platforms: linux/amd64,linux/arm64
# --
# Publish container images(egeria-configure) to quay.io and docker.io
- name: Build and push(egeria-configure) to quay.io and docker.io (no tag latest)
if: ${{ github.ref != 'refs/heads/main'}}
uses: docker/build-push-action@v5
with:
push: true
tags: odpi/egeria-configure:${{ env.VERSION }}, quay.io/odpi/egeria-configure:${{ env.VERSION }}
context: ./open-metadata-resources/open-metadata-deployment/docker/configure
platforms: linux/amd64,linux/arm64
# --
- name: Upload Log of any dependency failures
uses: actions/upload-artifact@v3.1.3
with:
name: Dependency Analysis Report (on failure)
path: build/reports/dependency-analysis/build-health-report.txt
if-no-files-found: ignore
# Mostly for verification - not published to the release itself for now
- name: Upload assemblies
uses: actions/upload-artifact@v3.1.3
with:
name: Assemblies
path: open-metadata-distribution/open-metadata-assemblies/build/distributions/*.gz
- name: Upload Test coverage report
uses: actions/upload-artifact@v3.1.3
with:
name: Jacoco Coverage Report
path: build/reports/jacoco/codeCoverageReport
if-no-files-found: ignore