Skip to content

Commit

Permalink
Update README with env sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Clark committed Dec 19, 2019
1 parent 7e36086 commit c05b45b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.***
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/setup-java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c05b45b

Please sign in to comment.