Skip to content

Commit c16db9f

Browse files
[!480] - Resolve "Publish snapshots on sonatype central instead of private gitlab repo"
Closes #593
1 parent f8e995b commit c16db9f

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
## Install
1111

12-
Wasp final releases are published to maven central through sonatype.
13-
Snapshot releases are published to a private Gitlab Registry:
12+
Wasp final releases are published to maven central through sonatype, snapshot releases are published to sonatype maven-snapshots.
13+
1414

1515
```scala
1616
libraryDependencies += "it.agilelab" %% "wasp-consumers-spark" % "3.0.1"
@@ -19,17 +19,7 @@ libraryDependencies += "it.agilelab" %% "wasp-consumers-spark" % "3.0.1"
1919
or (for snapshots)
2020

2121
```scala
22-
val gitlabHost = "gitlab.com"
23-
val gitlabRegistryEndpoint = s"https://${gitlabHost}/api/v4/projects/3748812/packages/maven"
24-
25-
ThisBuild / resolvers += "gitlab" at gitlabRegistryEndpoint
26-
ThisBuild / credentials += Credentials(
27-
"GitLab Packages Registry",
28-
gitlabHost,
29-
"<token name>",
30-
"<token>"
31-
)
32-
22+
ThisBuild / resolvers += "Sonatype Central Snapshots" at "https://central.sonatype.com/repository/maven-snapshots"
3323
libraryDependencies += "it.agilelab" %% "wasp-consumers-spark" % "3.1.0-SNAPSHOT"
3424
```
3525
To download Wasp snapshot releases you need a personal access token or a project access token with read_api scope and role Developer to GitLab Wasp project.

project/Settings.scala

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,10 @@ class BasicSettings(
115115
System.getenv("SONATYPE_PASSWORD")
116116
)
117117

118-
val gitlabHost = "gitlab.com"
119-
val gitlabRegistryEndpoint = s"https://${gitlabHost}/api/v4/projects/3748812/packages/maven"
120-
val gitlabCredentials = Credentials(
121-
"GitLab Packages Registry",
122-
gitlabHost,
123-
"gitlab-ci-token",
124-
System.getenv().get("CI_JOB_TOKEN")
125-
)
126-
127118
lazy val publishSettings = Seq(
128-
publishTo := { if (isSnapshot.value) Some("GitLab" at gitlabRegistryEndpoint) else localStaging.value },
119+
publishTo := { if (isSnapshot.value) Some("central-snapshots" at centralSnapshots) else localStaging.value },
129120
publishMavenStyle := true,
130-
credentials ++= Seq(sonatypeCentralCredentials, gitlabCredentials),
121+
credentials ++= Seq(sonatypeCentralCredentials),
131122
pgpPassphrase := Option(System.getenv().get("PGP_PASSPHRASE")).map(_.toCharArray),
132123
Global / useGpg := false
133124
)

0 commit comments

Comments
 (0)