Skip to content

Commit

Permalink
Publish to GitLab Package Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
azenla committed Sep 5, 2023
1 parent ff1c275 commit ead6719
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
18 changes: 18 additions & 0 deletions buildSrc/src/main/kotlin/dough_publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}
}
}
}

0 comments on commit ead6719

Please sign in to comment.