diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..24580668f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,76 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "Release" + +on: + push: + branches: + - 'release-*' + +env: + JAVA_VERSION: '11' + JAVA_DISTRO: 'temurin' + MAVEN_ARGS: | + -B -e + -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 + -Dmaven.wagon.http.retryHandler.count=3 + -Djdk.toolchain.version=${JAVA_VERSION} + +concurrency: + group: release-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + create-tag: + runs-on: ubuntu-20.04 + environment: release + outputs: + tag: ${{ steps.create-tag.outputs.tag }} + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }} + - name: Set up JDK + uses: actions/setup-java@v3.11.0 + with: + distribution: ${{ env.JAVA_DISTRO }} + java-version: ${{ env.JAVA_VERSION }} + - id: create-tag + run: ./etc/scripts/release.sh create_tag >> "${GITHUB_OUTPUT}" + validate: + needs: create-tag + uses: ./.github/workflows/validate.yml + with: + ref: ${{ needs.create-tag.outputs.tag }} + release: + needs: [ create-tag, validate ] + runs-on: ubuntu-20.04 + timeout-minutes: 30 + environment: release + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ needs.create-tag.outputs.tag }} + - uses: actions/setup-java@v3.6.0 + with: + distribution: ${{ env.JAVA_DISTRO }} + java-version: ${{ env.JAVA_VERSION }} + cache: maven + - env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }} + run: etc/scripts/release.sh release_build diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ee7f24a2e..0d29c5da5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,14 +1,41 @@ -name: "Validate PR" +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -on: [pull_request, push, workflow_dispatch] +name: "Validate" + +on: + pull_request: + push: + workflow_call: + inputs: + ref: + description: The branch, tag or SHA to checkout + required: false + type: string + default: '' env: JAVA_VERSION: '11' JAVA_DISTRO: 'temurin' GRAALVM_VERSION: '20.2.0' GRAALVM_COMPONENTS: 'native-image' - HELIDON_PIPELINES: 'true' - MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3' + MAVEN_ARGS: | + -B -fae -e + -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 + -Dmaven.wagon.http.retryHandler.count=3 + -Djdk.toolchain.version=${JAVA_VERSION} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -21,72 +48,75 @@ jobs: steps: - uses: actions/checkout@v3 with: + ref: ${{ inputs.ref }} fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3.6.0 + - uses: actions/setup-java@v3.6.0 with: distribution: ${{ env.JAVA_DISTRO }} java-version: ${{ env.JAVA_VERSION }} cache: maven - - name: Copyright - run: etc/scripts/copyright.sh + - run: etc/scripts/copyright.sh checkstyle: timeout-minutes: 10 runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3.6.0 + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-java@v3.6.0 with: distribution: ${{ env.JAVA_DISTRO }} java-version: ${{ env.JAVA_VERSION }} cache: maven - - name: Checkstyle - run: etc/scripts/checkstyle.sh + - run: etc/scripts/checkstyle.sh spotbugs: timeout-minutes: 30 runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3.6.0 + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-java@v3.6.0 with: distribution: ${{ env.JAVA_DISTRO }} java-version: ${{ env.JAVA_VERSION }} cache: maven - - name: Spotbugs - run: etc/scripts/spotbugs.sh + - run: | + mvn ${MAVEN_ARGS} -T 8 \ + verify \ + -DskipTests \ + --fail-at-end \ + -Pspotbugs build: timeout-minutes: 60 strategy: matrix: os: [ ubuntu-20.04,windows-2019 ] - include: - - os: ubuntu-20.04 - build_script: etc/scripts/build.sh - - os: windows-2019 - build_script: etc/scripts/build.bat runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Set up Java 11 + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-java@v3.6.0 if: matrix.os == 'ubuntu-20.04' - uses: actions/setup-java@v3.6.0 with: distribution: ${{ env.JAVA_DISTRO }} java-version: ${{ env.JAVA_VERSION }} cache: maven - - name: Set up Java 11 + - uses: graalvm/setup-graalvm@v1 if: matrix.os == 'windows-2019' - uses: graalvm/setup-graalvm@v1 with: version: ${{ env.GRAALVM_VERSION }} java-version: ${{ env.JAVA_VERSION }} components: ${{ env.GRAALVM_COMPONENTS }} github-token: ${{ secrets.GITHUB_TOKEN }} cache: maven - - name: Maven build - run: ${{ matrix.build_script }} + - run: | + mvn ${MAVEN_ARGS} -T 8 \ + clean install \ + --fail-at-end \ + -Dmaven.test.failure.ignore=true + shell: bash - name: Archive test results uses: actions/upload-artifact@v3.1.2 with: diff --git a/.mvn/jvm.config b/.mvn/jvm.config new file mode 100644 index 000000000..e69de29bb diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index d26ae9733..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -pipeline { - agent { - label "linux" - } - options { - parallelsAlwaysFailFast() - } - stages { - stage('release') { - when { - branch '**/release-*' - } - stages { - stage('build') { - environment { - GITHUB_SSH_KEY = credentials('helidonrobot-github-ssh-private-key') - MAVEN_SETTINGS_FILE = credentials('helidonrobot-maven-settings-ossrh') - GPG_PUBLIC_KEY = credentials('helidon-gpg-public-key') - GPG_PRIVATE_KEY = credentials('helidon-gpg-private-key') - GPG_PASSPHRASE = credentials('helidon-gpg-passphrase') - } - steps { - sh './etc/scripts/release.sh release_build' - } - } - stage('cli-native') { - parallel { - stage('cli-linux') { - steps { - sh './etc/scripts/build-cli.sh --release' - archiveArtifacts artifacts: "helidon-cli/impl/target/helidon" - } - } - stage('cli-windows') { - agent { - label "windows" - } - steps { - bat './etc/scripts/build-cli.bat /release' - archiveArtifacts artifacts: "helidon-cli/impl/target/helidon.exe" - } - } - } - } - } - } - } -} diff --git a/README.md b/README.md index f211065e6..0a8471fd9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The Helidon Build Tools version is aligned with the Helidon `major.minor` versio ## Build -You will need Java 11 and Maven 3.6.3 or newer. +You will need Java 11 and Maven 3.8.2 or newer. **Full build** ```bash diff --git a/build-cache-maven-plugin/pom.xml b/build-cache-maven-plugin/pom.xml index a2ab2adfb..73ea2bcbf 100644 --- a/build-cache-maven-plugin/pom.xml +++ b/build-cache-maven-plugin/pom.xml @@ -1,7 +1,7 @@ - ${top.parent.basedir} + ${maven.multiModuleProjectDirectory} META-INF/ LICENSE.txt @@ -875,9 +859,10 @@ validate - ${top.parent.basedir}/etc/checkstyle.xml + ${maven.multiModuleProjectDirectory}/etc/checkstyle.xml - ${top.parent.basedir}/etc/checkstyle-suppressions.xml + + ${maven.multiModuleProjectDirectory}/etc/checkstyle-suppressions.xml @@ -891,34 +876,28 @@ - org.glassfish.copyright - glassfish-copyright-maven-plugin + io.helidon.build-tools + helidon-enforcer-plugin + 2.3.7 + + + copyright + + + true + + ${maven.multiModuleProjectDirectory}/etc/copyright.txt + + ${maven.multiModuleProjectDirectory}/etc/copyright-exclude.txt + + - print-copyright - - copyright - + helidon-enforcer validate - - - ${top.parent.basedir}/etc/copyright.txt - - ${top.parent.basedir}/etc/copyright-exclude.txt - - - - check-copyright check - validate - - - ${top.parent.basedir}/etc/copyright.txt - - ${top.parent.basedir}/etc/copyright-exclude.txt - diff --git a/services-maven-plugin/pom.xml b/services-maven-plugin/pom.xml index f7870b41c..793dbdc11 100644 --- a/services-maven-plugin/pom.xml +++ b/services-maven-plugin/pom.xml @@ -1,7 +1,7 @@ diff --git a/utils/pom.xml b/utils/pom.xml index 1d72ca501..14c8cb95a 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -1,7 +1,7 @@