mirror of
https://github.com/actions/setup-java.git
synced 2024-08-16 10:19:51 +02:00
Update README with env sections
This commit is contained in:
parent
7e36086f36
commit
c05b45bb91
2 changed files with 13 additions and 11 deletions
18
README.md
18
README.md
|
@ -69,28 +69,28 @@ jobs:
|
|||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
|
||||
|
||||
- name: Set up Apache Maven Central
|
||||
uses: actions/setup-java@v1
|
||||
with: # running setup-java again overwrites the settings.xml
|
||||
java-version: 1.8
|
||||
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
server-username: MAVEN_USERNAME # env variable for username below
|
||||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token below
|
||||
env:
|
||||
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
||||
MAVEN_USERNAME: maven_username123
|
||||
server-username: MAVEN_USERNAME # env variable for username in deploy
|
||||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
||||
|
||||
- name: Publish to Apache Maven Central
|
||||
run: mvn deploy
|
||||
env:
|
||||
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
||||
MAVEN_USERNAME: maven_username123
|
||||
```
|
||||
|
||||
***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.***
|
||||
|
@ -142,14 +142,14 @@ jobs:
|
|||
java-version: 1.8
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
- name: Publish to GitHub Packages Apache Maven
|
||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
```
|
||||
|
||||
# License
|
||||
|
|
|
@ -19,8 +19,10 @@ async function run() {
|
|||
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
|
||||
|
||||
const id = core.getInput('server-id', {required: false}) || undefined;
|
||||
const username = core.getInput('server-username', {required: false}) || undefined;
|
||||
const password = core.getInput('server-password', {required: false}) || undefined;
|
||||
const username =
|
||||
core.getInput('server-username', {required: false}) || undefined;
|
||||
const password =
|
||||
core.getInput('server-password', {required: false}) || undefined;
|
||||
|
||||
await auth.configAuthentication(id, username, password);
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in a new issue