Skip to content

Commit

Permalink
adding github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael7371 committed Jul 15, 2024
1 parent b434c88 commit dcbd07f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/artifact-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Java Package

on:
push:
tags:
- 'jpo-ode-*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'

- name: Remove snapshot from version
run: mvn versions:set -DremoveSnapshot

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages
run: mvn --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.language>java</sonar.language>
<jmockit.version>1.49</jmockit.version>
<!-- Allow override of github organization when publishing artifacts to github -->
<github_organization>usdot-jpo-ode</github_organization>
</properties>

<dependencies>
Expand Down Expand Up @@ -161,5 +163,11 @@
</plugins>
</pluginManagement>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/CDOT-CV/jpo-ode</url>
</repository>
</distributionManagement>
</project>

0 comments on commit dcbd07f

Please sign in to comment.