From cf701b8670c0245edeec6224183e46982083f8dc Mon Sep 17 00:00:00 2001 From: Markus Weskott Date: Thu, 8 Nov 2018 16:02:00 +0100 Subject: [PATCH 01/20] Add new JDK 1.8 Time-zones to OlsonTimeZones Define JDK 1.8.0_172 timezones in TimeZoneUtils.java - America/Punta_Arenas - Europe/Astrakhan - Europe/Kirov - Europe/Saratov - Europe/Ulyanovsk --- .../exchange/webservices/data/util/TimeZoneUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java b/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java index f0ab97d49..933ee5272 100644 --- a/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java +++ b/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java @@ -241,6 +241,7 @@ public static Map createOlsonTimeZoneToMsMap() { map.put("America/Porto_Acre", "SA Pacific Standard Time"); map.put("America/Porto_Velho", "SA Western Standard Time"); map.put("America/Puerto_Rico", "SA Western Standard Time"); + map.put("America/Punta_Arenas", "Pacific SA Standard Time"); map.put("America/Rainy_River", "Central Standard Time"); map.put("America/Rankin_Inlet", "Central Standard Time"); map.put("America/Recife", "SA Eastern Standard Time"); @@ -465,6 +466,7 @@ public static Map createOlsonTimeZoneToMsMap() { map.put("Etc/Zulu", "UTC"); map.put("Europe/Amsterdam", "W. Europe Standard Time"); map.put("Europe/Andorra", "W. Europe Standard Time"); + map.put("Europe/Astrakhan", "Russia Time Zone 3"); map.put("Europe/Athens", "GTB Standard Time"); map.put("Europe/Belfast", "GMT Standard Time"); map.put("Europe/Belgrade", "Central Europe Standard Time"); @@ -485,6 +487,7 @@ public static Map createOlsonTimeZoneToMsMap() { map.put("Europe/Jersey", "GMT Standard Time"); map.put("Europe/Kaliningrad", "Kaliningrad Standard Time"); map.put("Europe/Kiev", "FLE Standard Time"); + map.put("Europe/Kirov", "Russian Standard Time"); map.put("Europe/Lisbon", "GMT Standard Time"); map.put("Europe/Ljubljana", "Central Europe Standard Time"); map.put("Europe/London", "GMT Standard Time"); @@ -505,6 +508,7 @@ public static Map createOlsonTimeZoneToMsMap() { map.put("Europe/Samara", "Russia Time Zone 3"); map.put("Europe/San_Marino", "W. Europe Standard Time"); map.put("Europe/Sarajevo", "Central European Standard Time"); + map.put("Europe/Saratov", "Russia Time Zone 3"); map.put("Europe/Simferopol", "Russian Standard Time"); map.put("Europe/Skopje", "Central European Standard Time"); map.put("Europe/Sofia", "FLE Standard Time"); @@ -512,6 +516,7 @@ public static Map createOlsonTimeZoneToMsMap() { map.put("Europe/Tallinn", "FLE Standard Time"); map.put("Europe/Tirane", "Central Europe Standard Time"); map.put("Europe/Tiraspol", "GTB Standard Time"); + map.put("Europe/Ulyanovsk", "Russia Time Zone 3"); map.put("Europe/Uzhgorod", "FLE Standard Time"); map.put("Europe/Vaduz", "W. Europe Standard Time"); map.put("Europe/Vatican", "W. Europe Standard Time"); From d13f40763be6667ca6e84183b79769710083707f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Fri, 7 Feb 2020 10:41:22 +0100 Subject: [PATCH 02/20] Fix conversion of binary extended properties - fix: wrong type registered for binary props, was Byte[] but should have been byte[] Microsoft: let's register Byte[] for binprops instead of byte[] Also Microsoft: let's write the converter for binprops to handle byte[] but not Byte[] --- .../exchange/webservices/data/misc/MapiTypeConverter.java | 2 +- .../webservices/data/misc/MapiTypeConverterMapEntry.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverter.java b/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverter.java index 4ad9dbf68..32d79c448 100644 --- a/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverter.java +++ b/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverter.java @@ -76,7 +76,7 @@ public MapiTypeConverterMap createInstance() { mapitype.setIsArray(true); map.put(MapiPropertyType.ApplicationTimeArray, mapitype); - mapitype = new MapiTypeConverterMapEntry(Byte[].class); + mapitype = new MapiTypeConverterMapEntry(byte[].class); mapitype.setParse(IFunctions.Base64Decoder.INSTANCE); mapitype.setConvertToString(IFunctions.Base64Encoder.INSTANCE); map.put(MapiPropertyType.Binary, mapitype); diff --git a/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverterMapEntry.java b/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverterMapEntry.java index 6ca1f0228..652623d58 100644 --- a/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverterMapEntry.java +++ b/src/main/java/microsoft/exchange/webservices/data/misc/MapiTypeConverterMapEntry.java @@ -60,6 +60,7 @@ public Map, Object> createInstance() { Map, Object> map = new HashMap, Object>(); map.put(Boolean.class, false); + map.put(byte[].class, null); map.put(Byte[].class, null); map.put(Short.class, new Short((short) 0)); map.put(Integer.class, 0); From 0f20b826aa91fb5de0efe667d6df1fb5df5fa6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Fri, 7 Feb 2020 17:57:20 +0100 Subject: [PATCH 03/20] Add CircleCI build and experimental deploy - add: circleci config so the project will be built in our CI - add: first attempt to automatically deploy releases to GitHub Packages --- .circleci/config.yml | 82 ++++++++++++++++++++++++++++++++++ pom.xml | 104 +++++++++++++++++++++---------------------- 2 files changed, 132 insertions(+), 54 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..61c8384fc --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,82 @@ +# Java Maven CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-java/ for more details +# +version: 2 +jobs: + - build: + docker: + # specify the version you desire here + - image: circleci/openjdk:8-jdk + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/postgres:9.4 + + working_directory: ~/repo + + environment: + # Customize the JVM maximum heap limit + MAVEN_OPTS: -Xmx3200m + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: mvn --version + - run: mvn dependency:go-offline + + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} + + # run tests! + - run: mvn integration-test + + - run: + name: Collecting test reports + when: always + command: | + shopt -s nullglob + mkdir -p target/circleci-test-reports + for f in */target/surefire-reports + do + PROJ=$(echo "$f" | cut -d "/" -f1) # find name of project folder + echo "Copy test reports from $f to target/circleci-test-reports/$PROJ" + mkdir "target/circleci-test-reports/$PROJ" + cp "$f"/*.xml "target/circleci-test-reports/$PROJ" + done + + - run: + name: Collecting artifacts + when: on_success + command: | + mkdir -p target/circleci-artifacts + cp */target/*.jar target/circleci-artifacts/ + + - store_test_results: + path: target/circleci-test-reports + - store_artifacts: + path: target/circleci-artifacts + destination: dist + + - deploy-release: + requires: + - build + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + steps: + - run: + when: on_success + command: mvn deploy -Drevision=$(echo "$CIRCLE_TAG" | cut -c 2-) -Dchangelist= -Dsha1= -Dregistry=https://maven.pkg.github.com/FacilityNet -Dtoken=$GITHUB_DEPLOY_TOKEN diff --git a/pom.xml b/pom.xml index e303359bc..7ade46c23 100644 --- a/pom.xml +++ b/pom.xml @@ -28,16 +28,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.microsoft.ews-java-api + dk.facilitynet.connectors.calendar ews-java-api - 2.1-SNAPSHOT + ${revision}${changelist}${sha1} - Exchange Web Services Java API - Exchange Web Services (EWS) Java API + Exchange Web Services (EWS) Java API - FacilityNet fork - http://www.microsoft.com/ + https://facilitynet.io/ 2012 @@ -49,30 +48,15 @@ - Microsoft - http://www.microsoft.com/ + FacilityNet + https://facilitynet.io/ - - - vboctor - Victor Boctor - vboctor@users.noreply.github.com - http://www.github.com/officedev/ews-java-api - Microsoft - http://www.microsoft.com - - administrator - developer - - America/New_York - - http://www.example.com/jdoe/pic - - - - + 2.0.1 + -SNAPSHOT + + UTF-8 @@ -190,28 +174,11 @@ GitHub Issues - - travis - https://travis-ci.org/OfficeDev/ews-java-api - - - https://github.com/OfficeDev/ews-java-api - scm:git:ssh://git@github.com:OfficeDev/ews-java-api.git - scm:git:ssh://git@github.com:OfficeDev/ews-java-api.git + https://github.com/FacilityNet/ews-java-api + scm:git:https://github.com/FacilityNet/ews-java-api.git - - - ossrh-snapshot - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - org.apache.httpcomponents @@ -295,17 +262,46 @@ - + + + org.codehaus.mojo + flatten-maven-plugin + 1.2.1 + + true + defaults + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} - true + de.qaware.maven + go-offline-maven-plugin + 1.2.5 - - true - ossrh - https://oss.sonatype.org/ + + + org.apache.maven.surefire + surefire-junit4 + 2.20.1 + PLUGIN + + From 618111e0c0e02be528e1db85a31faeabe4f5e871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Fri, 7 Feb 2020 18:25:52 +0100 Subject: [PATCH 04/20] Fix circleci config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61c8384fc..9e0d897a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2 jobs: - - build: + build: docker: # specify the version you desire here - image: circleci/openjdk:8-jdk @@ -68,7 +68,7 @@ jobs: path: target/circleci-artifacts destination: dist - - deploy-release: + deploy-release: requires: - build filters: From 188d01bd2e1c4573f8611ec2825bc2366d773781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Fri, 7 Feb 2020 18:28:17 +0100 Subject: [PATCH 05/20] Fix circleci config more --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e0d897a8..d9610d2a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,5 +78,6 @@ jobs: ignore: /.*/ steps: - run: + name: Deploy to GitHub when: on_success command: mvn deploy -Drevision=$(echo "$CIRCLE_TAG" | cut -c 2-) -Dchangelist= -Dsha1= -Dregistry=https://maven.pkg.github.com/FacilityNet -Dtoken=$GITHUB_DEPLOY_TOKEN From 894bf3cced16a24eafb649f4bbd87cbc08e42aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 13:26:41 +0100 Subject: [PATCH 06/20] Add auto-deploy script --- .circleci/config.yml | 15 +++------------ .circleci/deploy.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 .circleci/deploy.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index d9610d2a3..4833bfa29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,16 +68,7 @@ jobs: path: target/circleci-artifacts destination: dist - deploy-release: - requires: - - build - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - steps: - run: - name: Deploy to GitHub - when: on_success - command: mvn deploy -Drevision=$(echo "$CIRCLE_TAG" | cut -c 2-) -Dchangelist= -Dsha1= -Dregistry=https://maven.pkg.github.com/FacilityNet -Dtoken=$GITHUB_DEPLOY_TOKEN + name: Deploy to Maven repository + when: on_success + command: ./.circleci/deploy.sh \ No newline at end of file diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh new file mode 100644 index 000000000..2a17c5cca --- /dev/null +++ b/.circleci/deploy.sh @@ -0,0 +1,37 @@ +if [ "$CIRCLECI" != "true" ]; then + echo "Not building on CircleCI, skip deploy" + exit -1 +fi + +if [ "$REGISTRY_URL" == "" ]; then + echo "Registry URL not set, skip deploy" + exit -2 +fi + +if [ "$DEPLOY_TOKEN" == "" ]; then + echo "No deploy token found, skip deploy" + exit -3 +fi + +#EXACT_TAG=$(git describe --exact-match --match "v*") +COMMITS_SINCE=$(git describe --match "v*" | cut -d "-" -s -f 2) + +# Revision is set to nearest tag of form vX.Y +REV=$(git describe --abbrev=0 --tags --match "v*" | cut -c 2-) + +CHANGE="" +if [ "$COMMITS_SINCE" != "" ]; then CHANGE=".$COMMITS_SINCE"; fi +if [ "$CIRCLE_PR_NUMBER" != "" ]; then + CHANGE="$CHANGE-PR$CIRCLE_PR_NUMBER" +fi + +SHA1="" + +if [ "$REV" = "" ] +then + echo "No valid version tag found, skip deploy" +else + echo "Deploying release $REV$CHANGE$SHA1 to GitHub Packages" + mvn deploy -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" -Dregistry="$REGISTRY_URL" -Dtoken="$DEPLOY_TOKEN" +fi + From 098e392c8967f00bb3f47022de67317b8a903584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 13:54:34 +0100 Subject: [PATCH 07/20] Correct circleci config --- .circleci/config.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4833bfa29..fd6e6ecc3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,20 +47,14 @@ jobs: command: | shopt -s nullglob mkdir -p target/circleci-test-reports - for f in */target/surefire-reports - do - PROJ=$(echo "$f" | cut -d "/" -f1) # find name of project folder - echo "Copy test reports from $f to target/circleci-test-reports/$PROJ" - mkdir "target/circleci-test-reports/$PROJ" - cp "$f"/*.xml "target/circleci-test-reports/$PROJ" - done + cp target/surefire-reports/*.xml target/circleci-test-reports - run: name: Collecting artifacts when: on_success command: | mkdir -p target/circleci-artifacts - cp */target/*.jar target/circleci-artifacts/ + cp target/*.jar target/circleci-artifacts/ - store_test_results: path: target/circleci-test-reports From d41c2ad7893ead319a39ebc59d431aefff1ef30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 13:58:39 +0100 Subject: [PATCH 08/20] Attempt to make script executable --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd6e6ecc3..738d40917 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,4 +65,6 @@ jobs: - run: name: Deploy to Maven repository when: on_success - command: ./.circleci/deploy.sh \ No newline at end of file + command: | + chmod a+x .circleci/deploy.sh + ./.circleci/deploy.sh From 9b376e55c905f9aafca11a6bd3fdb30e172f934f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 14:08:00 +0100 Subject: [PATCH 09/20] Fetch tags before using them --- .circleci/deploy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 2a17c5cca..bdc85f55d 100644 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -13,7 +13,11 @@ if [ "$DEPLOY_TOKEN" == "" ]; then exit -3 fi +# Ensure we have tags available locally +git fetch --tags + #EXACT_TAG=$(git describe --exact-match --match "v*") +# Find number of commits since latest version tag COMMITS_SINCE=$(git describe --match "v*" | cut -d "-" -s -f 2) # Revision is set to nearest tag of form vX.Y From 470855ca9b8cf64fa35a475ac028b36cb003196f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 15:50:13 +0100 Subject: [PATCH 10/20] Fix deploy URL and pw --- .circleci/deploy.sh | 10 +++++----- pom.xml | 8 ++++++++ shared-settings.xml | 10 ++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 shared-settings.xml diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index bdc85f55d..84255a9f1 100644 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -3,13 +3,13 @@ if [ "$CIRCLECI" != "true" ]; then exit -1 fi -if [ "$REGISTRY_URL" == "" ]; then - echo "Registry URL not set, skip deploy" +if [ "$DEPLOY_USERNAME" == "" ]; then + echo "Deploy username not set, skip deploy" exit -2 fi -if [ "$DEPLOY_TOKEN" == "" ]; then - echo "No deploy token found, skip deploy" +if [ "$DEPLOY_PASSWORD" == "" ]; then + echo "Deploy password not set, skip deploy" exit -3 fi @@ -36,6 +36,6 @@ then echo "No valid version tag found, skip deploy" else echo "Deploying release $REV$CHANGE$SHA1 to GitHub Packages" - mvn deploy -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" -Dregistry="$REGISTRY_URL" -Dtoken="$DEPLOY_TOKEN" + mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" fi diff --git a/pom.xml b/pom.xml index 7ade46c23..f416ac560 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,14 @@ scm:git:https://github.com/FacilityNet/ews-java-api.git + + + github + GitHub Packages + https://maven.pkg.github.com/facilitynet/ews-java-api + + + org.apache.httpcomponents diff --git a/shared-settings.xml b/shared-settings.xml new file mode 100644 index 000000000..b76e0d193 --- /dev/null +++ b/shared-settings.xml @@ -0,0 +1,10 @@ + + + + + github + ${env.DEPLOY_USERNAME} + ${env.DEPLOY_PASSWORD} + + + \ No newline at end of file From db82e9be53440dc78245aef4cebc472d8bb535b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Tue, 11 Feb 2020 16:05:39 +0100 Subject: [PATCH 11/20] Deploy failed --- .circleci/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 84255a9f1..e0709ecce 100644 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -36,6 +36,6 @@ then echo "No valid version tag found, skip deploy" else echo "Deploying release $REV$CHANGE$SHA1 to GitHub Packages" - mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" + DEPLOY_USERNAME=$DEPLOY_USERNAME DEPLOY_PASSWORD=$DEPLOY_PASSWORD mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" fi From d20fb927dc07b2d6dfe852bf37531d83f5f7a38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Thu, 13 Feb 2020 12:19:45 +0100 Subject: [PATCH 12/20] Try build with GH actions --- .circleci/deploy.sh | 2 +- .github/workflows/continuous-integration.yml | 37 ++++++++++++++++++++ pom.xml | 5 +++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index e0709ecce..4b9dc9f1b 100644 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -36,6 +36,6 @@ then echo "No valid version tag found, skip deploy" else echo "Deploying release $REV$CHANGE$SHA1 to GitHub Packages" - DEPLOY_USERNAME=$DEPLOY_USERNAME DEPLOY_PASSWORD=$DEPLOY_PASSWORD mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" + DEPLOY_USERNAME=$DEPLOY_USERNAME DEPLOY_PASSWORD=$DEPLOY_PASSWORD mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" -Dmaven.test.skip=true -Dmaven.site.skip=true fi diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 000000000..dedd467f7 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,37 @@ +name: continuous-integration + +on: [push, pull_request] + +jobs: + compile: + runs-on: ubuntu-latest +# strategy: +# matrix: +# java: [ 11, 12, 13 ] + name: maven-compile-test-deploy + steps: + - uses: actions/checkout@v2 + + - name: Fetch git tags + run: git fetch --tags + + - uses: FacilityNet/set-version@releases/v1 + id: set_version + + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Setup java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Publish to GitHub Packages + run: mvn deploy -Drevision=${{ format('{0}.{1}.{2}', steps.set_version.outputs.major, steps.set_version.outputs.minor, steps.set_version.outputs.patch) }} + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ github.token }} diff --git a/pom.xml b/pom.xml index f416ac560..ef060403d 100644 --- a/pom.xml +++ b/pom.xml @@ -312,6 +312,11 @@ + + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0-M1 + org.apache.maven.plugins maven-compiler-plugin From fa52281872e0805a2832d6fa3b454787cef1b15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Wed, 19 Feb 2020 14:34:58 +0100 Subject: [PATCH 13/20] Need to fetch full history to use set-version --- .github/workflows/continuous-integration.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dedd467f7..b5f62a183 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,9 +11,8 @@ jobs: name: maven-compile-test-deploy steps: - uses: actions/checkout@v2 - - - name: Fetch git tags - run: git fetch --tags + with: + fetch-depth: 0 # we need full history to use set-version below - uses: FacilityNet/set-version@releases/v1 id: set_version From d450b4fcce7023b4fc5d6e5f1b2aecc851cef311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Wed, 19 Feb 2020 15:10:46 +0100 Subject: [PATCH 14/20] Test out previous version of set-version --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b5f62a183..dfc5ae973 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 # we need full history to use set-version below - - uses: FacilityNet/set-version@releases/v1 + - uses: FacilityNet/set-version@17b116e id: set_version - uses: actions/cache@v1 From b06f9c231c8fbe82479364a3dd534b4477509428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Wed, 19 Feb 2020 18:30:05 +0100 Subject: [PATCH 15/20] Try out v1 again --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dfc5ae973..b5f62a183 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 # we need full history to use set-version below - - uses: FacilityNet/set-version@17b116e + - uses: FacilityNet/set-version@releases/v1 id: set_version - uses: actions/cache@v1 From d55e5b77860f607dfbaa435736958f37a936a7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Wed, 19 Feb 2020 18:37:30 +0100 Subject: [PATCH 16/20] Need to overwrite changelist and sha1 --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b5f62a183..f47878b68 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -30,7 +30,7 @@ jobs: java-version: 1.8 - name: Publish to GitHub Packages - run: mvn deploy -Drevision=${{ format('{0}.{1}.{2}', steps.set_version.outputs.major, steps.set_version.outputs.minor, steps.set_version.outputs.patch) }} + run: mvn deploy -Drevision=${{ format('{0}.{1}.{2}', steps.set_version.outputs.major, steps.set_version.outputs.minor, steps.set_version.outputs.patch) }} -Dchangelist= -Dsha1= env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ github.token }} From c7f387cbf0990b6bbdcd7d61f2ce12b1c82f9c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Thu, 20 Feb 2020 11:27:19 +0100 Subject: [PATCH 17/20] Now with pre-release version from pull request --- .github/workflows/continuous-integration.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f47878b68..83eda8d0a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,8 +14,11 @@ jobs: with: fetch-depth: 0 # we need full history to use set-version below - - uses: FacilityNet/set-version@releases/v1 + - uses: FacilityNet/set-version@v1 id: set_version + with: + eventName: ${{ github.event_name }} + event: ${{ toJSON(github.event) }} - uses: actions/cache@v1 with: @@ -30,7 +33,7 @@ jobs: java-version: 1.8 - name: Publish to GitHub Packages - run: mvn deploy -Drevision=${{ format('{0}.{1}.{2}', steps.set_version.outputs.major, steps.set_version.outputs.minor, steps.set_version.outputs.patch) }} -Dchangelist= -Dsha1= + run: mvn deploy -Drevision=${{ steps.set_version.outputs.fullNoMeta }} -Dchangelist= -Dsha1= env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ github.token }} From c3dd901a4cfc6f1677a0d569a9ac392d46b918f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Thu, 20 Feb 2020 13:10:54 +0100 Subject: [PATCH 18/20] Force build --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 83eda8d0a..0090c0a3c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -37,3 +37,4 @@ jobs: env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ github.token }} + From 49472d5126e11a9f8b03067d5fe299280588b086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Thu, 20 Feb 2020 13:29:06 +0100 Subject: [PATCH 19/20] Force build --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0090c0a3c..83eda8d0a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -37,4 +37,3 @@ jobs: env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ github.token }} - From 4b7b704bf637a2f73f666061ac1a74f5d6d8650c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Boisen?= Date: Thu, 20 Feb 2020 13:40:39 +0100 Subject: [PATCH 20/20] Remove unneeded build files --- .circleci/config.yml | 70 -------------------------------------------- .circleci/deploy.sh | 41 -------------------------- shared-settings.xml | 10 ------- 3 files changed, 121 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/deploy.sh delete mode 100644 shared-settings.xml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 738d40917..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,70 +0,0 @@ -# Java Maven CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-java/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/openjdk:8-jdk - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - environment: - # Customize the JVM maximum heap limit - MAVEN_OPTS: -Xmx3200m - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "pom.xml" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: mvn --version - - run: mvn dependency:go-offline - - - save_cache: - paths: - - ~/.m2 - key: v1-dependencies-{{ checksum "pom.xml" }} - - # run tests! - - run: mvn integration-test - - - run: - name: Collecting test reports - when: always - command: | - shopt -s nullglob - mkdir -p target/circleci-test-reports - cp target/surefire-reports/*.xml target/circleci-test-reports - - - run: - name: Collecting artifacts - when: on_success - command: | - mkdir -p target/circleci-artifacts - cp target/*.jar target/circleci-artifacts/ - - - store_test_results: - path: target/circleci-test-reports - - store_artifacts: - path: target/circleci-artifacts - destination: dist - - - run: - name: Deploy to Maven repository - when: on_success - command: | - chmod a+x .circleci/deploy.sh - ./.circleci/deploy.sh diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh deleted file mode 100644 index 4b9dc9f1b..000000000 --- a/.circleci/deploy.sh +++ /dev/null @@ -1,41 +0,0 @@ -if [ "$CIRCLECI" != "true" ]; then - echo "Not building on CircleCI, skip deploy" - exit -1 -fi - -if [ "$DEPLOY_USERNAME" == "" ]; then - echo "Deploy username not set, skip deploy" - exit -2 -fi - -if [ "$DEPLOY_PASSWORD" == "" ]; then - echo "Deploy password not set, skip deploy" - exit -3 -fi - -# Ensure we have tags available locally -git fetch --tags - -#EXACT_TAG=$(git describe --exact-match --match "v*") -# Find number of commits since latest version tag -COMMITS_SINCE=$(git describe --match "v*" | cut -d "-" -s -f 2) - -# Revision is set to nearest tag of form vX.Y -REV=$(git describe --abbrev=0 --tags --match "v*" | cut -c 2-) - -CHANGE="" -if [ "$COMMITS_SINCE" != "" ]; then CHANGE=".$COMMITS_SINCE"; fi -if [ "$CIRCLE_PR_NUMBER" != "" ]; then - CHANGE="$CHANGE-PR$CIRCLE_PR_NUMBER" -fi - -SHA1="" - -if [ "$REV" = "" ] -then - echo "No valid version tag found, skip deploy" -else - echo "Deploying release $REV$CHANGE$SHA1 to GitHub Packages" - DEPLOY_USERNAME=$DEPLOY_USERNAME DEPLOY_PASSWORD=$DEPLOY_PASSWORD mvn deploy -s shared-settings.xml -Drevision="$REV" -Dchangelist="$CHANGE" -Dsha1="$SHA1" -Dmaven.test.skip=true -Dmaven.site.skip=true -fi - diff --git a/shared-settings.xml b/shared-settings.xml deleted file mode 100644 index b76e0d193..000000000 --- a/shared-settings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - github - ${env.DEPLOY_USERNAME} - ${env.DEPLOY_PASSWORD} - - - \ No newline at end of file