diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b76b895..1230149 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,5 @@ version: 2 updates: - - package-ecosystem: "maven" - directory: "/" - schedule: - interval: "daily" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml new file mode 100644 index 0000000..bf4535b --- /dev/null +++ b/.github/workflows/maven-deploy.yml @@ -0,0 +1,74 @@ +name: Deploy + +# clare all permissions for GITHUB_TOKEN +permissions: {} + +on: + workflow_call: + inputs: + maven-version: + description: 'The Maven version used during build job' + required: false + default: '3.9.9' + type: string + + jdk-version: + description: 'jdk version for build' + required: false + default: '21' + type: string + + jdk-distribution: + description: 'jdk distribution for build' + required: false + default: 'temurin' + type: string + + branch-to-deploy: + description: 'Git branch name' + required: false + default: 'refs/heads/master' + type: string + +# allow single build +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + deploy: + name: Deploy + + if: | + github.event_name == 'push' && + github.repository_owner == 'codehaus-plexus' && + github.ref == inputs.branch-to-deploy && + !startsWith(github.event.head_commit.message , '[maven-release-plugin] prepare release') + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ inputs.jdk-version }} + distribution: ${{ inputs.jdk-distribution }} + cache: 'maven' + server-id: sonatype-central-portal + server-username: MAVEN_DEPLOY_UID + server-password: MAVEN_DEPLOY_PWD + + - name: Set up Maven + run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}" + + - name: Publish Snapshot + run: echo "deploy skipped temporally" +# run: ./mvnw -e -B -V deploy -DskipTests + env: + MAVEN_DEPLOY_UID: ${{ secrets.MAVEN_DEPLOY_UID }} + MAVEN_DEPLOY_PWD: ${{ secrets.MAVEN_DEPLOY_PWD }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b66a77c..0d2d054 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,21 +21,27 @@ on: workflow_call: inputs: maven_args: - description: The arguments to pass to Maven when building the code + description: 'The arguments to pass to Maven when building the code' required: false - default: --batch-mode --errors --show-version verify javadoc:javadoc + default: '--batch-mode --errors --show-version verify javadoc:javadoc' + type: string + + maven-version: + description: 'The Maven version used during build job' + required: false + default: '3.9.9' type: string os-matrix: description: 'os matrix as json array' required: false - default: '[ "ubuntu-latest", "windows-latest", "macOS-latest" ]' + default: '[ "ubuntu-latest", "windows-latest", "macos-latest" ]' type: string jdk-matrix: description: 'jdk matrix as json array' required: false - default: '[ "8", "11", "17", "20" ]' + default: '[ "24", "21", "8" ]' type: string matrix-exclude: @@ -44,44 +50,60 @@ on: default: '[]' type: string + matrix-include: + description: 'include for matrix as json' + required: false + default: '[]' + type: string + jdk-distribution-matrix: - description: "jdk distribution matrix" + description: 'jdk distribution matrix' required: false default: '[ "zulu" ]' type: string - + jdk-fast-fail-build: - description: "jdk fast fail build" + description: 'jdk fast fail build' required: false - default: '17' - type: string + default: '21' + type: string + + jdk-distribution-fast-fail-build: + description: 'jdk distribution fast fail build' + required: false + default: 'zulu' + type: string jobs: build: name: fail-fast-build runs-on: ubuntu-latest - if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} + # execute on any push or pull request from forked repo + if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork ) + steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ inputs.jdk-fast-fail-build }} - distribution: 'zulu' + distribution: ${{ inputs.jdk-distribution-fast-fail-build }} cache: 'maven' + - name: Set up Maven + run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}" + - name: Build with Maven - run: mvn ${{ inputs.maven_args }} + run: ./mvnw ${{ inputs.maven_args }} verify: needs: build name: ${{ matrix.os }} jdk-${{ matrix.jdk }}-${{ matrix.distribution }} runs-on: ${{ matrix.os }} - if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} strategy: fail-fast: true matrix: @@ -89,18 +111,22 @@ jobs: jdk: ${{ fromJSON( inputs.jdk-matrix ) }} distribution: ${{ fromJSON( inputs.jdk-distribution-matrix ) }} exclude: ${{ fromJSON( inputs.matrix-exclude ) }} + include: ${{ fromJSON( inputs.matrix-include ) }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} distribution: ${{ matrix.distribution }} cache: 'maven' + - name: Set up Maven + run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}" + - name: Build with Maven - run: mvn ${{ inputs.maven_args }} + run: ./mvnw ${{ inputs.maven_args }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 30fd0da..825ed38 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -6,6 +6,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index bff2d76..4a60582 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.iml +.idea diff --git a/README.md b/README.md index ba6b51a..6c8289a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,18 @@ Excludes from build matrix: ] ``` +Includes to build matrix: + +```yaml +... + uses: codehaus-plexus/.github/.github/workflows/maven.yml@master (or tag) + with: + matrix-include: > + [ + {"jdk": "24-ea", "os": "ubuntu-latest", distribution: "temurin" } # include latest Java 24-ea on Ubuntu + ] +``` + # Usage release-drafter To have the github release filled with Pull request content diff --git a/profile/README.md b/profile/README.md new file mode 100644 index 0000000..fcb247a --- /dev/null +++ b/profile/README.md @@ -0,0 +1,12 @@ +## Hi there 👋 +It's All the Plexus code here from the old good Codehaus +