Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into releases/v3
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Nov 3, 2024
2 parents 7802f6a + 13bd1e5 commit a30fd1b
Show file tree
Hide file tree
Showing 14 changed files with 1,130 additions and 929 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:

- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '8'
distribution: 'temurin'
java-version: '17'


- run: npm version
Expand Down
25 changes: 25 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# update dependencies

npm update
npm outdated

If new version exist put '*' in `package.json` and run again `npm update`

- new commit with dependency updates

# new release

- run - npm version patch -m "prepare release %s"
or
- run - npm version minor -m "prepare release %s"

- push commit

- checkout release/vX
- merge master and push
- run
npm update
npm install
npm prune --production
- commit and push "update dependency after merge from master"
- git tag and git push --tags
43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ See [action.yml](action.yml)
## default ```settings.xml```
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
```
## ```settings.xml``` with servers section

```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
servers: '[{"id": "serverId", "username": "username", "password": "password"}]'
```
Expand All @@ -62,7 +62,7 @@ Please refer to the [servers](http://maven.apache.org/settings.html#Servers) doc

``` yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
servers: |
[{
Expand All @@ -80,7 +80,7 @@ steps:
result will be:

```xml
<server>
<servers><server>
<id>serverId</id>
<configuration>
<item1>value1</item1>
Expand All @@ -96,23 +96,24 @@ result will be:
## ```settings.xml``` with mirrors section
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]'
```

## ```settings.xml``` with proxies section
```yml
step:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
proxies: '[{"id": "proxyId", "active": "isActive", "protocol": "proxyProtocol", "host": "proxyHost", "port": "proxyPort", "nonProxyHosts": "nonProxyHost"}]'
proxies: '[{"id": "proxyId", "active": "isActive", "protocol": "proxyProtocol", "host": "proxyHost", "port": "proxyPort", "nonProxyHosts": "nonProxyHost", "user": "proxUser", "password": "proxPassword"}]'
```
Note: Authentication details are optional.

## ```settings.xml``` with properties
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
```
Expand All @@ -121,7 +122,7 @@ steps:

```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
sonatypeSnapshots: true
```
Expand All @@ -130,23 +131,23 @@ steps:

```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
apacheSnapshots: true
```

## Do not override existing ```settings.xml```, from version **2.0** file is override by default :
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
override: false
```

## Do not add github to server in ```settings.xml```, by default is added:
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
githubServer: false
```
Expand All @@ -155,35 +156,43 @@ steps:

```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
oracleServers: '[{"id": "serverId", "username": "username", "password": "password"}]'
```

## ```settings.xml``` with [Oracle Maven Repository](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017)
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
oracleRepo: true
```

## ```settings.xml``` with custom repositories
```yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
repositories: '[{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
```

## ```settings.xml``` with custom plugin repositories
```yml
steps:
- uses: s4u/maven-settings-action@v3.1.0
with:
pluginRepositories: '[{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
```


## GitHub actions secrets

It is also possible pass in Github Secrets e.g.

``` yml
steps:
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
with:
servers: |
[{
Expand Down Expand Up @@ -213,7 +222,7 @@ steps:
with:
java-version: 8
- uses: s4u/maven-settings-action@v3.0.0
- uses: s4u/maven-settings-action@v3.1.0
- run: mvn verify
```
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ inputs:
repositories:
description: 'list of custom repositories as json array, e.g: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
required: false
pluginRepositories:
description: 'list of custom plugin repositories as json array, e.g: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
required: false

runs:
using: 'node20'
Expand Down
2 changes: 1 addition & 1 deletion cleanup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ afterAll(() => {
}

try {
fs.rmdirSync(testHomePath);
fs.rmSync(testHomePath, { recursive: true });
} catch (error) {
}
});
Expand Down
29 changes: 29 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.commonjs,
...globals.node,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},

ecmaVersion: 2018,
sourceType: "commonjs",
},

rules: {},
}];
12 changes: 9 additions & 3 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ afterAll(() => {
}

try {
fs.rmdirSync(testHomePath);
fs.rmSync(testHomePath, { recursive: true });
} catch (error) {
}
});
Expand All @@ -75,6 +75,7 @@ test('run with all feature', () => {
process.env['INPUT_SONATYPESNAPSHOTS'] = true;
process.env['INPUT_ORACLEREPO'] = true;
process.env['INPUT_REPOSITORIES'] = '[{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
process.env['INPUT_PLUGINREPOSITORIES'] = '[{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'

cp.spawnSync('node', [ `${indexPath}` ], { env: process.env, stdio: 'inherit' });
const settingsStatus = fs.lstatSync(settingsPath);
Expand Down Expand Up @@ -213,7 +214,12 @@ test('run with all feature', () => {
<url>url</url>
<snapshots><enabled>true</enabled></snapshots>
</repository></repositories>
<pluginRepositories/>
<pluginRepositories> <pluginRepository>
<id>repoId</id>
<name>repoName</name>
<url>url</url>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository></pluginRepositories>
</profile></profiles>
<servers>
<server>
Expand Down Expand Up @@ -265,4 +271,4 @@ test('run with all feature', () => {
<nonProxyHosts>nonProxyHost</nonProxyHosts>
</proxy></proxies>
</settings>`);
})
})
Loading

0 comments on commit a30fd1b

Please # to comment.