From 9f4f24d3d85bc3d1fc4ed468fa9ad2c4a515bf19 Mon Sep 17 00:00:00 2001 From: kdaud Date: Wed, 25 Sep 2024 14:46:04 +0300 Subject: [PATCH 1/2] INFRA-411: Use shared GA workflows to build and publish. --- .github/workflows/build-publish.yml | 27 +++++++++++++++++++++++++++ .github/workflows/maven.yml | 27 --------------------------- pom.xml | 13 +++++++++++++ 3 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build-publish.yml delete mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 00000000..5fb3fc9c --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,27 @@ +name: Build and Publish + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + strategy: + matrix: + java: [ '8', '11'] + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main + with: + java-version: ${{ matrix.Java }} + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + publish: + 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: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index c04244f0..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ '8', '11'] - steps: - - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.Java }} - uses: actions/setup-java@v2 - with: - java-version: ${{ matrix.Java }} - distribution: 'adopt' - - name: Build with Maven - run: mvn -B package --file pom.xml diff --git a/pom.xml b/pom.xml index 6aa18cc8..2879fb06 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,19 @@ + + + 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 + + + From 391479cc1def853f107ae4cd387c657ad76107b4 Mon Sep 17 00:00:00 2001 From: kdaud Date: Thu, 26 Sep 2024 16:48:09 +0300 Subject: [PATCH 2/2] Apply suggestion --- .../workflows/{build-publish.yml => ci.yml} | 2 +- .travis.yml | 3 --- pom.xml | 24 +++++++++---------- 3 files changed, 13 insertions(+), 16 deletions(-) rename .github/workflows/{build-publish.yml => ci.yml} (96%) delete mode 100644 .travis.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/ci.yml similarity index 96% rename from .github/workflows/build-publish.yml rename to .github/workflows/ci.yml index 5fb3fc9c..0ce85a34 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Build and Publish +name: CI on: push: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b5ffed3f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: java -jdk: - - openjdk8 diff --git a/pom.xml b/pom.xml index 2879fb06..fd011572 100644 --- a/pom.xml +++ b/pom.xml @@ -100,18 +100,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 - - + + + mks-nexus-public-releases + Mekom Solutions Nexus repo for releases + https://nexus.mekomsolutions.net/repository/maven-releases + + + mks-nexus-public-snapshots + Mekom Solutions Nexus repo for snapshots + https://nexus.mekomsolutions.net/repository/maven-snapshots + +