From 078d429ffdc92557c55d30f14ac213f037dbb9e2 Mon Sep 17 00:00:00 2001 From: Nigel Jones Date: Wed, 24 Feb 2021 11:30:53 +0000 Subject: [PATCH] #4664 Release pipeline (github actions) Signed-off-by: Nigel Jones --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ pom.xml | 37 +++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..f0d0f6bcb8b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the ODPi Egeria project. +name: "Release (Java8, Maven)" + +# 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: + + + +jobs: + build: + runs-on: ubuntu-latest + name: "Release" + steps: + - uses: actions/checkout@v2 + name: Checkout source + - name: Set up JDK 8 + uses: actions/setup-java@v1 + with: + # Java 1.8 is used for final released build + java-version: 1.8 + # 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 + run: mvn -B -DuseMavenCentral clean verify + # 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 }} + # Mostly for verification - not published to the release itself for now + - name: Upload assemblies + uses: actions/upload-artifact@v2 + with: + name: Assemblies + path: open-metadata-distribution/open-metadata-assemblies/target/*.gz diff --git a/pom.xml b/pom.xml index 9d27d8d20d3..02bc5006e60 100644 --- a/pom.xml +++ b/pom.xml @@ -3893,5 +3893,42 @@ + + dist-github + + + useGitHub + true + + + + + github + GitHub Packages + https://maven.pkg.github.com/odpi/egeria + + + + + dist-oss + + + useMavenCentral + true + + + + + ossrh + Central Repository OSSRH - Staging + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + ossrh + Central Repository OSSRH - Snapshots + https://oss.sonatype.org/content/repositories/snapshots + + +