diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 030cab50d..beeffcb39 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,11 @@ jobs: name: Publishing Maven artifacts runs-on: ubuntu-latest steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get -y install xmlstarlet + - name: Clone repository uses: actions/checkout@v4 @@ -23,11 +28,17 @@ jobs: java-version: '17' distribution: 'adopt' - - name: Check settings.xml + - name: Configure settings.xml run: | + xmlstarlet edit --inplace \ + -u "/_:settings/_:servers/_:server/_:password" \ + -v "$REPO_TOKEN" \ + ~/.m2/settings.xml cat ~/.m2/settings.xml + env: + REPO_TOKEN: ${{ secrets.REPO_TOKEN }} - - name: Update pom.xml + - name: Configure pom.xml run: | sed -i \ -e "s/OWNER/$NAMESPACE/g" \ @@ -43,8 +54,6 @@ jobs: --update-snapshots \ -pl '!native,!symkey' \ deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} wait-for-images: if: vars.REGISTRY != '' diff --git a/pom.xml b/pom.xml index cbeece4e0..4861f3e41 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ - - UTF-8 + github @@ -58,25 +59,38 @@ maven-surefire-plugin 3.1.2 + + maven-deploy-plugin + 2.8.2 + + local::default::file://${project.build.directory}/repo + + + + com.github.github + site-maven-plugin + 0.12 + + Deploy ${project.groupId}:${project.artifactId}:${project.version} + ${project.build.directory}/repo + + **/* + + OWNER + repo + refs/heads/maven + true + + + + + site + + deploy + + + - - - github - https://maven.pkg.github.com/OWNER/* - - true - - - - - - - github - GitHub Packages - https://maven.pkg.github.com/OWNER/REPOSITORY - - -