Skip to content

Commit

Permalink
Added maven repo access token configuration for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jwomeara committed Jan 24, 2024
1 parent 9d3a3b2 commit bbf3f4e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<interactiveMode/>

<offline/>

<pluginGroups/>

<mirrors/>

<proxies/>

<servers>
<server>
<id>github-datawave</id>
<username>${env.USER_NAME}</username>
<password>${env.ACCESS_TOKEN}</password>
</server>
</servers>
</settings>
8 changes: 6 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ jobs:
${{ runner.os }}-maven-
- name: Format code
run: |
mvn -V -B -e clean formatter:format sortpom:sort -Pautoformat
mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -V -B -e clean formatter:format sortpom:sort -Pautoformat
git status
git diff-index --quiet HEAD || (echo "Error! There are modified files after formatting." && false)
env:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"
USER_NAME: ${{ secrets.USER_NAME }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# Build the code and run the unit/integration tests.
build-and-test:
Expand All @@ -56,6 +58,8 @@ jobs:
${{ runner.os }}-maven-format-
${{ runner.os }}-maven-
- name: Build and Run Unit Tests
run: mvn -V -B -e -Ddist clean verify
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -V -B -e -Ddist clean verify
env:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"
USER_NAME: ${{ secrets.USER_NAME }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

0 comments on commit bbf3f4e

Please sign in to comment.