GitHub Maven Central Refactor #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Java Package | |
on: | |
push: | |
tags: | |
- 'jpo-geojsonconverter-*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
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: | | |
cd jpo-geojsonconverter | |
mvn versions:set -DremoveSnapshot | |
- name: Build with Maven | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN_NAME: ${{ vars.MAVEN_GITHUB_TOKEN_NAME }} | |
GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }} | |
GITHUB_ORG: ${{ github.repository_owner }} | |
run: | | |
cd jpo-geojsonconverter | |
mvn -s settings.xml -B package --file pom.xml -DskipTests -Ppackage-jar | |
- name: Publish to GitHub Packages | |
run: | | |
cd jpo-geojsonconverter | |
mvn -s settings.xml --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy -DskipTests -Ppackage-jar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |