Skip to content

Commit

Permalink
Adding Github Workflow to ConflictVisualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Wiens committed Nov 26, 2024
1 parent fff08a2 commit b175b03
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/artifact-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Java Package

on:
# push:
# tags:
# - 'jpo-conflictvisualizer-*'
pull_request:
branches: [ "develop" ]

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 }}
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 b175b03

Please sign in to comment.