Merge remote-tracking branch 'origin/master' into releases/v2

This commit is contained in:
Slawomir Jaranowski
2021-08-20 13:29:55 +02:00
11 changed files with 2200 additions and 6000 deletions

View File

@ -1,40 +0,0 @@
categories:
- title: 'New features'
labels:
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'bug'
- title: 'Maintenance'
labels:
- 'code quality'
- 'documentation'
- title: 'Dependency updates'
labels:
- 'dependencies'
change-template: '- $TITLE #$NUMBER'
sort-direction: 'ascending'
template: |
# What's Changed
$CHANGES
# Thanks
Many thanks for collaboration on this release for: $CONTRIBUTORS
replacers:
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?Github Action(?:\[bot\])?,?/g'
replace: ''

View File

@ -19,7 +19,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2.3.4 - uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.1.5 - uses: actions/setup-node@v2.4.0
with: with:
node-version: '12.x' node-version: '12.x'

25
.github/workflows/auto-approve.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Auto approve
on:
pull_request_target
jobs:
auto-approve:
runs-on: ubuntu-latest
steps:
- uses: alexwilson/enable-github-automerge-action@1.0.0
if: >
github.actor == 'dependabot[bot]'
|| github.actor == 'dependabot-preview[bot]'
with:
merge-method: "REBASE"
github-token: "${{ secrets.TECH_TOKEN }}"
- uses: hmarr/auto-approve-action@v2.1.0
if: >
github.actor == 'dependabot[bot]'
|| github.actor == 'dependabot-preview[bot]'
|| github.actor == 'slawekjaranowski'
with:
github-token: "${{ secrets.TECH_TOKEN }}"

View File

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

View File

@ -19,13 +19,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v2.3.4 - uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.1.5 - uses: actions/setup-node@v2.4.0
with: with:
node-version: '12.x' node-version: '12.x'
- uses: actions/setup-java@v1 - uses: actions/setup-java@v2.2.0
with: with:
java-version: '1.8' distribution: 'adopt'
java-version: '8'
- run: npm version - run: npm version
- run: npm ci - run: npm ci

View File

