27 Commits

Author SHA1 Message Date
57ca7f1a81 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-22 08:40:57 +02:00
41e894b5c6 #58 New feature to support repository and token options (#59) 2023-09-22 08:29:12 +02:00
c1ef1c9458 Merge pull request #57 from s4u/docs
Documentation improvements
2023-08-23 23:02:20 +02:00
fe0723070c Documentation improvements 2023-08-23 22:57:55 +02:00
f416ae1666 Merge pull request #56 from s4u/jdk-default
Java 17 as default
2023-08-23 21:25:04 +02:00
428a7bd6a8 Java 17 as default 2023-08-23 21:13:07 +02:00
7b66d0ca2e Merge pull request #55 from s4u/m394
Maven 3.9.4 as default
2023-08-23 20:47:55 +02:00
2dce5ee2b1 Maven 3.9.4 as default 2023-08-23 20:43:44 +02:00
e912d59387 Add the ability to specify ref for checkout action (#52) 2023-08-17 10:59:46 +02:00
721df57437 Merge pull request #51 from s4u/m392
Maven 3.9.2 as default
2023-06-09 13:43:17 +02:00
21adf11259 Maven 3.9.2 as default 2023-06-09 13:39:57 +02:00
94605e0cdf Merge pull request #50 from s4u/enforcer-3.2.1
Bump m-enforcer-p to 3.2.1, simplify test project
2023-02-22 22:29:49 +01:00
ff947fe3e9 Bump m-enforcer-p to 3.2.1, simplify test project 2023-02-22 22:25:50 +01:00
35afc95be0 Merge pull request #49 from s4u/mvn-3.9.0
Maven 3.9.0 as default
2023-02-22 22:20:33 +01:00
4f918ce4df Maven 3.9.0 as default 2023-02-22 22:15:46 +01:00
e3f10494a8 File sync from s4u/.github - Use shared release-drafter.yml 2022-11-13 09:59:03 +00:00
7cf09e2e6e File sync from s4u/.github - Use shared release-drafter.yml 2022-11-13 09:42:45 +00:00
deb771502d File sync from s4u/.github - 2022-11-13 09:36:02 +00:00
e5734e3ce7 File sync from s4u/.github - 2022-11-13 09:27:48 +00:00
fc8e36b653 Merge pull request #47 from s4u/gh-output
Replace deprecated GH command - set-output
2022-11-13 09:57:32 +01:00
8c7ad20804 Replace deprecated GH command - set-output 2022-11-13 09:46:15 +01:00
4e0b434104 Bump s4u/maven-settings-action from 2.7.0 to 2.8.0
Bumps [s4u/maven-settings-action](https://github.com/s4u/maven-settings-action) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/s4u/maven-settings-action/releases)
- [Commits](https://github.com/s4u/maven-settings-action/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: s4u/maven-settings-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-13 09:29:54 +01:00
bb348407a1 Bump stCarolas/setup-maven from 4.4 to 4.5
Bumps [stCarolas/setup-maven](https://github.com/stCarolas/setup-maven) from 4.4 to 4.5.
- [Release notes](https://github.com/stCarolas/setup-maven/releases)
- [Commits](https://github.com/stCarolas/setup-maven/compare/v4.4...v4.5)

---
updated-dependencies:
- dependency-name: stCarolas/setup-maven
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-07 14:03:57 +01:00
b185da4934 Bump release-drafter/release-drafter from 5.21.0 to 5.21.1
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 15:14:26 +02:00
4fdbe2a6a7 Bump s4u/maven-settings-action from 2.6.0 to 2.7.0
Bumps [s4u/maven-settings-action](https://github.com/s4u/maven-settings-action) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/s4u/maven-settings-action/releases)
- [Commits](https://github.com/s4u/maven-settings-action/compare/v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: s4u/maven-settings-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 15:27:10 +02:00
6f549063f4 Bump release-drafter/release-drafter from 5.20.1 to 5.21.0
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.1...v5.21.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 15:11:46 +02:00
615b14550f Bump release-drafter/release-drafter from 5.20.0 to 5.20.1
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.0 to 5.20.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.0...v5.20.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 15:22:42 +02:00
5 changed files with 63 additions and 74 deletions

View File

@ -9,14 +9,4 @@ on:
jobs:
update_release_draft:
name: Update Release Draft
runs-on: ubuntu-latest
concurrency: release-drafter
if: >
github.repository_owner == 's4u'
&& !startsWith(github.event.head_commit.message , '[maven-release-plugin]')
steps:
- uses: release-drafter/release-drafter@v5.20.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: s4u/.github/.github/workflows/release-drafter.yml@master

View File

@ -19,13 +19,13 @@ jobs:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
java: [ '8', '11', '17' ]
maven: [ '3.5.4', '3.6.3', '3.8.6' ]
maven: [ '3.8.8', '3.9.4' ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
@ -41,13 +41,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
java-version: 8
- run: mvn -V validate -Drequire.java=8 -Drequire.maven=3.8.6
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.4
shell: bash
test-ok:

View File

@ -9,37 +9,37 @@ 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)
# Contributions
:exclamation: You **should not** include above actions in your configuration - in other case those will be **called twice**. :exclamation:
- 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
For default values you only need:
# Project versioning
```yml
steps:
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).
- name: Setup Maven Action
uses: s4u/setup-maven-action@< version >
- run: mvn -V ...
```
# Params mapping for sub actions
**Notice** when used this action you should not used mentioned below actions again.
## checkout
| params | destination | default |
|------------------------------|---------------------|---------|
| checkout-fetch-depth | fetch-depth | |
| checkout-path | path | |
| checkout-persist-credentials | persist-credentials | false |
| params | destination | default |
|------------------------------|---------------------|--------------------------|
| checkout-fetch-depth | fetch-depth | |
| checkout-path | path | |
| checkout-ref | ref | |
| checkout-repository | repository | ${{ github.repository }} |
| checkout-token | token | ${{ github.token }} |
| checkout-persist-credentials | persist-credentials | false |
## setup-java
| params | destination | default |
|-------------------|--------------|---------|
| java-version | java-version | |
| java-version | java-version | 17 |
| java-distribution | distribution | temurin |
## cache
@ -69,7 +69,7 @@ So we can use for action:
| params | destination | default |
|---------------|---------------|---------|
| maven-version | maven-version | 3.8.6 |
| maven-version | maven-version | 3.9.4 |
## maven-settings-action
@ -90,7 +90,7 @@ jobs:
strategy:
matrix:
maven: [ '3.5.4', '3.6.3', '3.8.6' ]
maven: [ '3.8.8', '3.9.4' ]
name: Maven ${{ matrix.maven }} sample
@ -105,6 +105,20 @@ 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

@ -21,11 +21,25 @@ 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 }}
# java jdk params
java-version:
description: 'The Java version to set up'
default: '17'
required: true
java-distribution:
@ -50,7 +64,7 @@ inputs:
# maven version
maven-version:
description: 'The Maven version to set up'
default: '3.8.6'
default: '3.9.4'
required: false
# maven settings.xml
@ -75,11 +89,14 @@ runs:
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
path: '${{ inputs.checkout-path }}'
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
ref: '${{ inputs.checkout-ref }}'
repository: '${{ inputs.checkout-repository }}'
token: '${{ inputs.checkout-token }}'
- uses: actions/setup-java@v3
with:
@ -96,16 +113,16 @@ runs:
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
- name: Installed Maven version
run: echo "::set-output name=version::$(mvn -q -v)"
run: echo "version=$(mvn -q -v)" >> $GITHUB_OUTPUT
shell: bash
id: current-maven
- uses: stCarolas/setup-maven@v4.4
- 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@v2.6.0
- uses: s4u/maven-settings-action@v2.8.0
with:
servers: '${{ inputs.settings-servers}}'
mirrors: '${{ inputs.settings-mirrors}}'

34
pom.xml
View File

@ -36,7 +36,6 @@
<properties>
<require.maven/>
<require.java/>
<_require.java/>
</properties>
<build>
@ -44,11 +43,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>display-info</goal>
<goal>enforce</goal>
</goals>
<phase>validate</phase>
@ -57,7 +55,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>${_require.java}</version>
<version>${require.java}</version>
</requireJavaVersion>
<requireMavenVersion>
<version>[${require.maven}]</version>
@ -67,32 +65,4 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>java8-version-label</id>
<activation>
<property>
<name>require.java</name>
<value>8</value>
</property>
</activation>
<properties>
<_require.java>1.8</_require.java>
</properties>
</profile>
<profile>
<id>non-java8-version-label</id>
<activation>
<property>
<name>require.java</name>
<value>!8</value>
</property>
</activation>
<properties>
<_require.java>${require.java}</_require.java>
</properties>
</profile>
</profiles>
</project>