From fbb3433d393cf800a8d5939e8659edffa77e3bbb Mon Sep 17 00:00:00 2001 From: kdaud Date: Wed, 25 Sep 2024 09:11:16 +0300 Subject: [PATCH 1/2] INFRA-411: Added GitHub shared workflow to build and publish artifacts. --- .github/workflows/build-publish.yml | 27 +++++++++++++++++++++++++++ .github/workflows/check-deps.yml | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/build-publish.yml create mode 100644 .github/workflows/check-deps.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..0470ffe --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,27 @@ +name: Build and Publish + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + types: [published] + +jobs: + build: + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main + with: + java-version: "8" + maven-phase: "install" + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + publish: + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }} + needs: build + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} diff --git a/.github/workflows/check-deps.yml b/.github/workflows/check-deps.yml new file mode 100644 index 0000000..69361d7 --- /dev/null +++ b/.github/workflows/check-deps.yml @@ -0,0 +1,18 @@ +name: Check for dependency changes + +on: + workflow_dispatch: + schedule: + - cron: '*/60 * * * *' + +jobs: + check-deps: + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-check-deps-build-publish.yml@main + with: + java-version: "8" + notify-ocd3: true + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + OCD3_USERNAME: ${{ secrets.OCD3_USERNAME }} + OCD3_PASSWORD: ${{ secrets.OCD3_PASSWORD }} From 67ec12527d2cefc95e141d48139411c110813abf Mon Sep 17 00:00:00 2001 From: kdaud Date: Wed, 25 Sep 2024 13:44:24 +0300 Subject: [PATCH 2/2] address review --- .github/workflows/{build-publish.yml => ci.yml} | 5 ++--- pom.xml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) rename .github/workflows/{build-publish.yml => ci.yml} (86%) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/ci.yml similarity index 86% rename from .github/workflows/build-publish.yml rename to .github/workflows/ci.yml index 0470ffe..912bf64 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Build and Publish +name: CI on: push: @@ -13,13 +13,12 @@ jobs: uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main with: java-version: "8" - maven-phase: "install" secrets: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} publish: - if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }} needs: build uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main secrets: diff --git a/pom.xml b/pom.xml index 15c4dd2..e302ebb 100644 --- a/pom.xml +++ b/pom.xml @@ -268,6 +268,18 @@ + + + Mekom Solutions Nexus repo for releases + mks-nexus-public-releases + https://nexus.mekomsolutions.net/repository/maven-releases + + + Mekom Solutions Nexus repo for snapshots + mks-nexus-public-snapshots + https://nexus.mekomsolutions.net/repository/maven-snapshots + +