@ -3,7 +3,7 @@
[![Audit](https://github.com/s4u/maven-settings-action/workflows/Audit/badge.svg)](https://github.com/s4u/maven-settings-action/actions?query=workflow%3AAudit) [![Audit](https://github.com/s4u/maven-settings-action/workflows/Audit/badge.svg)](https://github.com/s4u/maven-settings-action/actions?query=workflow%3AAudit)
This action setup maven environment for use in action by: This action sets up Maven environments for use in GitHub Actions by:
- create maven settings.xml - create maven settings.xml
- set ```interactiveMode``` to false - useful in CI system - set ```interactiveMode``` to false - useful in CI system
- after job finish generated settings.xml will be removed to prevent cache or left sensitive data on build system - after job finish generated settings.xml will be removed to prevent cache or left sensitive data on build system
@ -12,10 +12,10 @@ This action setup maven environment for use in action by:
# Contributions # Contributions
- Contributions are welcome! - Contributions are welcome!
- Give :star: - if you want to encourage me to work on a project - Give :star: - if you want to encourage me to work on a project
- Don't hesitate create issue for new feature you dream of or if you suspect some bug - Don't hesitate to create issues for new features you dream of or if you suspect some bug
# Project versioning # Project versioning
Project use [Semantic Versioning](https://semver.org/). This project uses [Semantic Versioning](https://semver.org/).
We recommended to use the latest and specific release version. We recommended to use the latest and specific release version.
In order to keep your project dependencies up to date you can watch this repository *(Releases only)* In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
@ -28,14 +28,14 @@ See [action.yml](action.yml)
## default ```settings.xml``` ## default ```settings.xml```
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
``` ```
## ```settings.xml``` with servers section ## ```settings.xml``` with servers section
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
servers: '[{"id": "serverId", "username": "username", "password": "password"}]' servers: '[{"id": "serverId", "username": "username", "password": "password"}]'
``` ```
@ -56,7 +56,7 @@ Please refer to the [servers](http://maven.apache.org/settings.html#Servers) doc
``` yml ``` yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
servers: | servers: |
[{ [{
@ -90,7 +90,7 @@ result will be:
## ```settings.xml``` with mirrors section ## ```settings.xml``` with mirrors section
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]' mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]'
``` ```
@ -98,7 +98,7 @@ steps:
## ```settings.xml``` with properties ## ```settings.xml``` with properties
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]' properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
``` ```
@ -107,7 +107,7 @@ steps:
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
sonatypeSnapshots: true sonatypeSnapshots: true
``` ```
@ -116,7 +116,7 @@ steps:
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
apacheSnapshots: true apacheSnapshots: true
``` ```
@ -124,7 +124,7 @@ steps:
## Do not override existing ```settings.xml```, from version **2.0** file is override by default : ## Do not override existing ```settings.xml```, from version **2.0** file is override by default :
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
override: false override: false
``` ```
@ -132,7 +132,7 @@ steps:
## Do not add github to server in ```settings.xml```, by default is added: ## Do not add github to server in ```settings.xml```, by default is added:
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
githubServer: false githubServer: false
``` ```
@ -141,7 +141,7 @@ steps:
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
oracleServers: '[{"id": "serverId", "username": "username", "password": "password"}]' oracleServers: '[{"id": "serverId", "username": "username", "password": "password"}]'
``` ```
@ -149,7 +149,7 @@ steps:
## ```settings.xml``` with [Oracle Maven Repository](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017) ## ```settings.xml``` with [Oracle Maven Repository](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017)
```yml ```yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
oracleRepo: true oracleRepo: true
``` ```
@ -160,7 +160,7 @@ It is also possible pass in Github Secrets e.g.
``` yml ``` yml
steps: steps:
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
with: with:
servers: | servers: |
[{ [{
@ -190,11 +190,11 @@ steps:
with: with:
java-version: 8 java-version: 8
- uses: s4u/maven-settings-action@v2.4.0 - uses: s4u/maven-settings-action@v2.4.1
- run: mvn verify - run: mvn verify
``` ```
# License # License
The scripts and documentation in this project are released under the [MIT License](LICENSE) The scripts and documentation in this project are released under the [MIT License](LICENSE).

8056
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
{ {
"name": "maven-settings-action", "name": "maven-settings-action",
"version": "2.4.0", "version": "2.4.1",
"description": "Prepare maven settings", "description": "Prepare maven settings",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"lint": "eslint index.js settings.js", "lint": "eslint index.js settings.js",
"test": "eslint index.js settings.js && jest --coverage" "test": "eslint index.js settings.js && jest --coverage",
"version": "./update-readme.sh",
"postversion": "git tag --delete v$npm_new_version"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,11 +26,11 @@
}, },
"homepage": "https://github.com/s4u/maven-settings-action#readme", "homepage": "https://github.com/s4u/maven-settings-action#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.5.0",
"xmldom": "^0.4.0" "@xmldom/xmldom": "^0.7.1"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^7.20.0", "eslint": "^7.32.0",
"jest": "^26.6.3" "jest": "^27.0.6"
} }
} }

View File

@ -26,8 +26,8 @@ const core = require('@actions/core');
const os = require('os'); const os = require('os');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const DOMParser = require('xmldom').DOMParser; const DOMParser = require('@xmldom/xmldom').DOMParser;
const XMLSerializer = require('xmldom').XMLSerializer; const XMLSerializer = require('@xmldom/xmldom').XMLSerializer;
function getSettingsPath() { function getSettingsPath() {
return path.join(os.homedir(), '.m2', 'settings.xml'); return path.join(os.homedir(), '.m2', 'settings.xml');

View File

@ -24,8 +24,8 @@ THE SOFTWARE.
const os = require('os'); const os = require('os');
const process = require('process'); const process = require('process');
const DOMParser = require('xmldom').DOMParser; const DOMParser = require('@xmldom/xmldom').DOMParser;
const XMLSerializer = require('xmldom').XMLSerializer; const XMLSerializer = require('@xmldom/xmldom').XMLSerializer;
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');

9
update-readme.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
echo "old_version: $npm_old_version"
echo "new_version: $npm_new_version"
echo "package_name: $npm_package_name"
sed -i '' "s/$npm_package_name@v$npm_old_version/$npm_package_name@v$npm_new_version/g" README.md
git add README.md