You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/03/12 19:32:16 UTC

[isis-app-helloworld] 01/02: reconciling with simpleapp

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch jpa
in repository https://gitbox.apache.org/repos/asf/isis-app-helloworld.git

commit 9c3ba932e2eaea55fb629aa22473942d55480abb
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Mar 12 19:27:48 2021 +0000

    reconciling with simpleapp
---
 .github/workflows/build-and-test.yml | 100 +++++++++++++++++++++++++++++++++++
 .github/workflows/mavenJdk15.yml     |  56 --------------------
 .github/workflows/mavenJdk8.yml      |  61 ---------------------
 3 files changed, 100 insertions(+), 117 deletions(-)

diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000..6d71f31
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,100 @@
+name: Maven Build and Test
+
+on:
+  workflow_dispatch:
+  push:
+    branches:
+      - jdo
+      - jpa
+#      - jdo-SNAPSHOT
+#      - jpa-SNAPSHOT
+  pull_request:
+    branches:
+      - jdo
+      - jpa
+#      - jdo-SNAPSHOT
+#      - jpa-SNAPSHOT
+
+jobs:
+  build:
+    name: Build, Test
+    runs-on: ubuntu-latest
+
+    strategy:
+      matrix:
+        java-version:
+          - 1.8
+          - 15
+
+    steps:
+    - name: Checkout repo
+      uses: actions/checkout@v2.3.3
+
+    - name: Set up JDK ${{ matrix.java-version }}
+      uses: actions/setup-java@v1
+      with:
+        java-version: ${{ matrix.java-version }}
+
+    - name: Print Maven Version
+      run: mvn --version
+
+    - name: Activate Cache for Maven Downloads
+      uses: actions/cache@v2
+      env:
+        cache-name: cache-maven-modules
+      with:
+        path: ~/.m2/repository
+        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
+        restore-keys: |
+          ${{ runner.os }}-build-${{ env.cache-name }}-
+          ${{ runner.os }}-build-
+          ${{ runner.os }}-
+
+    - name: Calculate $REVISION
+      id: revision
+      shell: bash
+      run: |
+        if [[ $GITHUB_REF =~ .*-SNAPSHOT ]]
+        then
+          PARENT=$(curl -X GET "https://nexus.incode.work/service/rest/v1/search?sort=version&repository=nightly-builds&group=org.apache.isis.app&name=isis-app-starter-parent" -H "accept: application/json" -s | jq '.items[0].version' | sed 's/"//g')
+          echo "parentVersion = $PARENT"
+          mvn versions:update-parent -DparentVersion="[$PARENT]"
+        fi
+        BASELINE=$(cat pom.xml | grep "<version>" | head -1 | awk -F'>' '{print $2}' | awk -F'<' '{print $1}')
+        SHA_ID=$(echo $GITHUB_SHA | cut -c1-8)
+        REVISION=${BASELINE}.$(date +%Y%m%d-%H%M)-${SHA_ID}
+        echo "##[set-output name=revision;]${REVISION}"
+
+    - name: Share $REVISION as Environment Variable
+      run: echo "REVISION=${{ steps.revision.outputs.revision }}" >> $GITHUB_ENV
+
+    - name: Print $REVISION
+      shell: bash
+      run: |
+        echo ==============  ENV  =================
+        echo REVISION            \: $REVISION
+        echo ======================================
+
+    - name: Update Maven version
+      shell: bash
+      run: |
+        mvn versions:set -DnewVersion=$REVISION
+
+    - name: Print pom.xml
+      shell: bash
+      run: |
+        cat pom.xml
+
+    - name: Build with Maven
+      shell: bash
+      run: |
+        mvn install
+
+# uncomment and set environment variables to push to Docker registry
+#    - name: Build and Push Docker Image
+#      shell: bash
+#      run: |
+#        mvn -Ddocker jib:build
+#      env:
+#        DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
+#        DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
diff --git a/.github/workflows/mavenJdk15.yml b/.github/workflows/mavenJdk15.yml
deleted file mode 100644
index cbf0845..0000000
--- a/.github/workflows/mavenJdk15.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Build w/ Maven + Jdk 15
-
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  build:
-
-    runs-on: ubuntu-latest
-
-    steps:
-    - uses: actions/checkout@v2.3.3
-
-    - name: Set up JDK 15
-      uses: actions/setup-java@v1
-      with:
-        java-version: 15
-
-    - name: Print Maven Version
-      run: mvn --version
-
-    - name: Activate Cache for Maven Downloads
-      uses: actions/cache@v2
-      env:
-        cache-name: cache-maven-modules
-      with:
-        path: ~/.m2/repository
-        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
-        restore-keys: |
-          ${{ runner.os }}-build-${{ env.cache-name }}-
-          ${{ runner.os }}-build-
-          ${{ runner.os }}-
-
-    - name: Prepare Build Versions
-      shell: bash
-      run: |
-        BASELINE=$(cat pom.xml | grep "<version>" | head -1 | awk -F'>' '{print $2}' | awk -F'<' '{print $1}')
-        SHA_ID=$(echo $GITHUB_SHA | cut -c1-8)
-        REVISION=${BASELINE}.$(date +%Y%m%d-%H%M)-${SHA_ID}
-        mvn versions:set -DnewVersion=$REVISION
-
-    - name: Print pom.xml
-      shell: bash
-      run: |
-        cat pom.xml
-
-    - name: Build with Maven
-      shell: bash
-      run: |
-        mvn install
diff --git a/.github/workflows/mavenJdk8.yml b/.github/workflows/mavenJdk8.yml
deleted file mode 100644
index 5937317..0000000
--- a/.github/workflows/mavenJdk8.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Build w/ Maven + Jdk 8
-
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  build:
-
-    runs-on: ubuntu-latest
-
-    steps:
-    - uses: actions/checkout@v2.3.3
-
-    - name: Set up JDK 1.8
-      uses: actions/setup-java@v1
-      with:
-        java-version: 1.8
-
-    - name: Print Maven Version
-      run: mvn --version
-
-    - name: Activate Cache for Maven Downloads
-      uses: actions/cache@v2
-      env:
-        cache-name: cache-maven-modules
-      with:
-        path: ~/.m2/repository
-        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
-        restore-keys: |
-          ${{ runner.os }}-build-${{ env.cache-name }}-
-          ${{ runner.os }}-build-
-          ${{ runner.os }}-
-
-    - name: Prepare Build Versions
-      shell: bash
-      run: |
-        BASELINE=$(cat pom.xml | grep "<version>" | head -1 | awk -F'>' '{print $2}' | awk -F'<' '{print $1}')
-        SHA_ID=$(echo $GITHUB_SHA | cut -c1-8)
-        export REVISION=${BASELINE}.$(date +%Y%m%d-%H%M)-${SHA_ID}
-        mvn versions:set -DnewVersion=$REVISION
-
-    - name: Print pom.xml
-      shell: bash
-      run: |
-        cat pom.xml
-
-    - name: Build with Maven
-      shell: bash
-      run: |
-        mvn install
-
-#    - name: Build and Push Docker Image
-#      shell: bash
-#      run: |
-#        mvn -Ddocker jib:build