From f97972e5aa9e94f7a45ce837b9aa0a72836776d7 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 9 Feb 2021 16:46:21 -0600 Subject: [PATCH] VIVO-1960: GitHub Actions Continued (#218) * add build workflow * remove travis * remove unnecessary vitro cache * update readme badge * run tests during CI build * build CI use java 11 * add repositories to distribution management * deploy from main branch and update readme Follow-on to: https://jira.lyrasis.org/browse/VIVO-1960 --- .github/workflows/build.yml | 4 ++-- .github/workflows/deploy.yml | 41 ++++++++++++++++++++++++++++++++++++ README.md | 2 +- installer/pom.xml | 18 +++++++--------- pom.xml | 2 +- 5 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f19448c..09b5b3bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 - name: Maven Build - run: mvn clean package -Dmaven.test.skip=false + run: mvn clean install diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..6e2acd7e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,41 @@ +name: Deploy + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + env: + MAVEN_OPTS: -Xmx1024M + + steps: + - uses: actions/checkout@v2 + + - name: Clone Vitro + run: git clone https://github.com/vivo-project/Vitro.git ../Vitro + + - name: Maven Cache + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-cache-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-cache-m2- + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Maven Deploy + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/README.md b/README.md index ffd09438..a77727e9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # VIVO: Connect, Share, Discover -[![Build](https://github.com/vivo-project/VIVO/workflows/Build/badge.svg)](https://github.com/vivo-project/VIVO/actions?query=workflow%3ABuild) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2639714.svg)](https://doi.org/10.5281/zenodo.2639713) +[![Build](https://github.com/vivo-project/VIVO/workflows/Build/badge.svg)](https://github.com/vivo-project/VIVO/actions?query=workflow%3ABuild) [![Deploy](https://github.com/vivo-project/VIVO/workflows/Deploy/badge.svg)](https://github.com/vivo-project/VIVO/actions?query=workflow%3ADeploy) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2639714.svg)](https://doi.org/10.5281/zenodo.2639713) VIVO is an open source semantic web tool for research discovery -- finding people and the research they do. diff --git a/installer/pom.xml b/installer/pom.xml index 26535206..75ca4250 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -36,12 +36,6 @@ true - - maven-deploy-plugin - - true - - @@ -65,10 +59,6 @@ maven-dependency-plugin 2.10 - - maven-deploy-plugin - 2.7 - maven-enforcer-plugin 1.4.1 @@ -185,6 +175,14 @@ vivo-installer http://vivo-project.github.io/ + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + diff --git a/pom.xml b/pom.xml index 050bf25e..dfd2c427 100644 --- a/pom.xml +++ b/pom.xml @@ -538,6 +538,6 @@ ossrh https://oss.sonatype.org/service/local/staging/deploy/maven2/ - +