From 5a50748b2596b82d6014d0dedae2e83328181dde Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 11:42:19 +0100 Subject: [PATCH 01/18] Preparing helm 4 test --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9f2391..3c8e3f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,12 +15,13 @@ jobs: name: ${{ matrix.java }} strategy: matrix: - java: [11, 17] + java: [17, 21, 25] runner: [ubuntu-latest] # macos-latest disabled due to inability to run docker and connect to it + helm: [3, 4] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v5 with: java-version: ${{ matrix.java }} - name: Setup sbt launcher @@ -31,7 +32,7 @@ jobs: docker compose -f src/test/resources/registries/compose.yaml up --build -d - name: Setup Helm binary run: | - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-${{ matrix.helm }} chmod 700 get_helm.sh ./get_helm.sh --version 3.14.2 helm repo add stable https://charts.helm.sh/stable From 14affa1ce794dfd13d030b80fd63da8f8f7fbb87 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 11:44:53 +0100 Subject: [PATCH 02/18] Preparing helm 4 test --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c8e3f3..9dc14a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ on: - "master" pull_request: workflow_call: + workflow_dispatch: jobs: test: From f157bbf755cc5c519d4ea7a2caa6653b74f8c5a1 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 11:48:22 +0100 Subject: [PATCH 03/18] Preparing helm 4 test --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dc14a4..c1f32cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: uses: actions/setup-java@v5 with: java-version: ${{ matrix.java }} + distribution: 'temurin' - name: Setup sbt launcher uses: sbt/setup-sbt@v1 - name: Setup Docker for Linux From 11ec0883c3058247aa9372441515b82740c77b44 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 11:52:39 +0100 Subject: [PATCH 04/18] Preparing helm 4 test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1f32cd..fea41f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: run: | curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-${{ matrix.helm }} chmod 700 get_helm.sh - ./get_helm.sh --version 3.14.2 + ./get_helm.sh helm repo add stable https://charts.helm.sh/stable helm repo update echo "Helm setup complete, running Helm version:" From 02e83209bccdcb89038b0df56a21f16785578493 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 12:05:41 +0100 Subject: [PATCH 05/18] Preparing helm 4 test Relaxing version check --- src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index 452c039..a7af515 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -233,7 +233,7 @@ object HelmPlugin extends AutoPlugin { log: Logger, ): Unit = { helmVersion match { - case VersionNumber(Seq(major, minor, _@_*), _, _) if major >= 3 && minor >= 8 => + case VersionNumber(Seq(major, minor, _@_*), _, _) if major >= 4 || major >= 3 && minor >= 8 => case _ => sys.error(s"Cannot login to OCI registry (Helm must be at least in 3.8.0 version): $helmVersion") } From ea2f5b918991183eafe22b109565aadbf8164158 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 12:46:06 +0100 Subject: [PATCH 06/18] Preparing helm 4 test Relaxing version check (however making it strict) Dropping JDK25 just yet --- .github/workflows/test.yml | 2 +- src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fea41f1..af33381 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: name: ${{ matrix.java }} strategy: matrix: - java: [17, 21, 25] + java: [17, 21] # 25 runner: [ubuntu-latest] # macos-latest disabled due to inability to run docker and connect to it helm: [3, 4] steps: diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index a7af515..00645e2 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -233,7 +233,7 @@ object HelmPlugin extends AutoPlugin { log: Logger, ): Unit = { helmVersion match { - case VersionNumber(Seq(major, minor, _@_*), _, _) if major >= 4 || major >= 3 && minor >= 8 => + case VersionNumber(Seq(major, minor, _@_*), _, _) if major == 4 || major == 3 && minor >= 8 => case _ => sys.error(s"Cannot login to OCI registry (Helm must be at least in 3.8.0 version): $helmVersion") } From daf865bc5437cfaa92410aa62094d6b5ad6eeda8 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 13:05:01 +0100 Subject: [PATCH 07/18] Support of Helm 4 Upgrading SBT itself --- project/build.properties | 2 +- src/sbt-test/shelm/add-repository/project/build.properties | 2 +- src/sbt-test/shelm/cache-usage/project/build.properties | 2 +- .../shelm/dep-update-overrides/project/build.properties | 2 +- src/sbt-test/shelm/duplicated/project/build.properties | 2 +- src/sbt-test/shelm/empty/project/build.properties | 2 +- src/sbt-test/shelm/includes/project/build.properties | 2 +- src/sbt-test/shelm/lint/project/build.properties | 2 +- src/sbt-test/shelm/modifications/project/build.properties | 2 +- src/sbt-test/shelm/multidoc/project/build.properties | 2 +- src/sbt-test/shelm/overrides-remote/project/build.properties | 2 +- src/sbt-test/shelm/overrides/project/build.properties | 2 +- src/sbt-test/shelm/programmatic/project/build.properties | 2 +- src/sbt-test/shelm/publish-cm/project/build.properties | 2 +- src/sbt-test/shelm/publish-oci/project/build.properties | 2 +- src/sbt-test/shelm/publish/project/build.properties | 2 +- src/sbt-test/shelm/registry-login/project/build.properties | 2 +- src/sbt-test/shelm/remote-chart-repo/project/build.properties | 2 +- src/sbt-test/shelm/remote-oci-registry/project/build.properties | 2 +- src/sbt-test/shelm/repository/project/build.properties | 2 +- src/sbt-test/shelm/simple-no-values/project/build.properties | 2 +- src/sbt-test/shelm/simple/project/build.properties | 2 +- src/sbt-test/shelm/wrappy/project/build.properties | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/project/build.properties b/project/build.properties index 338629a..924c8f2 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,2 +1,2 @@ -sbt.version = 1.9.8 +sbt.version = 1.11.7 # 1.3.13 https://github.com/sbt/sbt/issues/5308 \ No newline at end of file diff --git a/src/sbt-test/shelm/add-repository/project/build.properties b/src/sbt-test/shelm/add-repository/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/add-repository/project/build.properties +++ b/src/sbt-test/shelm/add-repository/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/cache-usage/project/build.properties b/src/sbt-test/shelm/cache-usage/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/cache-usage/project/build.properties +++ b/src/sbt-test/shelm/cache-usage/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/dep-update-overrides/project/build.properties b/src/sbt-test/shelm/dep-update-overrides/project/build.properties index baf5ff3..01a16ed 100644 --- a/src/sbt-test/shelm/dep-update-overrides/project/build.properties +++ b/src/sbt-test/shelm/dep-update-overrides/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.7 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/duplicated/project/build.properties b/src/sbt-test/shelm/duplicated/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/duplicated/project/build.properties +++ b/src/sbt-test/shelm/duplicated/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/empty/project/build.properties b/src/sbt-test/shelm/empty/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/empty/project/build.properties +++ b/src/sbt-test/shelm/empty/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/includes/project/build.properties b/src/sbt-test/shelm/includes/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/includes/project/build.properties +++ b/src/sbt-test/shelm/includes/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/lint/project/build.properties b/src/sbt-test/shelm/lint/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/lint/project/build.properties +++ b/src/sbt-test/shelm/lint/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/modifications/project/build.properties b/src/sbt-test/shelm/modifications/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/modifications/project/build.properties +++ b/src/sbt-test/shelm/modifications/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/multidoc/project/build.properties b/src/sbt-test/shelm/multidoc/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/multidoc/project/build.properties +++ b/src/sbt-test/shelm/multidoc/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/overrides-remote/project/build.properties b/src/sbt-test/shelm/overrides-remote/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/overrides-remote/project/build.properties +++ b/src/sbt-test/shelm/overrides-remote/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/overrides/project/build.properties b/src/sbt-test/shelm/overrides/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/overrides/project/build.properties +++ b/src/sbt-test/shelm/overrides/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/programmatic/project/build.properties b/src/sbt-test/shelm/programmatic/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/programmatic/project/build.properties +++ b/src/sbt-test/shelm/programmatic/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/publish-cm/project/build.properties b/src/sbt-test/shelm/publish-cm/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/publish-cm/project/build.properties +++ b/src/sbt-test/shelm/publish-cm/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/publish-oci/project/build.properties b/src/sbt-test/shelm/publish-oci/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/publish-oci/project/build.properties +++ b/src/sbt-test/shelm/publish-oci/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/publish/project/build.properties b/src/sbt-test/shelm/publish/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/publish/project/build.properties +++ b/src/sbt-test/shelm/publish/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/registry-login/project/build.properties b/src/sbt-test/shelm/registry-login/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/registry-login/project/build.properties +++ b/src/sbt-test/shelm/registry-login/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/remote-chart-repo/project/build.properties b/src/sbt-test/shelm/remote-chart-repo/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/remote-chart-repo/project/build.properties +++ b/src/sbt-test/shelm/remote-chart-repo/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/remote-oci-registry/project/build.properties b/src/sbt-test/shelm/remote-oci-registry/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/remote-oci-registry/project/build.properties +++ b/src/sbt-test/shelm/remote-oci-registry/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/repository/project/build.properties b/src/sbt-test/shelm/repository/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/repository/project/build.properties +++ b/src/sbt-test/shelm/repository/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/simple-no-values/project/build.properties b/src/sbt-test/shelm/simple-no-values/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/simple-no-values/project/build.properties +++ b/src/sbt-test/shelm/simple-no-values/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/simple/project/build.properties b/src/sbt-test/shelm/simple/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/simple/project/build.properties +++ b/src/sbt-test/shelm/simple/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 diff --git a/src/sbt-test/shelm/wrappy/project/build.properties b/src/sbt-test/shelm/wrappy/project/build.properties index abbbce5..01a16ed 100644 --- a/src/sbt-test/shelm/wrappy/project/build.properties +++ b/src/sbt-test/shelm/wrappy/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.11.7 From dca4c4a9b24a634f4c975700915ef33ba1497c90 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 15:16:26 +0100 Subject: [PATCH 08/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- .../kiemlicz/shelm/ChartDownloader.scala | 18 ++--- .../github/kiemlicz/shelm/ChartLocation.scala | 6 ++ .../io/github/kiemlicz/shelm/HelmPlugin.scala | 73 ++++++++++++------- src/sbt-test/shelm/publish-oci/build.sbt | 2 +- src/sbt-test/shelm/registry-login/build.sbt | 2 +- 5 files changed, 64 insertions(+), 37 deletions(-) diff --git a/src/main/scala/io/github/kiemlicz/shelm/ChartDownloader.scala b/src/main/scala/io/github/kiemlicz/shelm/ChartDownloader.scala index f1dd788..044ec9a 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/ChartDownloader.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/ChartDownloader.scala @@ -37,14 +37,14 @@ object ChartDownloader { def apply(uri: URI): CacheKey = CacheKey(sanitizeRepositoryName(uri.toString)) } - def download(chartLocation: ChartLocation, downloadDir: File, cacheDir: File, sbtLogger: Logger): File = { + def download(chartLocation: ChartLocation, downloadDir: File, cacheDir: File, helmPath: String, sbtLogger: Logger): File = { val cachedChartKey = chartLocation match { case ChartLocation.Remote(_, uri) => Some(CacheKey(FilenameUtils.getName(uri.getPath))) case ChartLocation.AddedRepository(name, ChartRepositoryName(repoName), Some(chartVersion)) => Some( CacheKey(repoName, name, chartVersion) ) case ChartLocation.RemoteRepository(name, uri, _, Some(chartVersion)) => Some(CacheKey(name, chartVersion, uri)) - case ChartLocation.RemoteOciRegistry(name, uri, Some(chartVersion)) => Some(CacheKey(name, chartVersion, uri)) + case ChartLocation.RemoteOciRegistry(name, uri, Some(chartVersion), _) => Some(CacheKey(name, chartVersion, uri)) case _ => Option.empty } cachedChartKey match { @@ -57,13 +57,13 @@ object ChartDownloader { f / chartLocation.chartName.name case f => sbtLogger.info(s"Cache miss for: ${chartLocation.chartName}") - download(chartLocation, f, sbtLogger) + download(chartLocation, f, helmPath, sbtLogger) } } ) IO.copyDirectory(chartInCacheLocation, downloadDir / chartLocation.chartName.name) downloadDir / chartLocation.chartName.name - case None => download(chartLocation, downloadDir, sbtLogger) + case None => download(chartLocation, downloadDir, helmPath, sbtLogger) } } @@ -72,7 +72,7 @@ object ChartDownloader { * @param chartLocation Chart reference * @return directory containing Chart */ - private def download(chartLocation: ChartLocation, downloadDir: File, sbtLogger: Logger): File = { + private def download(chartLocation: ChartLocation, downloadDir: File, helmPath: String, sbtLogger: Logger): File = { sbtLogger.info(s"Downloading Helm Chart from: ${chartLocation}") chartLocation match { case ChartLocation.Local(_, f) => @@ -90,7 +90,7 @@ object ChartDownloader { case ChartLocation.AddedRepository(ChartName(name), ChartRepositoryName(repoName), chartVersion) => val options = s"$repoName/$name -d $downloadDir${chartVersion.map(v => s" --version $v").getOrElse("")} --untar" IO.delete(downloadDir) - pullChart(options, sbtLogger) + pullChart(options, false, helmPath, sbtLogger) downloadDir / name case ChartLocation.RemoteRepository(ChartName(name), uri, auth, chartVersion) => val authOpts = HelmPlugin.chartRepositoryCommandFlags(auth) @@ -98,12 +98,12 @@ object ChartDownloader { chartVersion.map(v => s" --version $v").getOrElse("") } --untar" IO.delete(downloadDir) - pullChart(allOptions, sbtLogger) + pullChart(allOptions, false, helmPath, sbtLogger) downloadDir / name - case ChartLocation.RemoteOciRegistry(ChartName(name), uri, chartVersion) => + case ChartLocation.RemoteOciRegistry(ChartName(name), uri, chartVersion, insecure) => val allOptions = s"$uri -d $downloadDir${chartVersion.map(v => s" --version $v").getOrElse("")} --untar" IO.delete(downloadDir) - pullChart(allOptions, sbtLogger) + pullChart(allOptions, insecure, helmPath, sbtLogger) downloadDir / name } } diff --git a/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala b/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala index f031888..b58daa5 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala @@ -72,6 +72,7 @@ object ChartLocation { chartName: ChartName, uri: URI, chartVersion: Option[String] = None, + insecure: Boolean = false, ) extends ChartLocation } @@ -159,6 +160,7 @@ object ChartMuseumRepository { case class OciChartRegistry( uri: URI, auth: ChartRepositoryAuth = ChartRepositoryAuth.NoAuth, + insecure: Boolean = false, loginCommandDropsScheme: Boolean = true ) extends ChartHosting { require(uri.getScheme.startsWith("oci"), "OciChartRegistry URI must start with oci:// scheme") @@ -251,3 +253,7 @@ object ChartSettings { } case class PackagedChartInfo(chartName: ChartName, version: SemVer2, location: File) + +case class HelmSettings( + binaryPath: String, +) \ No newline at end of file diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index 00645e2..608a5cd 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -35,6 +35,7 @@ object HelmPlugin extends AutoPlugin { object autoImport { val Helm: Configuration = config("helm") + lazy val helmSettings = settingKey[HelmSettings]("Helm executable location and flags (in future versions)") lazy val registriesAuthLocation = settingKey[File]("Auth file location") lazy val registriesLoginEnabled = settingKey[Boolean]("If setupRegistries should perform login to OCI registries, true by default") // added only due to problems with credential helpers... lazy val repositories = settingKey[Seq[ChartHosting]]("Additional Repositories settings") // helm repo add or login @@ -55,6 +56,7 @@ object HelmPlugin extends AutoPlugin { lazy val packagesBin = taskKey[Seq[PackagedChartInfo]]("Create Helm Charts") lazy val baseHelmSettings: Seq[Setting[_]] = Seq( + helmSettings := HelmSettings("helm"), registriesAuthLocation := { val os = System.getProperty("os.name").toLowerCase val configPath = os match { @@ -70,7 +72,8 @@ object HelmPlugin extends AutoPlugin { downloadedChartsCache := new File("helm-cache"), chartSettings := Seq.empty[ChartSettings], helmVersion := { - val cmd = "helm version --template {{.Version}}" + val helmCmd = helmSettings.value.binaryPath + val cmd = s"$helmCmd version --template {{.Version}}" startProcess(cmd) match { case HelmProcessResult.Success(output) => VersionNumber(output.stdOut.replaceFirst("^v", "")) case HelmProcessResult.Failure(exitCode, output) => throw new HelmCommandException(output, exitCode) @@ -93,11 +96,12 @@ object HelmPlugin extends AutoPlugin { } else log.info("Cache hasn't been created yet") }, setupRegistries := Def.task { + val helmCmd = helmSettings.value.binaryPath val log = streams.value.log val helmVer = helmVersion.value val authLocation = registriesAuthLocation.value val ociLoginEnabled = registriesLoginEnabled.value - lazy val alreadyAdded = listRepos(log) //not moving to setting since setting will always be evaluated + lazy val alreadyAdded = listRepos(helmCmd, log) //not moving to setting since setting will always be evaluated lazy val alreadyLogin = listRegistries(authLocation, log) log.info("Setting up registries") @@ -105,19 +109,21 @@ object HelmPlugin extends AutoPlugin { case r: Repository => alreadyAdded.contains(RepoListEntry(r.name(), r.uri())) case r: OciChartRegistry => alreadyLogin.contains(r.loginUri) }.foreach { - case r: IvyCompatibleHttpChartRepository => ensureRepo(r, log) - case r: ChartMuseumRepository => ensureRepo(r, log) - case r: OciChartRegistry if ociLoginEnabled => loginRepo(r, helmVer, log) + case r: IvyCompatibleHttpChartRepository => ensureRepo(r, helmCmd, log) + case r: ChartMuseumRepository => ensureRepo(r, helmCmd, log) + case r: OciChartRegistry if ociLoginEnabled => loginRepo(r, helmVer, helmCmd, log) case r: OciChartRegistry => log.info(s"Skipping login to OCI $r, enable using registriesLoginEnabled setting") } }.tag(Tags.Network).value, updateRepositories := { + val helmCmd = helmSettings.value.binaryPath val log = streams.value.log - updateRepo(log) + updateRepo(helmCmd, log) }, chartMappings := { s => ChartMappings(s, target.value) }, prepare := Def.task { val log = streams.value.log + val helmCmd = helmSettings.value.binaryPath val helmVer = helmVersion.value helmVer match { case VersionNumber(Seq(major, _@_*), _, _) if major >= 3 => @@ -136,6 +142,7 @@ object HelmPlugin extends AutoPlugin { mappings.settings.chartLocation, target.value / s"${mappings.settings.chartLocation.chartName.name}-$idx", downloadedChartsCache.value, + helmCmd, log ) val chartYaml = readChart(tempChartDir / ChartYaml) @@ -144,7 +151,7 @@ object HelmPlugin extends AutoPlugin { if (updatedChartYaml.dependencies != chartYaml.dependencies) { IO.write(tempChartDir / ChartYaml, yaml.printer.print(updatedChartYaml.asJson)) } - updateDependencies(tempChartDir, log) + updateDependencies(tempChartDir, helmCmd, log) (tempChartDir ** "*.tgz").get() .foreach { f => ChartDownloader.extractArchive(f.toURI, tempChartDir / DependenciesPath) @@ -196,12 +203,14 @@ object HelmPlugin extends AutoPlugin { }.tag(SbtTags.Prepare).value, lint := Def.task { val log = streams.value.log + val helmCmd = helmSettings.value.binaryPath val helmVer = helmVersion.value prepare.value.map { case (chartDir, m: ChartMappings) => - (lintChart(chartDir, m.lintSettings, helmVer, log), m) + (lintChart(chartDir, m.lintSettings, helmVer, helmCmd, log), m) } }.tag(SbtTags.Lint).value, packagesBin := Def.task { + val helmCmd = helmSettings.value.binaryPath lint.value.map { case (linted, m: ChartMappings) => val chartYaml = readChart(linted / ChartYaml) val location = buildChart( @@ -209,6 +218,7 @@ object HelmPlugin extends AutoPlugin { chartYaml.name, chartYaml.version, m.destination, + helmCmd, streams.value.log, ) PackagedChartInfo(chartYaml.name, SemVer2(chartYaml.version), location) @@ -230,6 +240,7 @@ object HelmPlugin extends AutoPlugin { private[this] def loginRepo( registry: OciChartRegistry, helmVersion: VersionNumber, + helmCmd: String, log: Logger, ): Unit = { helmVersion match { @@ -240,7 +251,7 @@ object HelmPlugin extends AutoPlugin { val loginUri = registry.loginUri.toString log.info(s"Logging to OCI $registry with URI: $loginUri") val options = chartRepositoryCommandFlags(registry.auth) - val cmd = s"helm registry login $loginUri $options" + val cmd = s"$helmCmd registry login $loginUri $options" startProcess(cmd) match { case HelmProcessResult.Failure(exitCode, output) => throw new HelmRegistryLoginException(output, exitCode, registry) //too much hussle in swallowing output..., scripted cannot print debug logs @@ -253,16 +264,16 @@ object HelmPlugin extends AutoPlugin { * Doesn't work for OCI * https://github.com/helm/helm/issues/10565 */ - private[this] def ensureRepo(repo: Repository, log: Logger): Unit = { + private[this] def ensureRepo(repo: Repository, helmPath: String, log: Logger): Unit = { log.info(s"Adding Legacy $repo to Helm Repositories") val options = chartRepositoryCommandFlags(repo.auth()) - val cmd = s"helm repo add ${repo.name().name} ${repo.uri()} $options" + val cmd = s"$helmPath repo add ${repo.name().name} ${repo.uri()} $options" HelmProcessResult.getOrThrow(startProcess(cmd)) } - private[this] def updateRepo(log: Logger): Unit = { + private[this] def updateRepo(helmPath: String, log: Logger): Unit = { log.info("Updating Helm Repositories") - HelmProcessResult.getOrThrow(startProcess("helm repo update")) + HelmProcessResult.getOrThrow(startProcess(s"$helmPath repo update")) } private[this] def listRegistries(authFile: File, log: Logger): Set[URI] = { @@ -281,9 +292,9 @@ object HelmPlugin extends AutoPlugin { } } - private[this] def listRepos(log: Logger): Set[RepoListEntry] = { + private[this] def listRepos(helmPath: String, log: Logger): Set[RepoListEntry] = { log.info("Listing Helm Repositories") - val output = HelmProcessResult.getOrThrow(startProcess("helm repo list -o yaml")) + val output = HelmProcessResult.getOrThrow(startProcess(s"$helmPath repo list -o yaml")) val existingRepos = for { fileContent <- yaml.parser.parse(output.stdOut) r <- fileContent.as[Seq[RepoListEntry]] @@ -297,12 +308,18 @@ object HelmPlugin extends AutoPlugin { } } - private[this] def updateDependencies(chartDir: File, log: Logger): Unit = { + private[this] def updateDependencies(chartDir: File, helmPath: String, log: Logger): Unit = { log.info("Updating Helm Chart's dependencies") - retrying(s"helm dependency update $chartDir ", log) // due to potential parallel runs... + retrying(s"$helmPath dependency update $chartDir ", log) // due to potential parallel runs... } - private[this] def lintChart(chartDir: File, lintSettings: LintSettings, helmVersion: VersionNumber, log: Logger): File = { + private[this] def lintChart( + chartDir: File, + lintSettings: LintSettings, + helmVersion: VersionNumber, + helmPath: String, + log: Logger + ): File = { log.info("Linting Helm Package") if (lintSettings.strictLint) { helmVersion match { @@ -312,15 +329,16 @@ object HelmPlugin extends AutoPlugin { } val strictOpt = if (lintSettings.strictLint) " --strict" else "" val kubeVersion = lintSettings.kubeVersion.map(v => s" --kube-version $v").getOrElse("") - val cmd = s"helm lint $chartDir$strictOpt$kubeVersion" + val cmd = s"$helmPath lint $chartDir$strictOpt$kubeVersion" startProcess(cmd) match { case HelmProcessResult.Failure(exitCode, output) if lintSettings.fatalLint => throw new HelmCommandException(output, exitCode) case _ => chartDir } } - private[shelm] def pullChart(options: String, log: Logger): Unit = { - val cmd = s"helm pull $options" + private[shelm] def pullChart(options: String, insecure: Boolean, helmPath: String, log: Logger): Unit = { + val plainHttp = if (insecure) " --plain-http" else "" + val cmd = s"$helmPath pull$plainHttp $options" retrying(cmd, log) } @@ -329,10 +347,11 @@ object HelmPlugin extends AutoPlugin { chartName: ChartName, chartVersion: String, targetDir: File, + helmPath: String, log: Logger, ): File = { val dest = s" -d $targetDir" - val cmd = s"helm package$dest $chartDir" + val cmd = s"$helmPath package$dest $chartDir" val output = targetDir / s"${chartName.name}-$chartVersion.tgz" log.info(s"Creating Helm Package: $cmd") retrying(cmd, log) @@ -455,6 +474,7 @@ object HelmPublishPlugin extends AutoPlugin { streams.value.log.info("No OCI registries configured for publishing") }, Def.task { + val helmPath = helmSettings.value.binaryPath val log = streams.value.log log.info("Starting Helm Charts OCI or CM push") /* @@ -463,10 +483,10 @@ object HelmPublishPlugin extends AutoPlugin { val errors = publishToHosting.value.collect { case r: ChartMuseumRepository => chartMuseumClient.value.chartMuseumPublishBlocking(r, publishChartMuseumConfiguration.value, log) - case OciChartRegistry(uri, _, _) => + case OciChartRegistry(uri, _, insecure, _) => sequence( publishOCIConfiguration.value.artifacts.map { - case (_, file) => pushChart(file, uri, log) + case (_, file) => pushChart(file, uri, insecure, helmPath, log) }.toList ) }.collect { @@ -536,9 +556,10 @@ object HelmPublishPlugin extends AutoPlugin { * @param registryUri URI prefixed with `oci://` scheme */ private[shelm] def pushChart( - chartLocation: File, registryUri: URI, log: Logger + chartLocation: File, registryUri: URI, insecure: Boolean, helmPath: String, log: Logger ): Either[Throwable, Unit] = { - val cmd = s"helm push $chartLocation $registryUri" + val plainHttpFlag = if (insecure) " --plain-http" else "" + val cmd = s"$helmPath push$plainHttpFlag $chartLocation $registryUri" log.info(s"Publishing Helm Chart: $cmd") throwableToLeft(HelmPlugin.retrying(cmd, log, n = 1)) } diff --git a/src/sbt-test/shelm/publish-oci/build.sbt b/src/sbt-test/shelm/publish-oci/build.sbt index 229374d..d92e237 100644 --- a/src/sbt-test/shelm/publish-oci/build.sbt +++ b/src/sbt-test/shelm/publish-oci/build.sbt @@ -17,7 +17,7 @@ lazy val root = (project in file(".")) IvyCompatibleHttpChartRepository(ChartRepositoryName("stable"), URI.create("https://charts.helm.sh/stable")), IvyCompatibleHttpChartRepository(ChartRepositoryName("cilium"), URI.create("https://helm.cilium.io/")), // OciChartRegistry(URI.create("oci://registry-1.docker.io/kiemlicz/"), ChartRepositoryAuth.Bearer("XXX", Some("kiemlicz"))), - OciChartRegistry(URI.create("oci://localhost:5011/test/"), ChartRepositoryAuth.UserPassword("test", "test")), + OciChartRegistry(URI.create("oci://localhost:5011/test/"), ChartRepositoryAuth.UserPassword("test", "test"), insecure=true), ), Helm / publishTo := Some(Resolver.file("local", file("/tmp/repo/"))(Patterns("[chartMajor].[chartMinor].[chartPatch]/[artifact]-[chartVersion].[ext]"))), resolvers += Resolver.file("local", file("./repo/"))( diff --git a/src/sbt-test/shelm/registry-login/build.sbt b/src/sbt-test/shelm/registry-login/build.sbt index 248fc3c..d671331 100644 --- a/src/sbt-test/shelm/registry-login/build.sbt +++ b/src/sbt-test/shelm/registry-login/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")) IvyCompatibleHttpChartRepository(ChartRepositoryName("stable"), URI.create("https://charts.helm.sh/stable")), IvyCompatibleHttpChartRepository(ChartRepositoryName("cilium"), URI.create("https://helm.cilium.io/")), // OciChartRegistry(URI.create("oci://registry-1.docker.io/kiemlicz/"), ChartRepositoryAuth.Bearer("XXX", Some("kiemlicz"))), - OciChartRegistry(URI.create("oci://localhost:5011/test/"), ChartRepositoryAuth.UserPassword("test", "test")), + OciChartRegistry(URI.create("oci://localhost:5011/test/"), ChartRepositoryAuth.UserPassword("test", "test"), insecure=true), ), Helm / prepare := { (Helm / setupRegistries).value From 1af7f8880eca4fb73035e968ff72e0e23443bbac Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 15:26:52 +0100 Subject: [PATCH 09/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index 608a5cd..df151fe 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -251,7 +251,8 @@ object HelmPlugin extends AutoPlugin { val loginUri = registry.loginUri.toString log.info(s"Logging to OCI $registry with URI: $loginUri") val options = chartRepositoryCommandFlags(registry.auth) - val cmd = s"$helmCmd registry login $loginUri $options" + val plainHttp = if(registry.insecure) " --plain-http" else "" + val cmd = s"$helmCmd registry login$plainHttp $loginUri $options" startProcess(cmd) match { case HelmProcessResult.Failure(exitCode, output) => throw new HelmRegistryLoginException(output, exitCode, registry) //too much hussle in swallowing output..., scripted cannot print debug logs From 05976d151fe7582e60088ba98e0a6e35c1724a4f Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 16:34:48 +0100 Subject: [PATCH 10/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- .../io/github/kiemlicz/shelm/ChartLocation.scala | 12 +++++++++++- .../scala/io/github/kiemlicz/shelm/HelmPlugin.scala | 9 ++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala b/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala index b58daa5..771f78a 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/ChartLocation.scala @@ -1,6 +1,7 @@ package io.github.kiemlicz.shelm import io.circe.{Decoder, Encoder, Json} +import sbt.librarymanagement.VersionNumber import java.io.File import java.net.URI @@ -165,7 +166,16 @@ case class OciChartRegistry( ) extends ChartHosting { require(uri.getScheme.startsWith("oci"), "OciChartRegistry URI must start with oci:// scheme") - def loginUri: URI = if (loginCommandDropsScheme) new URI(uri.toString.replaceFirst("^oci://", "")) else uri + def loginArg(helmVer: VersionNumber): URI = { + helmVer match { + case VersionNumber(Seq(major, _, _@_*), _, _) if major == 4 => + val host = uri.getHost + val port = if (uri.getPort == -1) "" else s":${uri.getPort}" + new URI(s"$host$port") + case VersionNumber(Seq(major, _, _@_*), _, _) if major == 3 => + if (loginCommandDropsScheme) new URI(uri.toString.replaceFirst("^oci://", "")) else uri + } + } } /** diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index df151fe..f05014f 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -107,7 +107,7 @@ object HelmPlugin extends AutoPlugin { repositories.value.filterNot { case r: Repository => alreadyAdded.contains(RepoListEntry(r.name(), r.uri())) - case r: OciChartRegistry => alreadyLogin.contains(r.loginUri) + case r: OciChartRegistry => alreadyLogin.contains(r.loginArg(helmVer)) }.foreach { case r: IvyCompatibleHttpChartRepository => ensureRepo(r, helmCmd, log) case r: ChartMuseumRepository => ensureRepo(r, helmCmd, log) @@ -243,15 +243,14 @@ object HelmPlugin extends AutoPlugin { helmCmd: String, log: Logger, ): Unit = { - helmVersion match { - case VersionNumber(Seq(major, minor, _@_*), _, _) if major == 4 || major == 3 && minor >= 8 => + val loginUri = helmVersion match { + case v@VersionNumber(Seq(major, minor, _@_*), _, _) if major == 4 || major == 3 && minor >= 8 => registry.loginArg(v).toString case _ => sys.error(s"Cannot login to OCI registry (Helm must be at least in 3.8.0 version): $helmVersion") } - val loginUri = registry.loginUri.toString log.info(s"Logging to OCI $registry with URI: $loginUri") val options = chartRepositoryCommandFlags(registry.auth) - val plainHttp = if(registry.insecure) " --plain-http" else "" + val plainHttp = if (registry.insecure) " --plain-http" else "" val cmd = s"$helmCmd registry login$plainHttp $loginUri $options" startProcess(cmd) match { case HelmProcessResult.Failure(exitCode, output) => From 92b1624883dc4de5f91a8f46fa604938b91a90f5 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 16:35:04 +0100 Subject: [PATCH 11/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af33381..fea41f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: name: ${{ matrix.java }} strategy: matrix: - java: [17, 21] # 25 + java: [17, 21, 25] runner: [ubuntu-latest] # macos-latest disabled due to inability to run docker and connect to it helm: [3, 4] steps: From a29ea67ebddbca9b35ec0daed3ce6fac0ebebbb9 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 16:47:20 +0100 Subject: [PATCH 12/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7be4423..f94488e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,13 +13,14 @@ jobs: release: # fixme wait for test-release it goes in parallel: https://github.com/kiemlicz/shelm/actions/runs/8270700884 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v5 with: - java-version: 17 + java-version: 21 + distribution: 'temurin' - name: Setup sbt launcher uses: sbt/setup-sbt@v1 - name: Release From 587c4c39335c8b1e2c0f62aa4c70753310a9e2b4 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 18:00:59 +0100 Subject: [PATCH 13/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 --- build.sbt | 2 +- project/plugins.sbt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index ff6bd09..362bacc 100644 --- a/build.sbt +++ b/build.sbt @@ -47,7 +47,7 @@ lazy val root = (project in file(".")) def mavenCentralSettings(): Seq[Def.Setting[_]] = { val shelmRepoUrl = "https://github.com/kiemlicz/shelm" - val sonatypeHost = "s01.oss.sonatype.org" + val sonatypeHost = "central.sonatype.com" Seq( credentials += { for { diff --git a/project/plugins.sbt b/project/plugins.sbt index c4c9a7c..db95377 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,5 +2,5 @@ logLevel := Level.Warn addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("com.rallyhealth.sbt" % "sbt-git-versioning" % "1.6.0") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7") \ No newline at end of file +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2") \ No newline at end of file From a5ad4a85ab1c30150be914f6abfca73384101588 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 18:13:58 +0100 Subject: [PATCH 14/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 WIP release ... --- .github/workflows/release.yml | 2 +- build.sbt | 24 +----------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f94488e..a62fa3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: echo "$PGP_KEY" | gpg --import git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - sbt publishSigned sonatypeRelease + sbt publishSigned sonaRelease env: MVN_USERNAME: ${{ secrets.MVN_USERNAME }} MVN_TOKEN: ${{ secrets.MVN_TOKEN }} diff --git a/build.sbt b/build.sbt index 362bacc..c8fb7a8 100644 --- a/build.sbt +++ b/build.sbt @@ -65,29 +65,7 @@ def mavenCentralSettings(): Seq[Def.Setting[_]] = { sonatypeCredentialHost := sonatypeHost, pomIncludeRepository := (_ => false), publishMavenStyle := true, + sbtPluginPublishLegacyMavenStyle := false, scmInfo := Some(ScmInfo(url(shelmRepoUrl), s"scm:https://github.com/kiemlicz/${name.value}.git")) ) } - -def githubSettings(): Seq[Def.Setting[_]] = { - //Dedicated access token must be provided for every user of this package - val ghRepoUrl: String = s"https://maven.pkg.github.com/kiemlicz/shelm" - val ghRepo: MavenRepository = "GitHub Package Registry".at(ghRepoUrl) - Seq( - credentials += sys.env - .get("GITHUB_TOKEN") - .map(token => - Credentials( - "GitHub Package Registry", - "maven.pkg.github.com", - "_", - token, - ) - ), - publishTo := Some(ghRepo), - pomIncludeRepository := (_ => false), - publishMavenStyle := true, - resolvers ++= Seq(ghRepo), - scmInfo := Some(ScmInfo(url(ghRepoUrl), s"scm:git@github.com:kiemlicz/${name.value}.git")) - ) -} From 1320bcfc5b1250c4bd9e962d2df3109579922e42 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 18:16:03 +0100 Subject: [PATCH 15/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 WIP release ... --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index c8fb7a8..a7cd9db 100644 --- a/build.sbt +++ b/build.sbt @@ -61,7 +61,7 @@ def mavenCentralSettings(): Seq[Def.Setting[_]] = { ) }, pgpSigningKey := sys.env.get("PGP_KEY_ID"), - publishTo := sonatypePublishTo.value, + publishTo := sonatypePublishToBundle.value, sonatypeCredentialHost := sonatypeHost, pomIncludeRepository := (_ => false), publishMavenStyle := true, From 9bbb9dc67df66681d5ffb19959b02d175163e6ab Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 18:23:09 +0100 Subject: [PATCH 16/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 WIP release ... --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a62fa3d..9006387 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: echo "$PGP_KEY" | gpg --import git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - sbt publishSigned sonaRelease + sbt publishSigned sonaUpload sonaRelease env: MVN_USERNAME: ${{ secrets.MVN_USERNAME }} MVN_TOKEN: ${{ secrets.MVN_TOKEN }} From df7094e3831dfd4bd43490f433a8940868123b9b Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Sat, 13 Dec 2025 18:26:38 +0100 Subject: [PATCH 17/18] Support of Helm 4 Externalized helm path and added proper support for insecure registries, probably handling changed in helm 4 WIP release ... --- build.sbt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index a7cd9db..03b9140 100644 --- a/build.sbt +++ b/build.sbt @@ -61,7 +61,11 @@ def mavenCentralSettings(): Seq[Def.Setting[_]] = { ) }, pgpSigningKey := sys.env.get("PGP_KEY_ID"), - publishTo := sonatypePublishToBundle.value, + publishTo := { + val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/" + if (isSnapshot.value) Some("central-snapshots" at centralSnapshots) + else localStaging.value + }, sonatypeCredentialHost := sonatypeHost, pomIncludeRepository := (_ => false), publishMavenStyle := true, From e4bb452e27d35d975ecb8811f3dd3df4a447f878 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Mon, 15 Dec 2025 17:30:37 +0100 Subject: [PATCH 18/18] Support of Helm 4 More open check Added in lint too --- src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala index f05014f..501cbbf 100644 --- a/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala +++ b/src/main/scala/io/github/kiemlicz/shelm/HelmPlugin.scala @@ -244,7 +244,7 @@ object HelmPlugin extends AutoPlugin { log: Logger, ): Unit = { val loginUri = helmVersion match { - case v@VersionNumber(Seq(major, minor, _@_*), _, _) if major == 4 || major == 3 && minor >= 8 => registry.loginArg(v).toString + case v@VersionNumber(Seq(major, minor, _@_*), _, _) if major > 3 || major == 3 && minor >= 8 => registry.loginArg(v).toString case _ => sys.error(s"Cannot login to OCI registry (Helm must be at least in 3.8.0 version): $helmVersion") } @@ -323,7 +323,7 @@ object HelmPlugin extends AutoPlugin { log.info("Linting Helm Package") if (lintSettings.strictLint) { helmVersion match { - case VersionNumber(Seq(major, minor, _@_*), _, _) if major >= 3 && minor >= 14 => + case VersionNumber(Seq(major, minor, _@_*), _, _) if major > 3 || major == 3 && minor >= 14 => case _ => sys.error(s"Cannot perform helm lint --strict (Helm must be at least in 3.14.0 version): $helmVersion") } }