diff --git a/.github/workflows/artifact-publish.yml b/.github/workflows/artifact-publish.yml new file mode 100644 index 0000000..7984e52 --- /dev/null +++ b/.github/workflows/artifact-publish.yml @@ -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 }} \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/settings.xml b/api/jpo-conflictvisualizer-api/settings.xml index 9972e62..20f55c3 100644 --- a/api/jpo-conflictvisualizer-api/settings.xml +++ b/api/jpo-conflictvisualizer-api/settings.xml @@ -4,19 +4,24 @@ default + + github + jpo_conflictvisualizer + ${env.MAVEN_GITHUB_TOKEN} + github_jpo_ode - jpo_conflictmonitor + jpo_conflictvisualizer ${env.MAVEN_GITHUB_TOKEN} github_jpo_geojsonconverter - jpo_conflictmonitor + jpo_conflictvisualizer ${env.MAVEN_GITHUB_TOKEN} github_jpo_conflictmonitor - jpo_conflictmonitor + jpo_conflictvisualizer ${env.MAVEN_GITHUB_TOKEN} @@ -24,6 +29,14 @@ default + + github + GitHub Apache Maven Packages + https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-ode + + false + + github_jpo_ode GitHub JPO ODE