Skip to content

Commit 090b5a1

Browse files
docs: add API
1 parent 0def155 commit 090b5a1

File tree

1 file changed

+271
-3
lines changed

1 file changed

+271
-3
lines changed

README.md

Lines changed: 271 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,279 @@
33
[![Go Report Card](https://goreportcard.com/badge/github.com/go-semantic-release/plugin-registry)](https://goreportcard.com/report/github.com/go-semantic-release/plugin-registry)
44
[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-semantic-release/plugin-registry)](https://pkg.go.dev/github.com/go-semantic-release/plugin-registry)
55

6-
## Usage
7-
*TODO*
6+
The plugin registry service for the go-semantic-release CLI tool provides information about available plugins. It leverages the GitHub API to fetch the latest releases and assets, ensuring that users have access to up-to-date information. The registry also includes caching and batch request capabilities, which allow multiple plugin assets to be bundled into a single, compressed archive for efficient and streamlined delivery.
7+
8+
## API
9+
10+
### GET [/api/v2/plugins](https://registry.go-semantic-release.xyz/api/v2/plugins)
11+
Returns a list of all available plugins.
12+
13+
<details>
14+
<summary>Example response body</summary>
15+
16+
```json
17+
[
18+
"provider-github",
19+
"provider-gitlab",
20+
"changelog-generator-default",
21+
"commit-analyzer-cz",
22+
"condition-default",
23+
"condition-github",
24+
"condition-gitlab",
25+
"files-updater-npm",
26+
"provider-git",
27+
"condition-bitbucket",
28+
"files-updater-helm",
29+
"hooks-goreleaser",
30+
"hooks-npm-binary-releaser",
31+
"hooks-plugin-registry-update"
32+
]
33+
```
34+
</details>
35+
36+
### GET [/api/v2/plugins/:plugin](https://registry.go-semantic-release.xyz/api/v2/plugins/provider-github)
37+
Returns information about a specific plugin.
38+
39+
40+
<details>
41+
<summary>Example response body</summary>
42+
43+
```json
44+
{
45+
"FullName": "provider-github",
46+
"Type": "provider",
47+
"Name": "github",
48+
"URL": "https://github.com/go-semantic-release/provider-github",
49+
"LatestRelease": {
50+
"Version": "1.14.0",
51+
"Prerelease": false,
52+
"CreatedAt": "2023-02-03T15:14:47Z",
53+
"Assets": {
54+
"darwin/amd64": {
55+
"FileName": "provider-github_v1.14.0_darwin_amd64",
56+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_darwin_amd64",
57+
"OS": "darwin",
58+
"Arch": "amd64",
59+
"Checksum": "5f1bdc2eccc99e158c525033a64dd490e6dca8f020bf700a2edf6d3e1cbba3c4"
60+
},
61+
"darwin/arm64": {
62+
"FileName": "provider-github_v1.14.0_darwin_arm64",
63+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_darwin_arm64",
64+
"OS": "darwin",
65+
"Arch": "arm64",
66+
"Checksum": "ce6bd1e591621d005fe0840a92f2e751a83d8b2280573832c3b81eae3f7e751e"
67+
},
68+
"linux/amd64": {
69+
"FileName": "provider-github_v1.14.0_linux_amd64",
70+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_amd64",
71+
"OS": "linux",
72+
"Arch": "amd64",
73+
"Checksum": "2ed8f28aec663ad549875abb6257fe333f99ac23aa337d0d53df84bbc10f2930"
74+
},
75+
"linux/arm": {
76+
"FileName": "provider-github_v1.14.0_linux_arm",
77+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_arm",
78+
"OS": "linux",
79+
"Arch": "arm",
80+
"Checksum": "b3a823b4ebb30136c27b48bcf92002c20abf59c297c278283db00800762b5ab4"
81+
},
82+
"linux/arm64": {
83+
"FileName": "provider-github_v1.14.0_linux_arm64",
84+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_arm64",
85+
"OS": "linux",
86+
"Arch": "arm64",
87+
"Checksum": "1bae4ef206c1a849e33fdef49b4b8b21aa81b05ca77f4043e632c35694373fc6"
88+
},
89+
"windows/amd64": {
90+
"FileName": "provider-github_v1.14.0_windows_amd64.exe",
91+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_windows_amd64.exe",
92+
"OS": "windows",
93+
"Arch": "amd64",
94+
"Checksum": "b4d2e2e8a9b4f6b278920869dc9bb0ce2fb85a9e79da1f210f0f1bf4baac6a56"
95+
}
96+
},
97+
"UpdatedAt": "2023-02-03T15:22:18.198347Z"
98+
},
99+
"Versions": [
100+
"1.0.0",
101+
"1.1.0",
102+
"1.1.1",
103+
"1.10.0",
104+
"1.11.0",
105+
"1.12.0",
106+
"1.13.0",
107+
"1.14.0",
108+
"1.2.0",
109+
"1.3.0",
110+
"1.4.0",
111+
"1.4.1",
112+
"1.5.0",
113+
"1.5.1",
114+
"1.5.2",
115+
"1.6.0",
116+
"1.6.1",
117+
"1.7.0",
118+
"1.8.0",
119+
"1.9.0"
120+
],
121+
"UpdatedAt": "2023-02-03T15:22:18.228101Z"
122+
}
123+
```
124+
</details>
125+
126+
### GET [/api/v2/plugins/:plugin/versions](https://registry.go-semantic-release.xyz/api/v2/plugins/provider-github/versions)
127+
Returns all plugin releases.
128+
129+
130+
<details>
131+
<summary>Example response body</summary>
132+
133+
```json
134+
[
135+
"1.0.0",
136+
"1.1.0",
137+
"1.1.1",
138+
"1.10.0",
139+
"1.11.0",
140+
"1.12.0",
141+
"1.13.0",
142+
"1.14.0",
143+
"1.2.0",
144+
"1.3.0",
145+
"1.4.0",
146+
"1.4.1",
147+
"1.5.0",
148+
"1.5.1",
149+
"1.5.2",
150+
"1.6.0",
151+
"1.6.1",
152+
"1.7.0",
153+
"1.8.0",
154+
"1.9.0"
155+
]
156+
```
157+
</details>
158+
159+
### GET [/api/v2/plugins/:plugin/versions/:version](https://registry.go-semantic-release.xyz/api/v2/plugins/provider-github/versions/1.14.0)
160+
Returns information about a specific plugin release.
161+
162+
163+
<details>
164+
<summary>Example response body</summary>
165+
166+
```json
167+
{
168+
"Version": "1.14.0",
169+
"Prerelease": false,
170+
"CreatedAt": "2023-02-03T15:14:47Z",
171+
"Assets": {
172+
"darwin/amd64": {
173+
"FileName": "provider-github_v1.14.0_darwin_amd64",
174+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_darwin_amd64",
175+
"OS": "darwin",
176+
"Arch": "amd64",
177+
"Checksum": "5f1bdc2eccc99e158c525033a64dd490e6dca8f020bf700a2edf6d3e1cbba3c4"
178+
},
179+
"darwin/arm64": {
180+
"FileName": "provider-github_v1.14.0_darwin_arm64",
181+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_darwin_arm64",
182+
"OS": "darwin",
183+
"Arch": "arm64",
184+
"Checksum": "ce6bd1e591621d005fe0840a92f2e751a83d8b2280573832c3b81eae3f7e751e"
185+
},
186+
"linux/amd64": {
187+
"FileName": "provider-github_v1.14.0_linux_amd64",
188+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_amd64",
189+
"OS": "linux",
190+
"Arch": "amd64",
191+
"Checksum": "2ed8f28aec663ad549875abb6257fe333f99ac23aa337d0d53df84bbc10f2930"
192+
},
193+
"linux/arm": {
194+
"FileName": "provider-github_v1.14.0_linux_arm",
195+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_arm",
196+
"OS": "linux",
197+
"Arch": "arm",
198+
"Checksum": "b3a823b4ebb30136c27b48bcf92002c20abf59c297c278283db00800762b5ab4"
199+
},
200+
"linux/arm64": {
201+
"FileName": "provider-github_v1.14.0_linux_arm64",
202+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_arm64",
203+
"OS": "linux",
204+
"Arch": "arm64",
205+
"Checksum": "1bae4ef206c1a849e33fdef49b4b8b21aa81b05ca77f4043e632c35694373fc6"
206+
},
207+
"windows/amd64": {
208+
"FileName": "provider-github_v1.14.0_windows_amd64.exe",
209+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_windows_amd64.exe",
210+
"OS": "windows",
211+
"Arch": "amd64",
212+
"Checksum": "b4d2e2e8a9b4f6b278920869dc9bb0ce2fb85a9e79da1f210f0f1bf4baac6a56"
213+
}
214+
},
215+
"UpdatedAt": "2023-02-03T15:22:18.198347Z"
216+
}
217+
```
218+
</details>
219+
220+
### POST [/api/v2/plugins/_batch](https://registry.go-semantic-release.xyz/api/v2/plugins/_batch)
221+
Returns information about multiple plugins and a download link to a compressed archive containing all plugins.
222+
223+
224+
<details>
225+
<summary>Example request body</summary>
226+
227+
```json
228+
{
229+
"OS": "linux",
230+
"Arch": "amd64",
231+
"Plugins": [
232+
{
233+
"FullName": "provider-github",
234+
"VersionConstraint": "latest"
235+
},
236+
{
237+
"FullName": "condition-github",
238+
"VersionConstraint": "^1.0.0"
239+
}
240+
]
241+
}
242+
```
243+
</details>
244+
245+
<details>
246+
<summary>Example response body</summary>
247+
248+
```json
249+
{
250+
"OS": "linux",
251+
"Arch": "amd64",
252+
"Plugins": [
253+
{
254+
"FullName": "condition-github",
255+
"VersionConstraint": "^1.0.0",
256+
"Version": "1.8.0",
257+
"FileName": "condition-github_v1.8.0_linux_amd64",
258+
"URL": "https://github.com/go-semantic-release/condition-github/releases/download/v1.8.0/condition-github_v1.8.0_linux_amd64",
259+
"Checksum": "6274fd728cb95fdf6863a2ef18d9a37179285e00a24aef6bed96def67eda4fcd"
260+
},
261+
{
262+
"FullName": "provider-github",
263+
"VersionConstraint": "latest",
264+
"Version": "1.14.0",
265+
"FileName": "provider-github_v1.14.0_linux_amd64",
266+
"URL": "https://github.com/go-semantic-release/provider-github/releases/download/v1.14.0/provider-github_v1.14.0_linux_amd64",
267+
"Checksum": "2ed8f28aec663ad549875abb6257fe333f99ac23aa337d0d53df84bbc10f2930"
268+
}
269+
],
270+
"DownloadHash": "5e1460e12232dbb785ca6774d0eb7fa6cf14a2212b72607e7c1070ffa8395a2a",
271+
"DownloadURL": "https://plugin-cache.go-semantic-release.xyz/archives/plugins-5e1460e12232dbb785ca6774d0eb7fa6cf14a2212b72607e7c1070ffa8395a2a.tar.gz",
272+
"DownloadChecksum": "900182d40199ca85c26ee707fbe5f8a5f8f219b7a1835bfa5e1623884b96af49"
273+
}
274+
```
275+
</details>
8276

9277
## Licence
10278

11279
The [MIT License (MIT)](http://opensource.org/licenses/MIT)
12280

13-
Copyright © 2022 [Christoph Witzko](https://twitter.com/christophwitzko)
281+
Copyright © 2023 [Christoph Witzko](https://twitter.com/christophwitzko)

0 commit comments

Comments
 (0)