Skip to content

Commit

Permalink
Merge pull request #122 from usdot-jpo-ode/adopt-workflow-fix
Browse files Browse the repository at this point in the history
Adding Github Workflow to ConflictVisualizer
  • Loading branch information
John-Wiens authored Nov 27, 2024
2 parents df510a2 + 71a6172 commit d7f0645
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/artifact-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Java Package

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


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: 'temurin'

- name: Remove snapshot from version
run: |
cd api/jpo-conflictvisualizer-api
mvn versions:set -DremoveSnapshot
- name: Build with Maven
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MAVEN_GITHUB_TOKEN_NAME: ${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG: ${{ github.repository_owner }}
run: |
cd api/jpo-conflictvisualizer-api
mvn -s settings.xml -B package --file pom.xml -DskipTests -Ppackage-jar
- name: Publish to GitHub Packages
run: |
cd api/jpo-conflictvisualizer-api
mvn -s settings.xml --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy -DskipTests -Ppackage-jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GITHUB_TOKEN_NAME: ${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG: ${{ github.repository_owner }}
2 changes: 1 addition & 1 deletion api/jpo-conflictvisualizer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/${github_organization}/jpo-conflictmonitor</url>
<url>https://maven.pkg.github.com/${github_organization}/jpo-conflictvisualizer</url>
</repository>
</distributionManagement>

Expand Down
19 changes: 16 additions & 3 deletions api/jpo-conflictvisualizer-api/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@
<activeProfile>default</activeProfile>
</activeProfiles>
<servers>
<server>
<id>github</id>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_ode</id>
<username>jpo_conflictmonitor</username>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_geojsonconverter</id>
<username>jpo_conflictmonitor</username>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_conflictmonitor</id>
<username>jpo_conflictmonitor</username>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
</servers>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-ode</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>github_jpo_ode</id>
<name>GitHub JPO ODE</name>
Expand Down

0 comments on commit d7f0645

Please sign in to comment.