From a32d06d52d995cfa77f9b56e81d5611282c35e78 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:02:24 +0200 Subject: [PATCH 01/19] Create checkBuild.yml --- .github/workflows/checkBuild.yml | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/checkBuild.yml diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml new file mode 100644 index 0000000..1eca0f7 --- /dev/null +++ b/.github/workflows/checkBuild.yml @@ -0,0 +1,55 @@ +name: Check Build + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + pull_request: + branches: [ develop ] + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '8' + java-package: jdk+fx + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean verify + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + exit 1 + fi From 48e30c707b1974c7b9b5be47bc87d6be075ebcf9 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:03:56 +0200 Subject: [PATCH 02/19] Create dependabot.yml --- .github/dependabot.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..58473bc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "0:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "*" + # GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed + update-types: + - "version-update:semver-minor" + - "version-update:semver-patch" +- package-ecosystem: maven + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "0:00" + open-pull-requests-limit: 10 From 5cd8ad192c55592fe4abdcbb2bc925c0a0e00c23 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:04:58 +0200 Subject: [PATCH 03/19] Update dependabot.yml --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 58473bc..28d6d7b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ updates: schedule: interval: daily # Run it at a specific time so that we don't get emails all day long - time: "0:00" + time: "00:00" open-pull-requests-limit: 10 ignore: - dependency-name: "*" @@ -18,5 +18,5 @@ updates: schedule: interval: daily # Run it at a specific time so that we don't get emails all day long - time: "0:00" + time: "00:00" open-pull-requests-limit: 10 From 2e22a62b16007a161f2ff9f9f20a29a010550833 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:36:35 +0200 Subject: [PATCH 04/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 60 +++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 1eca0f7..6613c51 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -14,7 +14,7 @@ on: jobs: build: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v2 @@ -53,3 +53,61 @@ jobs: echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" exit 1 fi + + build_lts: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11, 17] + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + java-package: jdk+fx + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean verify -P ${{ matrix.java }} + + - name: Debug + run: ls -lha target + + build_xdev_ide: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '8' + java-package: jdk+fx + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean verify -Pxdev-ide + + - name: Debug + run: ls -lha target From 0da2209c52c8716701e508783a42793bcd67bafe Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:39:39 +0200 Subject: [PATCH 05/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 45 ++++++++------------------------ 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 6613c51..69e29cd 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -12,9 +12,13 @@ on: - '**.md' jobs: - build: + build_lts: runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] #, 17] + steps: - uses: actions/checkout@v2 @@ -22,7 +26,7 @@ jobs: uses: actions/setup-java@v2 with: distribution: 'zulu' - java-version: '8' + java-version: ${{ matrix.java }} java-package: jdk+fx - name: Cache local Maven repository @@ -34,7 +38,10 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven - run: mvn -B clean verify + run: mvn -B clean verify -P ${{ matrix.java }} + + - name: Debug + run: ls -lha target - name: Check for uncommited changes run: | @@ -54,36 +61,6 @@ jobs: exit 1 fi - build_lts: - runs-on: ubuntu-latest - - strategy: - matrix: - java: [8, 11, 17] - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 8 - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: ${{ matrix.java }} - java-package: jdk+fx - - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Build with Maven - run: mvn -B clean verify -P ${{ matrix.java }} - - - name: Debug - run: ls -lha target build_xdev_ide: runs-on: ubuntu-latest @@ -107,7 +84,7 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven - run: mvn -B clean verify -Pxdev-ide + run: mvn -B clean verify -Pjava8,xdev-ide - name: Debug run: ls -lha target From 61a09e1cb6dba630137e6230182a684120794aea Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:41:18 +0200 Subject: [PATCH 06/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 69e29cd..aa41a77 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 8 + - name: Set up JDK uses: actions/setup-java@v2 with: distribution: 'zulu' @@ -38,7 +38,7 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven - run: mvn -B clean verify -P ${{ matrix.java }} + run: mvn -B clean verify -P java${{ matrix.java }} - name: Debug run: ls -lha target @@ -68,7 +68,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 8 + - name: Set up JDK uses: actions/setup-java@v2 with: distribution: 'zulu' From c3f5a805c9686b6c84ae51e23d87f2cbce6725b4 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:47:38 +0200 Subject: [PATCH 07/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index aa41a77..72a8404 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -60,7 +60,11 @@ jobs: echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" exit 1 fi - + + - uses: actions/upload-artifact@v2 + with: + name: jars-lts-${{ matrix.java }} + path: target/*.jar build_xdev_ide: runs-on: ubuntu-latest @@ -86,5 +90,7 @@ jobs: - name: Build with Maven run: mvn -B clean verify -Pjava8,xdev-ide - - name: Debug - run: ls -lha target + - uses: actions/upload-artifact@v2 + with: + name: jars-xdev-ide + path: target/*.jar From e109911be6fb20ae9476337c323b5933976e7b3e Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:11:58 +0200 Subject: [PATCH 08/19] Update pom.xml Using - instead of _ --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 41bf200..bf8f72f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.xdev-software xapi-fx - 1.0.0_${version.suffix}-SNAPSHOT + 1.0.0-${version.suffix}-SNAPSHOT jar XDEV Application Framework JavaFX @@ -405,4 +405,4 @@ - \ No newline at end of file + From 72231d1ed0795ec3a008b4abfe2bfca7f9f85f01 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:22:35 +0200 Subject: [PATCH 09/19] Update checkBuild.yml Removed debug --- .github/workflows/checkBuild.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 72a8404..9dc879a 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -40,9 +40,6 @@ jobs: - name: Build with Maven run: mvn -B clean verify -P java${{ matrix.java }} - - name: Debug - run: ls -lha target - - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then From 8fbdb6da86730637c19f9007a23ccc50aff50bde Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:23:01 +0200 Subject: [PATCH 10/19] Create test-deploy.yml --- .github/workflows/test-deploy.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test-deploy.yml diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..29e444a --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,34 @@ +name: Test Deployment CI + +on: + workflow_dispatch: + +jobs: + publish_central: # Publish the code to central + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11] #, 17] + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK and configure for ossrh + uses: actions/setup-java@v2 + with: # running setup-java again overwrites the settings.xml + distribution: 'zulu' + java-version: ${{ matrix.java }} + java-package: jdk+fx + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to Apache Maven Central + run: mvn -B deploy -Possrh,java${{ matrix.java }} + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} From 7946b541bd0f036602215863723eab9ad4beb1dd Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:12:42 +0200 Subject: [PATCH 11/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 9dc879a..1b6e68d 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -17,7 +17,14 @@ jobs: strategy: matrix: - java: [8, 11] #, 17] + java: [11, 17-ea] + java-package: [jdk] + distribution: [adopt] + # When building Java 8 we need JavaFX on JDK basis + include: + - java: 8 + java-package: jdk+fx + distribution: zulu steps: - uses: actions/checkout@v2 @@ -25,9 +32,9 @@ jobs: - name: Set up JDK uses: actions/setup-java@v2 with: - distribution: 'zulu' + distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - java-package: jdk+fx + java-package: ${{ matrix.java-package }} - name: Cache local Maven repository uses: actions/cache@v2 From ca4168a12088f1eb23f0ae2fd0dbc576e811d01f Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:28:07 +0200 Subject: [PATCH 12/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 1b6e68d..4133589 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -20,8 +20,8 @@ jobs: java: [11, 17-ea] java-package: [jdk] distribution: [adopt] - # When building Java 8 we need JavaFX on JDK basis include: + # When building Java 8 we need JavaFX on JDK basis - java: 8 java-package: jdk+fx distribution: zulu @@ -43,9 +43,16 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- + + # Required to map 17-ea to 17 + # cut away early access and other stuff + - name: Determine build profile java + id: determine_bp_java + run: | + echo "::set-output name=version::$(echo ${{ matrix.java }} | | sed 's/[^0-9]*//g')" - name: Build with Maven - run: mvn -B clean verify -P java${{ matrix.java }} + run: mvn -B clean verify -P java${{ steps.determine_bp_java.outputs.version }} - name: Check for uncommited changes run: | From 3cd12e71e6123da1d5ba39b0342acb667caa65d3 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:32:15 +0200 Subject: [PATCH 13/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 4133589..79b3f4e 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -49,7 +49,7 @@ jobs: - name: Determine build profile java id: determine_bp_java run: | - echo "::set-output name=version::$(echo ${{ matrix.java }} | | sed 's/[^0-9]*//g')" + echo "::set-output name=version::$(echo ${{ matrix.java }} | sed 's/[^0-9]*//g')" - name: Build with Maven run: mvn -B clean verify -P java${{ steps.determine_bp_java.outputs.version }} From 66ac71a88e395d5cc81602caebb9302c4e4a5c0f Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:36:37 +0200 Subject: [PATCH 14/19] Update test-deploy.yml --- .github/workflows/test-deploy.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 29e444a..7d8fc6e 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -9,7 +9,14 @@ jobs: strategy: matrix: - java: [8, 11] #, 17] + java: [11, 17-ea] + java-package: [jdk] + distribution: [adopt] + include: + # When building Java 8 we need JavaFX on JDK basis + - java: 8 + java-package: jdk+fx + distribution: zulu steps: - uses: actions/checkout@v2 @@ -17,17 +24,24 @@ jobs: - name: Set up JDK and configure for ossrh uses: actions/setup-java@v2 with: # running setup-java again overwrites the settings.xml - distribution: 'zulu' + distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - java-package: jdk+fx + java-package: ${{ matrix.java-package }} server-id: ossrh server-username: MAVEN_CENTRAL_USERNAME server-password: MAVEN_CENTRAL_TOKEN gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + # Required to map 17-ea to 17 + # cut away early access and other stuff + - name: Determine build profile java + id: determine_bp_java + run: | + echo "::set-output name=version::$(echo ${{ matrix.java }} | sed 's/[^0-9]*//g')" - name: Publish to Apache Maven Central - run: mvn -B deploy -Possrh,java${{ matrix.java }} + run: mvn -B deploy -Possrh,java${{ steps.determine_bp_java.outputs.version }} env: MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} From 7067ef7a67b2713a472be3c87f050a3b4c372451 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:50:04 +0200 Subject: [PATCH 15/19] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 79b3f4e..0259de3 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - java: [11, 17-ea] + java: [11] #, 17-ea] java-package: [jdk] distribution: [adopt] include: @@ -43,16 +43,9 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - # Required to map 17-ea to 17 - # cut away early access and other stuff - - name: Determine build profile java - id: determine_bp_java - run: | - echo "::set-output name=version::$(echo ${{ matrix.java }} | sed 's/[^0-9]*//g')" - name: Build with Maven - run: mvn -B clean verify -P java${{ steps.determine_bp_java.outputs.version }} + run: mvn -B clean verify -P java${{ matrix.java }} - name: Check for uncommited changes run: | From 32cb182ccc4ba55b9b8751ccecefbf0f66a9ec00 Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 10 Aug 2021 15:50:44 +0200 Subject: [PATCH 16/19] Update test-deploy.yml --- .github/workflows/test-deploy.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 7d8fc6e..fab6856 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -1,4 +1,4 @@ -name: Test Deployment CI +name: Test Deployment on: workflow_dispatch: @@ -9,7 +9,7 @@ jobs: strategy: matrix: - java: [11, 17-ea] + java: [11] #, 17-ea] java-package: [jdk] distribution: [adopt] include: @@ -32,16 +32,9 @@ jobs: server-password: MAVEN_CENTRAL_TOKEN gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - - # Required to map 17-ea to 17 - # cut away early access and other stuff - - name: Determine build profile java - id: determine_bp_java - run: | - echo "::set-output name=version::$(echo ${{ matrix.java }} | sed 's/[^0-9]*//g')" - name: Publish to Apache Maven Central - run: mvn -B deploy -Possrh,java${{ steps.determine_bp_java.outputs.version }} + run: mvn -B deploy -Possrh,java${{ matrix.java }} env: MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} From 16c89cb19308ed4316fae4d8d74863b0028f7ef7 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 10 Aug 2021 17:23:47 +0200 Subject: [PATCH 17/19] Removed active by default so that the release-ci works --- pom.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pom.xml b/pom.xml index bf8f72f..ac13979 100644 --- a/pom.xml +++ b/pom.xml @@ -263,9 +263,6 @@ java8 - - true - [1.8,9) java8 From e9983a9012905c6aeec3e626a651b001941c950f Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Wed, 11 Aug 2021 09:36:53 +0200 Subject: [PATCH 18/19] Added release workflow --- .github/workflows/release.yml | 282 ++++++++++++++++++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..14510fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,282 @@ +name: Release + +on: + push: + branches: [ master ] + +jobs: + check_code: # Validates the code (see checkBuild.yml) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '8' + java-package: jdk+fx + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean verify -Pjava8 + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + exit 1 + fi + + prepare_release: + runs-on: ubuntu-latest + needs: [check_code] + outputs: + upload_url: ${{ steps.create_draft.outputs.upload_url }} + steps: + - uses: actions/checkout@v2 + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Un-SNAP + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + + - name: Get version + id: version + # Ignores the suffix + run: | + read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + parts=(${read_version//-/ }) + echo "::set-output name=release::${parts[0]}" + + - name: Commit and Push + run: | + git add -A + git commit -m "Release ${{ steps.version.outputs.release }}" + git push origin + git tag v${{ steps.version.outputs.release }} + git push origin --tags + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.version.outputs.release }} + release_name: v${{ steps.version.outputs.release }} + commitish: master + body: | + ## Installation [![Maven Central](https://img.shields.io/maven-central/v/com.xdev-software/xapi-fx?versionPrefix=${{ steps.version.outputs.release }})](https://mvnrepository.com/artifact/com.xdev-software/xapi-fx) + Add the following lines to your pom: + ```XML + + com.xdev-software + xapi-fx + ${{ steps.version.outputs.release }}-java + + ``` + draft: false + prerelease: false + + publish_central: # Publish the code to central + runs-on: ubuntu-latest + needs: [prepare_release] + strategy: + matrix: + java: [11] #, 17] + java-package: [jdk] + distribution: [adopt] + include: + # When building Java 8 we need JavaFX on JDK basis + - java: 8 + java-package: jdk+fx + distribution: zulu + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK and configure for ossrh + uses: actions/setup-java@v2 + with: # running setup-java again overwrites the settings.xml + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + java-package: ${{ matrix.java-package }} + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to Apache Maven Central + run: mvn -B deploy -Possrh,java${{ matrix.java }} + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + publish-pages: + # Java 8-variant has no dependencies + name: Publish dependencies and licenses to github pages (Java 11) + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + java-package: jdk + + - name: Restore - Maven Cache + uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven-: + + - name: Build dependencies/licenses files + run: mvn -B project-info-reports:dependencies -Pjava8 + + - name: Upload licenses - Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: dependencies-licenses + path: target/site + + - name: Generate docs/dependencies dir + run: mkdir -p docs/dependencies + + - name: Move built files into docs/dependencies + run: mv target/site/* docs/dependencies + + - name: Rename dependencies.html to index.html + working-directory: docs/dependencies + run: mv dependencies.html index.html + + - name: Copy Readme into docs (as index.md) + run: cp README.md docs/index.md + + - name: Configure Pages + working-directory: docs + run: |- + echo "theme: jekyll-theme-tactile" > _config.yml + + - name: Deploy to Github pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + enable_jekyll: true + + build_xdev_ide: + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '8' + java-package: jdk+fx + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean verify -Pjava8,xdev-ide + + - uses: actions/upload-artifact@v2 + with: + name: jars-xdev-ide + path: target/*.jar + + after_release: + runs-on: ubuntu-latest + needs: [publish_central, build_xdev_ide] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Inc Version and SNAP root + # The versions plugin doesn't work that easily with maven so there are some workarounds + run: | + echo "Setting version without suffix" + read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + parts=(${read_version//-/ }) + mvn versions:set -DnewVersion=${parts[0]} -DgenerateBackupPoms=false + + echo "Incrementing version and set snapshot" + mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false + + echo "Set version with suffix" + read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + parts=(${read_version//-/ }) + mvn versions:set -DnewVersion="${parts[0]}-{version.suffix}-${parts[1]}" -DgenerateBackupPoms=false + + - name: Git Commit and Push + run: | + git add -A + git commit -m "Preparing for next development iteration" + git push origin + + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + destination_branch: "develop" + pr_title: "Sync back" + pr_body: "An automated PR to sync changes back" From d633df8af6927de9591945e4ff23273132d8100f Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 11 Aug 2021 09:50:16 +0200 Subject: [PATCH 19/19] Revert "Removed active by default so that the release-ci works" This reverts commit 16c89cb19308ed4316fae4d8d74863b0028f7ef7. --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index ac13979..bf8f72f 100644 --- a/pom.xml +++ b/pom.xml @@ -263,6 +263,9 @@ java8 + + true + [1.8,9) java8