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 +4 -4
- data/lib/makit/nuget.rb +68 -0
- data/lib/makit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d33beba3997ecb2f3df901e594a88a7e297b0b9c668142e95f12e467695522f
|
|
4
|
+
data.tar.gz: 8379dea16c7a518519e8d911d666cf9d79a1adb241a0e8f1693d3bed54969f8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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