forked from odpi/egeria
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (91 loc) · 4.26 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the ODPi Egeria project.
name: "Release"
# Trigger when a Release is created in github
# - 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:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: "Release"
if: startsWith(github.repository,'odpi/')
steps:
- uses: actions/checkout@v3
name: Checkout source
# Prep for docker builds
- 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.io)
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
# Publishing attributes for maven central (this step adds to setting.xml)
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
# Keys must be known to maven central - require broad publishing
gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# Normal build (in future may also run reports (site)) -
- name: Build with Maven and publish to oss.sonatype.org
# See https://github.com/actions/toolkit/issues/231 requires parms using . to be quoted
run: 'mvn -B -DuseMavenCentral clean deploy'
# Needed for publishing -- note we push to a staging area, login to oss.sonatype.org to
# verify (close) the repository & release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
# 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 "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $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/target/assembly
cp -r open-metadata-distribution/open-metadata-assemblies/target/egeria-${{ env.VERSION }}-distribution/egeria-omag-${{ env.VERSION }}/. open-metadata-resources/open-metadata-deployment/docker/egeria/target/assembly
- name: Build and push(egeria) to quay.io and docker.io
uses: docker/build-push-action@v3
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
# Publish container images(egeria-configure) to quay.io and docker.io
- name: Build and push(egeria-configure) to quay.io and docker.io
uses: docker/build-push-action@v3
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
# Mostly for verification - not published to the release itself for now
- name: Upload assemblies
uses: actions/upload-artifact@v3
with:
name: Assemblies
path: open-metadata-distribution/open-metadata-assemblies/target/*.gz