Skip to content

Commit

Permalink
Merge pull request #2 from samuelmale/chore/configure-ci
Browse files Browse the repository at this point in the history
Add Github workflows and misc cleanup
  • Loading branch information
samuelmale authored Oct 31, 2023
2 parents d08b9a8 + 0fd2189 commit 25c5c02
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 40 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Deploy

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'

- name: Build and Test
run: mvn --batch-mode --update-snapshots clean package

- name: Set settings.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "uwdigi-repo-central",
"username": "${{ secrets.MAVEN_REPO_USERNAME }}",
"password": "${{ secrets.MAVEN_REPO_PASSWORD }}"
},
{
"id": "uwdigi-repo-snapshots",
"username": "${{ secrets.MAVEN_REPO_USERNAME }}",
"password": "${{ secrets.MAVEN_REPO_PASSWORD }}"
}]
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'SIGDEP-3' }}

- name: Deploy
run: mvn --batch-mode clean deploy
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'SIGDEP-3' }}
21 changes: 21 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and Test

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'

- name: Build and Test
run: mvn --batch-mode --update-snapshots clean package
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: HIV_SCREENING Release

on:
workflow_dispatch:
inputs:
branch:
description: "The branch to checkout when cutting the release."
required: true
default: "main"
releaseVersion:
description: "Default version to use when preparing a release."
required: true
default: "X.Y.Z"
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Source Code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'

- name: Build and Test
run: mvn --batch-mode --update-snapshots clean package

- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Perform Release
run: mvn release:prepare release:perform -B -s .maven-settings.xml -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
env:
MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

### Linux ###
.*
!.maven-settings.xml
!.github
!.gitignore
!.gitattributes
*~
Expand Down
64 changes: 64 additions & 0 deletions .maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
http://maven.apache.org/xsd/settings-1.2.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>uwdigi-repo-central</id>
<name>libs-release</name>
<url>https://packages.uwdigi.org/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>uwdigi-repo-snapshots</id>
<name>libs-snapshot</name>
<url>https://packages.uwdigi.org/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>uwdigi-repo-central</id>
<name>libs-release</name>
<url>https://packages.uwdigi.org/artifactory/libs-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>uwdigi-repo-snapshots</id>
<name>libs-snapshot</name>
<url>https://packages.uwdigi.org/artifactory/libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>default</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>default</activeProfile>
</activeProfiles>
<servers>
<server>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_PASSWORD}</password>
<id>uwdigi-repo-central</id>
</server>
<server>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_PASSWORD}</password>
<id>uwdigi-repo-snapshots</id>
</server>
<server>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
<id>github</id>
</server>
</servers>
</settings>

13 changes: 1 addition & 12 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>hivscreening</artifactId>
<version>1.0</version>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>hivscreening-api</artifactId>
Expand All @@ -14,17 +14,6 @@
<description>API project for HivScreeningRegister</description>

<dependencies>

<!--
Add other dependencies from parent's pom:
<dependency>
<groupId>org.other.library</groupId>
<artifactId>library-name</artifactId>
</dependency>
-->




<!-- Begin OpenMRS core -->

Expand Down
11 changes: 1 addition & 10 deletions omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>hivscreening</artifactId>
<version>1.0</version>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>hivscreening-omod</artifactId>
Expand All @@ -15,22 +15,13 @@

<dependencies>

<!--
Add other dependencies from parent's pom:
<dependency>
<groupId>org.other.library</groupId>
<artifactId>library-name</artifactId>
</dependency>
-->

<!-- Begin OpenMRS modules -->

<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>${project.parent.artifactId}-api</artifactId>
<version>${project.parent.version}</version>
</dependency>


<!-- End OpenMRS modules -->

Expand Down
36 changes: 18 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>hivscreening</artifactId>
<version>1.0</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hiv Screening Register Module</name>
<description>Screening HIV module for client screening results</description>
Expand All @@ -22,10 +22,11 @@
</organization>

<scm>
<connection>scm:svn:https://svn.openmrs.org/openmrs-modules/hivscreening/trunk/</connection>
<developerConnection>scm:svn:https://svn.openmrs.org/openmrs-modules/hivscreening/trunk/</developerConnection>
<url>https://svn.openmrs.org/openmrs-modules/hivscreening/trunk/</url>
</scm>
<connection>scm:git:https://github.com/SIGDEP-3/openmrs-module-hivscreening.git</connection>
<developerConnection>scm:git:https://github.com/SIGDEP-3/openmrs-module-hivscreening.git</developerConnection>
<url>scm:git:https://github.com/SIGDEP-3/openmrs-module-hivscreening.git</url>
<tag>HEAD</tag>
</scm>

<modules>
<module>api</module>
Expand All @@ -40,19 +41,6 @@
<dependencyManagement>
<dependencies>

<!--
Libraries to add as dependencies with compile or runtime scope:
Find matching dependencies in the maven central repository.
<dependency>
<groupId>org.other.library</groupId>
<artifactId>library-name</artifactId>
<version>library.version</version>
<scope>compile</scope>
</dependency>
-->



<!-- Begin OpenMRS core -->

<dependency>
Expand Down Expand Up @@ -171,4 +159,16 @@
</pluginRepository>
</pluginRepositories>

<distributionManagement>
<repository>
<id>uwdigi-repo-central</id>
<name>libs-release</name>
<url>https://packages.uwdigi.org/artifactory/libs-release</url>
</repository>
<snapshotRepository>
<id>uwdigi-repo-snapshots</id>
<name>libs-snapshot</name>
<url>https://packages.uwdigi.org/artifactory/libs-snapshot</url>
</snapshotRepository>
</distributionManagement>
</project>

0 comments on commit 25c5c02

Please sign in to comment.