Skip to content

Commit

Permalink
OZ-438: Build, test and deploy using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett authored Jan 26, 2024
1 parent 8c2c422 commit 9a8421d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
validate:
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

spotless:
needs: validate
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-spotless-check.yml@main

pre-release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: spotless
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

release:
if: ${{ github.event_name == 'release' }}
needs: spotless
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

# this job notifies OCD3 of a new pre-release(snapshots)
notify-ocd3:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: pre-release
uses: mekomsolutions/shared-github-workflow/.github/workflows/ocd3-notify.yml@main
secrets:
OCD3_USERNAME: ${{ secrets.OCD3_USERNAME }}
OCD3_PASSWORD: ${{ secrets.OCD3_PASSWORD }}
4 changes: 2 additions & 2 deletions .ocd3.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1
build:
# Unable to run tests because of no Docker agent available in OCD3 yet. https://mekomsolutions.atlassian.net/browse/INFRA-318
bash_commands: "mvn clean install -DskipTests"
bash_commands: "echo 'Build is handled by GitHub Actions. Skipping...' && exit 0"
deploy:
bash_commands: "mvn clean deploy -DskipTests -DaltDeploymentRepository=mks-nexus::default::https://nexus.mekomsolutions.net/repository/maven-snapshots"
bash_commands: "echo 'Publishing is handled by GitHub Actions. Skipping...' && exit 0"
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
</developer>
</developers>

<distributionManagement>
<repository>
<id>mks-nexus-public-releases</id>
<name>Mekom Solutions Nexus repo for releases</name>
<url>https://nexus.mekomsolutions.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>mks-nexus-public-snapshots</id>
<name>Mekom Solutions Nexus repo for snapshots</name>
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
Expand Down

0 comments on commit 9a8421d

Please sign in to comment.