From efa51442d56dd3120950847051eac6339eaa26c0 Mon Sep 17 00:00:00 2001 From: gabriel-logan Date: Sun, 7 Jul 2024 08:46:21 -0300 Subject: [PATCH] chore: Add distributionManagement configuration to pom.xml --- .github/workflows/maven-publish.yml | 36 +++++++++++++++++++++++++++++ packages/java/pom.xml | 8 +++++++ packages/java/settings.xml | 0 3 files changed, 44 insertions(+) create mode 100644 .github/workflows/maven-publish.yml create mode 100644 packages/java/settings.xml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..fb72d90 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,36 @@ +# 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: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + working-directory: ./packages/java + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + working-directory: ./packages/java + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/packages/java/pom.xml b/packages/java/pom.xml index 4ecce5d..611235f 100644 --- a/packages/java/pom.xml +++ b/packages/java/pom.xml @@ -53,4 +53,12 @@ + + + github + GitHub Packages + https://maven.pkg.github.com/octocat/hello-world + + + \ No newline at end of file diff --git a/packages/java/settings.xml b/packages/java/settings.xml new file mode 100644 index 0000000..e69de29