build: update project configuration #315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com) | |
# SPDX-FileContributor: Sebastian Thomschke (Vegard IT GmbH) | |
# SPDX-License-Identifier: Apache-2.0 | |
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/depcheck-maven-plugin | |
# | |
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions | |
name: Build | |
on: | |
schedule: | |
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows | |
- cron: "0 15 1 * *" | |
push: | |
branches-ignore: # build all branches except: | |
- "dependabot/**" # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR) | |
tags-ignore: # don't build tags | |
- "**" | |
paths-ignore: | |
- ".act*" | |
- "**/*.adoc" | |
- "**/*.md" | |
- ".editorconfig" | |
- ".git*" | |
- ".github/*.yml" | |
- ".github/ISSUE_TEMPLATE/*" | |
- ".github/workflows/stale.yml" | |
- "codecov.yml" | |
pull_request: | |
paths-ignore: | |
- ".act*" | |
- "**/*.adoc" | |
- "**/*.md" | |
- ".editorconfig" | |
- ".git*" | |
- ".github/*.yml" | |
- ".github/ISSUE_TEMPLATE/*" | |
- ".github/workflows/stale.yml" | |
- "codecov.yml" | |
workflow_dispatch: | |
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch | |
inputs: | |
extra-maven-args: | |
description: "Additional command-line arguments to append to all Maven invocations" | |
required: false | |
default: "" | |
debug-with-ssh: | |
description: "Start an SSH session for debugging purposes at the end of the build:" | |
default: never | |
type: choice | |
options: [ always, on_failure, on_failure_or_cancelled, never ] | |
debug-with-ssh-only-for-actor: | |
description: "Limit access to the SSH session to the GitHub user that triggered the job." | |
default: true | |
type: boolean | |
debug-with-ssh-only-jobs-matching: | |
description: "Only start an SSH session for jobs matching this regex pattern:" | |
default: ".*" | |
type: string | |
jobs: | |
########################################################### | |
maven-build: | |
########################################################### | |
uses: sebthom/gha-shared/.github/workflows/maven-build.yml@v1 | |
with: | |
timeout-minutes: 10 | |
compile-jdk: 11 | |
test-jdks: 17,21,24 | |
extra-maven-args: ${{ inputs.extra-maven-args }} | |
snapshots-branch: mvn-snapshots-repo | |
javadoc-branch: javadoc | |
debug-with-ssh: ${{ inputs.debug-with-ssh }} | |
debug-with-ssh-only-for-actor: ${{ inputs.debug-with-ssh-only-for-actor || true }} | |
debug-with-ssh-only-jobs-matching: ${{ inputs.debug-with-ssh-only-jobs-matching }} | |
secrets: | |
SONATYPE_CENTRAL_USER: ${{ vars.SONATYPE_CENTRAL_USER }} | |
SONATYPE_CENTRAL_TOKEN: ${{ secrets.SONATYPE_CENTRAL_TOKEN }} | |
GPG_SIGN_KEY: ${{ secrets.GPG_SIGN_KEY }} | |
GPG_SIGN_KEY_PWD: ${{ secrets.GPG_SIGN_KEY_PWD }} | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
permissions: | |
actions: write # to delete action cache entries | |
contents: write # to create releases (commit to dev branch, create tags) | |
pull-requests: write # for dependabot auto merges |