mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-13 00:05:10 +08:00
Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63e4cd9ad1 | |||
| f0414a8351 | |||
| 81f0483288 | |||
| af6b8e170c | |||
| 22a06a2fe3 | |||
| d36f1fc23e | |||
| b53dd2825a | |||
| 56cc41b90d | |||
| e3c826f8cc | |||
| 4c63d7d932 | |||
| 4585690afd | |||
| 22fe1553d7 | |||
| 18ef4b759e | |||
| 58b2cc938d | |||
| 004043f81b | |||
| d9764096ef | |||
| d60941527d | |||
| 8668fb9de8 | |||
| ec82f26b88 | |||
| 1907361ea9 | |||
| d4245fa41a | |||
| 35a231e628 | |||
| bee771f042 | |||
| 5344d1092e | |||
| cd150da647 | |||
| f2a772b79b | |||
| b82597c31c | |||
| 2a61fa7362 | |||
| 47c2778e48 | |||
| 18ed4916ce | |||
| a2f82a8171 | |||
| f0c6d72092 | |||
| fccb401913 | |||
| 440eda18c7 | |||
| 44b3adc17b | |||
| 8d6de218c6 | |||
| 421a3d288e | |||
| 00510bfd43 | |||
| 8693beee3c | |||
| 9589d5648d | |||
| d27f7bad34 | |||
| 07db3fb4b2 | |||
| 3a36aae9ec | |||
| b8af8b0ed8 | |||
| 336767f6a6 | |||
| 078175723e | |||
| 38506fd243 | |||
| 41d4657217 | |||
| e9a7bdc6d6 | |||
| b3d576e79a |
30
.github/workflows/auto-approve.yml
vendored
30
.github/workflows/auto-approve.yml
vendored
@ -5,30 +5,6 @@ on:
|
||||
|
||||
jobs:
|
||||
auto-approve:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Dependabot metadata
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
id: dependabot-metadata
|
||||
uses: dependabot/fetch-metadata@v1.1.1
|
||||
with:
|
||||
github-token: "${{ secrets.TECH_TOKEN }}"
|
||||
|
||||
- name: Enable auto-merge for Dependabot PRs
|
||||
if: >
|
||||
github.actor == 'dependabot[bot]'
|
||||
&& steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
|
||||
run: gh pr merge --auto --rebase "$PR_URL"
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{ secrets.TECH_TOKEN }}
|
||||
|
||||
- name: Approve a PR
|
||||
if: >
|
||||
github.actor == 'dependabot[bot]'
|
||||
|| github.actor == 'slawekjaranowski'
|
||||
run: gh pr review --approve "$PR_URL"
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{ secrets.TECH_TOKEN }}
|
||||
uses: s4u/.github/.github/workflows/auto-approve.yml@master
|
||||
secrets:
|
||||
TECH_TOKEN: ${{ secrets.TECH_TOKEN }}
|
||||
|
||||
2
.github/workflows/release-drafter.yml
vendored
2
.github/workflows/release-drafter.yml
vendored
@ -17,6 +17,6 @@ jobs:
|
||||
&& !startsWith(github.event.head_commit.message , '[maven-release-plugin]')
|
||||
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5.15.0
|
||||
- uses: release-drafter/release-drafter@v5.19.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
@ -11,10 +11,6 @@ on:
|
||||
schedule:
|
||||
- cron: '22 23 * * 5'
|
||||
|
||||
concurrency:
|
||||
group: test-action
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
@ -22,14 +18,14 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||
java: [ '8', '11', '16' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||
java: [ '8', '11', '17' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.5' ]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
@ -40,3 +36,31 @@ jobs:
|
||||
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
||||
shell: bash
|
||||
|
||||
test-deault:
|
||||
name: Test with defaults
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
java-version: 8
|
||||
|
||||
- run: mvn -V validate -Drequire.java=8 -Drequire.maven=3.8.5
|
||||
shell: bash
|
||||
|
||||
test-ok:
|
||||
name: Test OK
|
||||
runs-on: ubuntu-latest
|
||||
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: needs.test.result == 'success' && needs.test-deault.result == 'success'
|
||||
|
||||
- run: 'false'
|
||||
if: needs.test.result != 'success' || needs.test-deault.result != 'success'
|
||||
|
||||
33
README.md
33
README.md
@ -18,24 +18,27 @@ This is composite action which help to prepare GitHub Actions environment for Ma
|
||||
# Project versioning
|
||||
|
||||
This project uses [Semantic Versioning](https://semver.org/).
|
||||
We recommended to use the latest and specific release version.
|
||||
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).
|
||||
|
||||
# Params mapping for sub actions
|
||||
|
||||
**Notice** when used this action you should not used mentioned below actions again.
|
||||
|
||||
## checkout
|
||||
|
||||
| params | destination |
|
||||
| -------------------------- |------------------ |
|
||||
| checkout-fetch-depth | fetch-depth |
|
||||
|
||||
| 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 | |
|
||||
| java-distribution | distribution | temurin |
|
||||
|
||||
@ -55,23 +58,23 @@ A cache action is configured as:
|
||||
|
||||
So we can use for action:
|
||||
|
||||
| params | description |
|
||||
| ----------------- |--------------------------------------------------------- |
|
||||
| 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 |
|
||||
| params | description |
|
||||
|----------------|----------------------------------------------------------|
|
||||
| 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 |
|
||||
|
||||
|
||||
## setup-maven
|
||||
|
||||
| params | destination | default |
|
||||
| ------------- |-------------- |-------- |
|
||||
| maven-version | maven-version | 3.8.1 |
|
||||
|---------------|---------------|---------|
|
||||
| maven-version | maven-version | 3.8.5 |
|
||||
|
||||
## maven-settings-action
|
||||
|
||||
| params | destination |
|
||||
| -------------------------- |------------------ |
|
||||
|----------------------------|-------------------|
|
||||
| settings-servers | servers |
|
||||
| settings-mirrors | mirrors |
|
||||
| settings-properties | properties |
|
||||
@ -87,7 +90,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.5' ]
|
||||
|
||||
name: Maven ${{ matrix.maven }} sample
|
||||
|
||||
|
||||
48
action.yml
48
action.yml
@ -12,6 +12,16 @@ inputs:
|
||||
description: 'Number of commits to fetch'
|
||||
required: false
|
||||
|
||||
checkout-path:
|
||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||
required: false
|
||||
|
||||
checkout-persist-credentials:
|
||||
description: 'Whether to configure the token or SSH key with the local git config'
|
||||
default: 'false'
|
||||
required: false
|
||||
|
||||
|
||||
# java jdk params
|
||||
|
||||
java-version:
|
||||
@ -40,7 +50,7 @@ inputs:
|
||||
# maven version
|
||||
maven-version:
|
||||
description: 'The Maven version to set up'
|
||||
default: '3.8.1'
|
||||
default: '3.8.5'
|
||||
required: false
|
||||
|
||||
# maven settings.xml
|
||||
@ -65,51 +75,39 @@ runs:
|
||||
|
||||
steps:
|
||||
|
||||
- run: echo "::group::Checkout"
|
||||
shell: bash
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
path: '${{ inputs.checkout-path }}'
|
||||
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
||||
|
||||
- run: echo "::group::Setup Java"
|
||||
shell: bash
|
||||
- uses: actions/setup-java@v2.3.0
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
overwrite-settings: false
|
||||
java-version: '${{ inputs.java-version }}'
|
||||
distribution: '${{ inputs.java-distribution }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Setup Cache"
|
||||
shell: bash
|
||||
- uses: actions/cache@v2.1.6
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
${{ inputs.cache-path }}
|
||||
${{ inputs.cache-path-add }}
|
||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Setup Maven Version"
|
||||
- name: Installed Maven version
|
||||
run: echo "::set-output name=version::$(mvn -q -v)"
|
||||
shell: bash
|
||||
- uses: stCarolas/setup-maven@v4.1
|
||||
id: current-maven
|
||||
|
||||
- uses: stCarolas/setup-maven@v4.3
|
||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
||||
with:
|
||||
maven-version: '${{ inputs.maven-version }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Prepare Maven settings.xml"
|
||||
shell: bash
|
||||
- uses: s4u/maven-settings-action@v2.4.1
|
||||
- uses: s4u/maven-settings-action@v2.6.0
|
||||
with:
|
||||
servers: '${{ inputs.settings-servers}}'
|
||||
mirrors: '${{ inputs.settings-mirrors}}'
|
||||
properties: '${{ inputs.settings-properties}}'
|
||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user