Skip to content

Commit

Permalink
#4664 Release pipeline (github actions)
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
  • Loading branch information
planetf1 committed Feb 24, 2021
1 parent cb981db commit 078d429
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3893,5 +3893,42 @@
</plugins>
</build>
</profile>
<profile>
<id>dist-github</id>
<activation>
<property>
<name>useGitHub</name>
<value>true</value>
</property>
</activation>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/odpi/egeria</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>dist-oss</id>
<activation>
<property>
<name>useMavenCentral</name>
<value>true</value>
</property>
</activation>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH - Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Central Repository OSSRH - Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit 078d429

Please sign in to comment.