Updates for credential testing
All checks were successful
/ test (push) Successful in 40s

This commit is contained in:
Pat Garrity 2024-03-17 10:00:35 -05:00
parent 062245b548
commit 7f71c9bc4d
Signed by: pfm
GPG key ID: 5CA5D21BAB7F3A76
2 changed files with 27 additions and 3 deletions

View file

@ -4,8 +4,9 @@ jobs:
runs-on: docker runs-on: docker
container: container:
image: registry.garrity.co:8443/gs/ci-scala:latest image: registry.garrity.co:8443/gs/ci-scala:latest
env:
GS_MAVEN_USER: ${{ vars.GS_MAVEN_USER }}
GS_MAVEN_TOKEN: ${{ vars.GS_MAVEN_TOKEN }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: cat /home/builder/.sbt/.credentials
- run: echo "password=${{ secrets.GS_MAVEN_TOKEN }}" >> "/home/builder/.sbt/.credentials"
- run: sbt test - run: sbt test

View file

@ -1,4 +1,27 @@
credentials += Credentials(Path.userHome / ".sbt" / ".credentials") def selectCredentials(): Credentials =
if (Path.userHome.exists())
Credentials(Path.userHome / ".sbt" / ".credentials")
else
Credentials.apply(
realm = "Reposilite",
host = "maven.garrity.co",
userName = sys.env
.get("GS_MAVEN_USER")
.getOrElse(
throw new RuntimeException(
"You must either provide ~/.sbt/.credentials or specify the GS_MAVEN_USER environment variable."
)
),
passwd = sys.env
.get("GS_MAVEN_TOKEN")
.getOrElse(
throw new RuntimeException(
"You must either provide ~/.sbt/.credentials or specify the GS_MAVEN_TOKEN environment variable."
)
)
)
credentials += selectCredentials()
externalResolvers := Seq( externalResolvers := Seq(
"Garrity Software Mirror" at "https://maven.garrity.co/releases", "Garrity Software Mirror" at "https://maven.garrity.co/releases",