-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4730 from planetf1/issue4664
#4664 Merge pipeline (github actions) - snapshot publishing to maven …
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright Contributors to the ODPi Egeria project. | ||
name: "Merge (Java8, Maven)" | ||
|
||
# Trigger after code is merged. only on main repo | ||
# - does not run on modification (may be just text) | ||
|
||
on: | ||
push: | ||
branches: [master,egeria-release-*] | ||
|
||
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 merge builds (PRs do check Java 11) | ||
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 | ||
# Build and publish - but only for master | ||
- name: Build with Maven (Publish snapshots to maven central) | ||
if: ${{ github.repository == 'odpi/egeria' && github.ref == 'refs/heads/master'}} | ||
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 }} | ||
# Build and publish - but only for master | ||
- name: Build with Maven (no snapshots published to maven central) | ||
if: ${{ github.repository != 'odpi/egeria' || github.ref != 'refs/heads/master'}} | ||
run: mvn -B clean verify | ||
# -- | ||
# TODO - Publish docker images | ||
# -- | ||
# 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 |