From 4f9448abc66764fe8c1938288083bdac922e1ebe Mon Sep 17 00:00:00 2001 From: Piotr Mankowski Date: Fri, 11 Dec 2020 14:37:45 -0800 Subject: [PATCH] Repo fix and CI integration --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++ .github/workflows/release.yml | 38 ++++++++++++++++++++ api/pom.xml | 2 +- omod/pom.xml | 35 ++++++++++++++++-- pom.xml | 67 ++++++++++++++++++++++++++++++++--- 5 files changed, 182 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7e8dc29 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f5e9091 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/api/pom.xml b/api/pom.xml index e3870e8..95cf7bf 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ org.openmrs.module xds-sender - 1.0.0 + 1.0.1 xds-sender-api diff --git a/omod/pom.xml b/omod/pom.xml index b17ac7d..4b9e3d0 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -5,7 +5,7 @@ org.openmrs.module xds-sender - 1.0.0 + 1.0.1 xds-sender-omod @@ -50,5 +50,36 @@ - + + + github-packages + + + + maven-deploy-plugin + + + + deploy-file + deploy + + deploy-file + + + https://maven.pkg.github.com/isanteplus/isanteplus-packages + target/${project.parent.artifactId}-${project.version}.omod + github-packages + omod + false + ${project.parent.artifactId} + ${project.version} + ${groupId} + + + + + + + + diff --git a/pom.xml b/pom.xml index ac90555..29dd2c4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.openmrs.module xds-sender - 1.0.0 + 1.0.1 pom XDS Sender Module for sending XDS.b documents for encounters @@ -204,13 +204,13 @@ openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://mavenrepo.openmrs.org/nexus/content/repositories/public central Maven Repository Switchboard default - http://repo1.maven.org/maven2 + https://repo1.maven.org/maven2 dcm4che @@ -220,16 +220,73 @@ marc-te-main http://te.marc-hi.ca/mvn + + santesute-main + http://santesuite.org/mvn + SanteSuite + openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://mavenrepo.openmrs.org/nexus/content/repositories/public false - + + + + github-packages + + + + github-packages + Github iSantePlus Packages + https://maven.pkg.github.com/isanteplus/isanteplus-packages + false + + + github-packages + Github iSantePlus Packages + https://maven.pkg.github.com/isanteplus/isanteplus-packages + true + + + + + + github-packages + Github iSantePlus Packages + https://maven.pkg.github.com/isanteplus/isanteplus-packages + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + none + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + validate + none + + + + + + +