Publish to GitLab Package Registry

This commit is contained in:
Alex Zenla 2023-09-05 16:02:01 -07:00
parent ff1c275589
commit ead67199fd
Signed by: alex
GPG Key ID: C0780728420EBFE5
2 changed files with 20 additions and 1 deletions

View File

@ -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 }}"

View File

@ -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<HttpHeaderAuthentication>("header")
}
}
}
}