Compare commits

..

No commits in common. "main" and "v1.8.0" have entirely different histories.
main ... v1.8.0

4 changed files with 54 additions and 145 deletions

View File

@ -5,7 +5,6 @@ on:
branches:
- 'master'
- 'main'
workflow_dispatch:
jobs:
update_release_draft:

View File

@ -18,14 +18,14 @@ jobs:
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
java: [ '8', '11', '17', '21', '25' ]
maven: [ '3.8.8', '3.9.14' ]
java: [ '8', '11', '17' ]
maven: [ '3.6.3', '3.8.7', '3.9.2' ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v3
- uses: ./
with:
@ -36,27 +36,31 @@ jobs:
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
shell: bash
test-default:
test-deault:
name: Test with defaults
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v3
- uses: ./
with:
java-version: 8
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.14
- run: mvn -V validate -Drequire.java=8 -Drequire.maven=3.9.2
shell: bash
test-ok:
name: Test OK
runs-on: ubuntu-latest
needs: [ test, test-default ]
needs: [ test, test-deault ]
if: always()
steps:
- run: echo "needs.test.result=${{ needs.test.result }} needs.test-deault.result=${{ needs.test-deault.result }}"
- run: 'true'
if: join(needs.*.result, ',') == 'success,success'
if: needs.test.result == 'success' && needs.test-deault.result == 'success'
- run: 'false'
if: join(needs.*.result, ',') != 'success,success'
if: needs.test.result != 'success' || needs.test-deault.result != 'success'

View File

@ -9,42 +9,38 @@ This is composite action which help to prepare GitHub Actions environment for Ma
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
:exclamation: You **should not** include above actions in your configuration - in other case those will be **called twice**. :exclamation:
# Contributions
For default values you only need:
- Contributions are welcome!
- Give :star: - if you want to encourage me to work on a project
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
```yml
steps:
# Project versioning
- name: Setup Maven Action
uses: s4u/setup-maven-action@< version >
This project uses [Semantic Versioning](https://semver.org/).
We recommended using the latest and specific release version.
- run: mvn -V ...
```
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
# Params mapping for sub actions
**Notice** when used this action you should not used mentioned below actions again.
## checkout
| params | destination | default |
|------------------------------|---------------------|--------------------------|
| checkout-enabled | enabled | true |
| checkout-fetch-depth | fetch-depth | |
| checkout-submodules | submodules | |
| checkout-path | path | |
| checkout-ref | ref | |
| checkout-repository | repository | ${{ github.repository }} |
| checkout-token | token | ${{ github.token }} |
| checkout-ssh-key | ssh-key | |
| checkout-persist-credentials | persist-credentials | false |
| params | destination | default |
|------------------------------|---------------------|---------|
| checkout-fetch-depth | fetch-depth | |
| checkout-path | path | |
| checkout-persist-credentials | persist-credentials | false |
## setup-java
| params | destination | default |
|-------------------|--------------|---------|
| java-version | java-version | 17 |
| java-distribution | distribution | zulu |
| java-jdkFile | jdkFile | |
| java-version | java-version | |
| java-distribution | distribution | temurin |
## cache
@ -64,8 +60,7 @@ So we can use for action:
| params | description |
|----------------|----------------------------------------------------------|
| cache-enabled | enable cache. Default true |
| cache-path | default cache path for Maven with value ~/.m2/repository |
| cache-path | default cache path for Maven with value ~/.m2/repository |
| cache-path-add | additional value for cache path |
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
@ -74,21 +69,16 @@ So we can use for action:
| params | destination | default |
|---------------|---------------|---------|
| maven-version | maven-version | 3.9.14 |
| maven-version | maven-version | 3.9.2 |
## maven-settings-action
| params | destination |
|-----------------------------|--------------------|
| settings-servers | servers |
| settings-mirrors | mirrors |
| settings-properties | properties |
| settings-sonatypeSnapshots | sonatypeSnapshots |
| settings-proxies | proxies |
| settings-repositories | repositories |
| settings-pluginRepositories | pluginRepositories |
| settings-githubServer | githubServer |
| settings-path | path |
| params | destination |
|----------------------------|-------------------|
| settings-servers | servers |
| settings-mirrors | mirrors |
| settings-properties | properties |
| settings-sonatypeSnapshots | sonatypeSnapshots |
# Testing against different Maven versions
@ -100,7 +90,7 @@ jobs:
strategy:
matrix:
maven: [ '3.8.8', '3.9.8' ]
maven: [ '3.6.3', '3.8.7', '3.9.2' ]
name: Maven ${{ matrix.maven }} sample
@ -115,20 +105,6 @@ jobs:
- run: mvn -V ...
```
# Contributions
- Contributions are welcome!
- Give :star: - if you want to encourage me to work on a project
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
# Project versioning
This project uses [Semantic Versioning](https://semver.org/).
We recommended using the latest and specific release version.
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)

View File

@ -8,19 +8,10 @@ branding:
inputs:
# checkout
checkout-enabled:
description: 'Enable checkout'
default: 'true'
required: false
checkout-fetch-depth:
description: 'Number of commits to fetch'
required: false
checkout-submodules:
description: 'Whether to fetch submodules'
required: false
checkout-path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
required: false
@ -30,46 +21,19 @@ inputs:
default: 'false'
required: false
checkout-ref:
description: 'The branch, tag, or SHA of the repository to clone'
required: false
checkout-repository:
description: 'The repository to checkout if not the repository that triggered the action. For use when building GitHub Apps'
required: false
default: ${{ github.repository }}
checkout-token:
description: 'Token to use for checkout if checking out a repository out of scope for GITHUB_TOKEN'
required: false
default: ${{ github.token }}
checkout-ssh-key:
description: 'SSH key used to fetch the repository. It allows to run authenticated git commands'
required: false
# java jdk params
java-version:
description: 'The Java version to set up'
default: '17'
required: true
java-distribution:
description: 'Java distribution'
default: 'zulu'
required: false
java-jdkFile:
description: 'Java JDK compressed file location'
default: 'temurin'
required: false
# cache
cache-enabled:
description: 'Enable cache'
default: 'true'
required: false
cache-prefix:
description: 'Cache key prefix'
required: false
@ -86,73 +50,44 @@ inputs:
# maven version
maven-version:
description: 'The Maven version to set up'
default: '3.9.14'
default: '3.9.2'
required: false
# maven settings.xml
settings-servers:
description: 'servers definition in json array, e.g.: [{"id": "serverId", "username": "username", "password": "password"}]'
description: 'servers definition in json array, eg: [{"id": "serverId", "username": "username", "password": "password"}]'
required: false
settings-mirrors:
description: 'mirrors definition in json array, e.g.: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
description: 'mirrors definition in json array, eg: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
required: false
settings-properties:
description: 'json array with properties, e.g.: [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
description: 'json array with properties, eg [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
required: false
settings-sonatypeSnapshots:
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
required: false
settings-proxies:
description: 'proxies definition in json array, e.g.: [{"id": "http-proxy", "active": "true", "protocol": "http", "host": "host", "port": "port", "nonProxyHosts": "host1|host2"}]'
required: false
settings-repositories:
description: 'repository settings definition in json array, e.g.: [ { "id": "repoId","name": "repoName","url": "url","snapshots": { "enabled": true } } ]'
required: false
settings-pluginRepositories:
description: 'plugin repository settings definition in json array, e.g.: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
required: false
settings-githubServer:
description: 'add to settings.xml servers server-id: github; username=$GITHUB_ACTOR and password=$GITHUB_TOKEN'
default: "true"
required: false
settings-path:
description: 'override default path to settings.xml which is $HOME/.m2/settings.xml'
required: false
runs:
using: 'composite'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: inputs.checkout-enabled == 'true'
- uses: actions/checkout@v3
with:
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
submodules: '${{ inputs.checkout-submodules }}'
path: '${{ inputs.checkout-path }}'
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
ref: '${{ inputs.checkout-ref }}'
repository: '${{ inputs.checkout-repository }}'
token: '${{ inputs.checkout-token }}'
ssh-key: '${{ inputs.checkout-ssh-key }}'
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
- uses: actions/setup-java@v3
with:
overwrite-settings: false
java-version: '${{ inputs.java-version }}'
distribution: '${{ inputs.java-distribution }}'
jdkFile: '${{ inputs.java-jdkFile }}'
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
if: inputs.cache-enabled == 'true'
- uses: actions/cache@v3
with:
path: |
${{ inputs.cache-path }}
@ -165,19 +100,14 @@ runs:
shell: bash
id: current-maven
- uses: stCarolas/setup-maven@12eb41b233df95d49b0c11fc1b5bc8312e5d4ce0 # v5.1
- uses: stCarolas/setup-maven@v4.5
if: inputs.maven-version != steps.current-maven.outputs.version
with:
maven-version: '${{ inputs.maven-version }}'
- uses: s4u/maven-settings-action@894661b3ddae382f1ae8edbeab60987e08cf0788 # v4.0.0
- uses: s4u/maven-settings-action@v2.8.0
with:
servers: '${{ inputs.settings-servers }}'
mirrors: '${{ inputs.settings-mirrors }}'
properties: '${{ inputs.settings-properties }}'
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots }}'
proxies: '${{ inputs.settings-proxies }}'
repositories: '${{ inputs.settings-repositories }}'
pluginRepositories: '${{ inputs.settings-pluginRepositories }}'
githubServer: '${{ inputs.settings-githubServer }}'
path: '${{ inputs.settings-path }}'
servers: '${{ inputs.settings-servers}}'
mirrors: '${{ inputs.settings-mirrors}}'
properties: '${{ inputs.settings-properties}}'
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'