Skip to content

Commit

Permalink
Merge pull request #18 from IsantePlus/ci-setup-1
Browse files Browse the repository at this point in the history
CI setup and small fixes
  • Loading branch information
pmanko authored Dec 14, 2020
2 parents 30fcce8 + 6f2ed20 commit b1b61ea
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 21 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8.0.232
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "github-packages",
"username": "${{ secrets.RELEASE_USERNAME }}",
"password": "${{ secrets.RELEASE_TOKEN }}"
}]
githubServer: false
- name: Build with Maven
run: mvn -P 'github-packages' -B install
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
push:
branches: [master]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8.0.232
server-id: github-packages # Value of the distributionManagement/repository/id field of the pom.xml
server-username: pmanko
server-password: ${{ secrets.TOKEN }} # env variable for token in deploy
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "github-packages",
"username": "${{ secrets.RELEASE_USERNAME }}",
"password": "${{ secrets.RELEASE_TOKEN }}"
}]
githubServer: false
- name: Build
run: mvn -P github-packages -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true -B package
- name: Publish package
run: mvn -P github-packages -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true -B deploy
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

37 changes: 30 additions & 7 deletions omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@
<version>${m2SysVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>m2sys-biometrics</artifactId>
<version>${m2SysVersion}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>xds-sender-api</artifactId>
Expand Down Expand Up @@ -286,6 +279,36 @@
</plugins>
</build>
</profile>
<profile>
<id>github-packages</id>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<!-- Deploy OpenMRS omod file -->
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<url>https://maven.pkg.github.com/isanteplus/isanteplus-packages</url>
<file>target/${project.parent.artifactId}-${project.version}.omod</file>
<repositoryId>github-packages</repositoryId>
<packaging>omod</packaging>
<generatePom>false</generatePom>
<artifactId>${project.parent.artifactId}</artifactId>
<version>${project.version}</version>
<groupId>${groupId}</groupId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>


Expand Down
74 changes: 63 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@

<properties>
<openMRSVersion>1.9.9</openMRSVersion>
<uiframeworkVersion>3.13.0-SNAPSHOT</uiframeworkVersion>
<uiframeworkVersion>3.13.0</uiframeworkVersion>
<appframeworkVersion>2.9</appframeworkVersion>
<springVersion>3.0.5.RELEASE</springVersion>
<idgenVersion>4.4.0</idgenVersion>
<uicommonsVersion>2.4.0-SNAPSHOT</uicommonsVersion>
<uicommonsVersion>2.4.0</uicommonsVersion>
<emrapiVersion>1.18</emrapiVersion>
<calculationVersion>1.2</calculationVersion>
<providerManagementVersion>2.5.0</providerManagementVersion>
<registrationcoreVersion>1.7.2-SNAPSHOT</registrationcoreVersion>
<registrationcoreVersion>1.7.2</registrationcoreVersion>
<reportingModuleVersion>0.10.4</reportingModuleVersion>
<addresshierarchyVersion>2.9</addresshierarchyVersion>
<htmlformentryVersion>3.3.0</htmlformentryVersion>
<appuiVersion>1.9.0-SNAPSHOT</appuiVersion>
<coreappsVersion>1.11.1</coreappsVersion>
<appuiVersion>1.9.0</appuiVersion>
<coreappsVersion>1.19.1</coreappsVersion>
<serializationXstreamModuleVersion>0.2.12</serializationXstreamModuleVersion>
<eventVersion>2.5</eventVersion>
<groovyVersion>1.8.7</groovyVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<m2SysVersion>1.0.0</m2SysVersion>
<m2SysVersion>1.0.1</m2SysVersion>
<xds-senderVersion>1.0.0</xds-senderVersion>
</properties>

Expand Down Expand Up @@ -355,15 +355,15 @@
<repository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
Expand All @@ -374,13 +374,65 @@
<repository>
<id>openmrs-repo-modules</id>
<name>OpenMRS Modules</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/modules</url>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/modules</url>
</repository>
<snapshotRepository>
<id>openmrs-repo-snapshots</id>
<name>OpenMRS Snapshots</name>
<url>http://mavenrepo.openmrs.org/nexus/content/repositories/snapshots</url>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<profiles>
<profile>
<!-- Github Packages Integration -->
<id>github-packages</id>
<distributionManagement>
<!-- Deploy to Github Packages -->
<repository>
<id>github-packages</id>
<name>Github iSantePlus Packages</name>
<url>https://maven.pkg.github.com/isanteplus/isanteplus-packages</url>
<uniqueVersion>false</uniqueVersion>
</repository>
<snapshotRepository>
<id>github-packages</id>
<name>Github iSantePlus Packages</name>
<url>https://maven.pkg.github.com/isanteplus/isanteplus-packages</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
</distributionManagement>
<repositories>
<!-- Use the Github Packages Repo first when looking up dependencies -->
<repository>
<id>github-packages</id>
<name>Github iSantePlus Packages</name>
<url>https://maven.pkg.github.com/isanteplus/isanteplus-packages</url>
</repository>
</repositories>
<build>
<plugins>
<!-- Disable possible test jar generation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<executions>
<execution>
<id>validate</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit b1b61ea

Please sign in to comment.