Skip to content

Commit

Permalink
Merge pull request #3 from equinix-labs/maven-publish
Browse files Browse the repository at this point in the history
add GH action to publish maven packages to GH
  • Loading branch information
displague authored Mar 31, 2023
2 parents 84eee2d + be8a0f1 commit 0e33517
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven publish package

on:
push:
tags:
# listen to tags that starts with the letter v as a convention to release tags.
- v*

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
working-directory: ./equinix-openapi-fabric
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
working-directory: ./equinix-openapi-fabric
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/equinix-labs/fabric-java
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 0e33517

Please sign in to comment.