This commit is contained in:
parent
062245b548
commit
7f71c9bc4d
2 changed files with 27 additions and 3 deletions
|
@ -4,8 +4,9 @@ jobs:
|
|||
runs-on: docker
|
||||
container:
|
||||
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:
|
||||
- uses: actions/checkout@v4
|
||||
- run: cat /home/builder/.sbt/.credentials
|
||||
- run: echo "password=${{ secrets.GS_MAVEN_TOKEN }}" >> "/home/builder/.sbt/.credentials"
|
||||
- run: sbt test
|
||||
|
|
|
@ -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(
|
||||
"Garrity Software Mirror" at "https://maven.garrity.co/releases",
|
||||
|
|
Loading…
Add table
Reference in a new issue