diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6c9041b..4a3c26c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,7 @@ jobs: - name: Publish with Gradle uses: gradle/gradle-build-action@v2 with: - arguments: publishAllPublicationsToGitHubPackagesRepository + arguments: publishAllPublicationsToGitHubPackagesRepository publishAllPublicationsToGitLabRepository env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITLAB_TOKEN: "${{ secrets.GITLAB_TOKEN }}" diff --git a/buildSrc/src/main/kotlin/dough_publishing.gradle.kts b/buildSrc/src/main/kotlin/dough_publishing.gradle.kts index d2cd32d..bf350ff 100644 --- a/buildSrc/src/main/kotlin/dough_publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/dough_publishing.gradle.kts @@ -13,6 +13,11 @@ publishing { githubPackagesToken = project.findProperty("github.token") as String? } + var gitlabPackagesToken = System.getenv("GITLAB_TOKEN") + if (gitlabPackagesToken == null) { + gitlabPackagesToken = project.findProperty("gitlab.com.accessToken") as String? + } + maven { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/gaypizzaspecifications/dough") @@ -21,5 +26,18 @@ publishing { password = githubPackagesToken } } + + maven { + name = "GitLab" + url = uri("https://gitlab.com/api/v4/projects/49101454/packages/maven") + credentials(HttpHeaderCredentials::class.java) { + name = "Private-Token" + value = gitlabPackagesToken + } + + authentication { + create("header") + } + } } }