From 77d6a8327a9df6103194be558f134038c5121e90 Mon Sep 17 00:00:00 2001 From: eschleb Date: Mon, 9 Sep 2024 14:13:45 +0200 Subject: [PATCH] Fix pipeline --- .github/actions/mvn-setup/action.yml | 22 +++++++++++++++++++ .github/workflows/deploy-snapshot.yml | 7 +++++- .../workflows/release-and-deploy-release.yml | 7 +++++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/actions/mvn-setup/action.yml diff --git a/.github/actions/mvn-setup/action.yml b/.github/actions/mvn-setup/action.yml new file mode 100644 index 0000000..6224e2a --- /dev/null +++ b/.github/actions/mvn-setup/action.yml @@ -0,0 +1,22 @@ +name: "Setup maven" +description: "Configures maven settings" + +inputs: + mgnl_nexus_user: + description: “Username for magnolia nexus” + required: true + mgnl_nexus_pass: + description: “Password for magnolia nexus” + required: true + +runs: + using: "composite" + steps: + - uses: s4u/maven-settings-action@v2 + with: + servers: | + [{ + "id": "magnolia.enterprise.group", + "username": "${{ inputs.mgnl_nexus_user }}", + "password": "${{ inputs.mgnl_nexus_pass }}" + }] \ No newline at end of file diff --git a/.github/workflows/deploy-snapshot.yml b/.github/workflows/deploy-snapshot.yml index a46cfd7..5df9123 100644 --- a/.github/workflows/deploy-snapshot.yml +++ b/.github/workflows/deploy-snapshot.yml @@ -19,6 +19,11 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 + - name: Maven setup + uses: ./.github/actions/mvn-setup + with: + mgnl_nexus_user: ${{secrets.MGNL_NEXUS_USER}} + mgnl_nexus_pass: ${{secrets.MGNL_NEXUS_PASS}} # Run maven verify - name: Maven verify run: mvn verify --batch-mode @@ -29,4 +34,4 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} nexus_username: ${{ secrets.OSSRH_USER }} - nexus_password: ${{ secrets.OSSRH_PASSWORD }} + nexus_password: ${{ secrets.OSSRH_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release-and-deploy-release.yml b/.github/workflows/release-and-deploy-release.yml index 3b478d6..87dbec2 100644 --- a/.github/workflows/release-and-deploy-release.yml +++ b/.github/workflows/release-and-deploy-release.yml @@ -28,7 +28,7 @@ jobs: mgnl_nexus_pass: ${{secrets.MGNL_NEXUS_PASS}} # Install xmllint - name: Install dependencies - run: sudo apt-get install libxml2-utils + run: sudo apt-get update && sudo apt-get install libxml2-utils # Set git user name and email - name: Set up Git run: | @@ -56,6 +56,11 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 + - name: Maven setup + uses: ./.github/actions/mvn-setup + with: + mgnl_nexus_user: ${{secrets.MGNL_NEXUS_USER}} + mgnl_nexus_pass: ${{secrets.MGNL_NEXUS_PASS}} # Run maven verify - name: Maven verify run: mvn verify --batch-mode