Skip to content

Commit 4c72f03

Browse files
committed
More credentials passing
1 parent e769837 commit 4c72f03

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959

6060
- name: Run tests
6161
run: ./gradlew --continue check koverXmlReport
62+
env:
63+
CAPLIN_USERNAME: ${{ secrets.CAPLIN_USERNAME }}
64+
CAPLIN_PASSWORD: ${{ secrets.CAPLIN_PASSWORD }}
6265

6366
- name: Publish Test Report
6467
uses: mikepenz/action-junit-report@v5
@@ -103,6 +106,9 @@ jobs:
103106

104107
- name: Generate documentation
105108
run: ./gradlew dokkaGenerate
109+
env:
110+
CAPLIN_USERNAME: ${{ secrets.CAPLIN_USERNAME }}
111+
CAPLIN_PASSWORD: ${{ secrets.CAPLIN_PASSWORD }}
106112

107113
- name: Upload documentation
108114
uses: actions/upload-artifact@v4
@@ -163,3 +169,5 @@ jobs:
163169
run: ./gradlew publish
164170
env:
165171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172+
CAPLIN_USERNAME: ${{ secrets.CAPLIN_USERNAME }}
173+
CAPLIN_PASSWORD: ${{ secrets.CAPLIN_PASSWORD }}

settings.gradle.kts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ dependencyResolutionManagement {
33
mavenCentral()
44
maven {
55
url = uri("https://repository.caplin.com/repository/caplin-release")
6-
val caplinUsername: String? by settings
7-
val caplinPassword: String? by settings
8-
val username = caplinUsername ?: System.getenv("CAPLIN_USERNAME")
9-
val password = caplinPassword ?: System.getenv("CAPLIN_PASSWORD")
10-
if (username != null || password != null) {
11-
credentials {
12-
this.username = username
13-
this.password = password
14-
}
6+
credentials {
7+
val caplinUsername: String? by settings
8+
val caplinPassword: String? by settings
9+
username = checkNotNull(
10+
caplinUsername ?: System.getenv("CAPLIN_USERNAME"),
11+
) { "Missing caplinUsername property or CAPLIN_USERNAME environment variable" }
12+
password = checkNotNull(
13+
caplinPassword ?: System.getenv("CAPLIN_PASSWORD"),
14+
) { "Missing caplinPassword property or CAPLIN_PASSWORD environment variable" }
1515
}
1616
}
1717
}

0 commit comments

Comments
 (0)