From 98c7431e2626d08e0c0a80ea550069f760abd46d Mon Sep 17 00:00:00 2001 From: Janno Kusman Date: Wed, 7 Aug 2024 11:18:20 +0300 Subject: [PATCH 1/4] RM-3338: Setup `mvn deploy` for GH release --- .github/workflows/maven-release.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/maven-release.yml diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml new file mode 100644 index 0000000..8915dfb --- /dev/null +++ b/.github/workflows/maven-release.yml @@ -0,0 +1,30 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Publish to GitHub Packages Apache Maven (Maven repository) + +on: + release: + types: [created] + +jobs: + publish: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} From c4f74ee991ca92b0a81061a65a40edeefa9ed7fd Mon Sep 17 00:00:00 2001 From: Janno Kusman Date: Wed, 7 Aug 2024 13:00:05 +0300 Subject: [PATCH 2/4] RM-3338: add distributionManagement for github_ci profile --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 315941b..237b4ce 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,19 @@ https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} + + + + github + https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} + + + github + https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} + + + From 20f1d2f202ae8d460b3ed9c1e0d31a64e855ae44 Mon Sep 17 00:00:00 2001 From: Janno Kusman Date: Wed, 7 Aug 2024 13:01:46 +0300 Subject: [PATCH 3/4] RM-3338: suppress UnresolvedMavenProperty --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 237b4ce..16a9c71 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,7 @@ + https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} @@ -109,10 +110,12 @@ github + https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} github + https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} @@ -135,10 +138,12 @@ gitlab.ext.cyber.ee + ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven gitlab.ext.cyber.ee + ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven From 622771531200e9b6a161a9352d72ccad3480001b Mon Sep 17 00:00:00 2001 From: Janno Kusman Date: Wed, 7 Aug 2024 14:38:46 +0300 Subject: [PATCH 4/4] RM-3338: remove hardcoded distributionManagement.repository.id for gitlab_ci profile --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 16a9c71..73472fc 100644 --- a/pom.xml +++ b/pom.xml @@ -137,12 +137,12 @@ - gitlab.ext.cyber.ee + ${env.CI_SERVER_HOST} ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven - gitlab.ext.cyber.ee + ${env.CI_SERVER_HOST} ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven