makit 0.0.171 → 0.0.172

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59b32862b9a15f7bc6b3f93680fc73f36d57ecdc8cec339249558126bd5261a2
4
- data.tar.gz: dffc4f234ba2b273a24ab48318a1b2b4a18909d6c62cb2f3a1c27e6938cfda0c
3
+ metadata.gz: 3d33beba3997ecb2f3df901e594a88a7e297b0b9c668142e95f12e467695522f
4
+ data.tar.gz: 8379dea16c7a518519e8d911d666cf9d79a1adb241a0e8f1693d3bed54969f8a
5
5
  SHA512:
6
- metadata.gz: 4a222b4dd07bdfd09a32e30653302c66b66641b79673e74ce895de34220f7e6dc8282808f108682016b9547538ca93c7c11b03e4e848b62864f565678cc0a13f
7
- data.tar.gz: 99304381dd2c55a429638280e3c219020d756065ee435eeed96e9fe8327040587c2701bd43dde6ac675bfe81c95d6a0737b797c1da384e45d7538fa5a24e2c0b
6
+ metadata.gz: f9050bff2fb06f6f5a265ea874354c13711de49b2a764e603d1fc8505248852c3839164b5e778d5f2cdf06852b14cead94e3e29dce1d0b0f49e75c0ac88a170f
7
+ data.tar.gz: 0072df008c5b88eef16b6ebec531608a3efd9656028ace1caf7ef5c7566e4c4248165af9af2982346e045d55975888b3d1e7a5fa61b72ef5e8041234d7f8f862
data/lib/makit/nuget.rb CHANGED
@@ -64,6 +64,74 @@ module Makit
64
64
  system("dotnet nuget push #{path} --source #{path}")
65
65
  end
66
66
 
67
+ # Publishes a NuGet package to a remote or local NuGet feed
68
+ #
69
+ # This method pushes a .nupkg file to a NuGet source using `dotnet nuget push`.
70
+ # It automatically includes `--skip-duplicate` to avoid errors when the package
71
+ # version already exists on the feed.
72
+ #
73
+ # When an API key is provided, it is used for authentication but is masked
74
+ # in the console output for security. When no API key is provided (nil or empty),
75
+ # the `--api-key` flag is omitted, which is useful for:
76
+ # - Local directory feeds that don't require authentication
77
+ # - Azure DevOps feeds using Azure CLI authentication
78
+ # - Feeds with credential providers configured
79
+ #
80
+ # @param package [String] Path to the .nupkg file to publish
81
+ # @param api_key [String, nil] API key for authentication (nil to skip)
82
+ # @param source [String] NuGet feed URL or source name
83
+ # @return [void]
84
+ #
85
+ # @example Publish to NuGet.org with an API key
86
+ # api_key = ENV["NUGET_API_KEY"]
87
+ # Makit::NuGet.publish(
88
+ # "bin/Release/MyPackage.1.0.0.nupkg",
89
+ # api_key,
90
+ # "https://api.nuget.org/v3/index.json"
91
+ # )
92
+ #
93
+ # @example Publish to Azure DevOps feed (using Azure CLI auth, no API key needed)
94
+ # # First authenticate with: az login
95
+ # Makit::NuGet.publish(
96
+ # "artifacts/MyCompany.Utils.1.2.3.nupkg",
97
+ # nil,
98
+ # "https://pkgs.dev.azure.com/myorg/myproject/_packaging/myfeed/nuget/v3/index.json"
99
+ # )
100
+ #
101
+ # @example Publish to Azure DevOps feed with PAT token
102
+ # pat_token = ENV["AZURE_DEVOPS_PAT"]
103
+ # Makit::NuGet.publish(
104
+ # "artifacts/MyCompany.Utils.1.2.3.nupkg",
105
+ # pat_token,
106
+ # "https://pkgs.dev.azure.com/myorg/myproject/_packaging/myfeed/nuget/v3/index.json"
107
+ # )
108
+ #
109
+ # @example Publish to a local directory feed (no API key)
110
+ # Makit::NuGet.publish(
111
+ # "bin/Release/MyPackage.1.0.0.nupkg",
112
+ # nil,
113
+ # "/Users/louie/code/nuget"
114
+ # )
115
+ #
116
+ # @example Publish to a configured source by name
117
+ # # Using a source name configured via `dotnet nuget add source`
118
+ # Makit::NuGet.publish(
119
+ # "MyPackage.1.0.0.nupkg",
120
+ # nil,
121
+ # "local"
122
+ # )
123
+ #
124
+ # @example Publish with API key from secrets management
125
+ # api_key = Makit::Secrets.get("NUGET_API_KEY")
126
+ # Makit::NuGet.publish(
127
+ # "bin/Release/MyPackage.1.0.0.nupkg",
128
+ # api_key,
129
+ # "https://api.nuget.org/v3/index.json"
130
+ # )
131
+ #
132
+ # @see publish_to_directory For publishing to local directory feeds with deduplication
133
+ # @see configure_source For setting up NuGet sources
134
+ #
67
135
  def self.publish(package, api_key, source)
68
136
  if api_key.nil? || api_key.to_s.strip.empty?
69
137
  # No API key provided, skip --api-key flag
data/lib/makit/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Makit
4
4
  # Static version for now to avoid circular dependency issues
5
- #VERSION = "0.0.171"
5
+ #VERSION = "0.0.172"
6
6
 
7
7
  # Version management utilities for various file formats
8
8
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.171
4
+ version: 0.0.172
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow