You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,31 @@ In the next section, we will show you how to publish your package with a `hellow
19
19
20
20
NOTE: If you want to publish your KCL package to the kcl-lang official registry, then the source code of your KCL package will be saved in this repo, you need to submit the source code of your package to this repository via PR.
21
21
22
+
### Prepare your KCL package
23
+
24
+
By the `kpm init <package_name>` command, you can create a valid KCL package.
25
+
26
+
Currently, the directory structure of a valid kcl package that the repository can recognize is as follows:
27
+
28
+
```
29
+
<package_name>
30
+
|- kcl.mod (required)
31
+
|- kcl.mod.lock (optional)
32
+
|- artifacthub-pkg.yaml (optional)
33
+
|- README.md (optional)
34
+
|- (*.k) kcl program files
35
+
```
36
+
37
+
- kcl.mod : As the identification file of the KCL package, this file is **required**, and the directory containing the kcl.mod file will be identified as the root directory of the file.
38
+
39
+
- kcl.mod.lock : Automatically generated file to fix dependency versions, this file is **optional** and does not need to be manually modified.
40
+
41
+
- artifacthub-pkg.yaml : This file is **optional**, because our repository currently displays all packages through artifacthub.io, you can configure the information you want to show through artifacthub-pkg.yaml. Our strategy is that **if there is a configuration file named artifacthub-pkg.yaml in the directory where your package's kcl.mod file is located, then we will use the artifacthub-pkg.yaml you provided to display the information of your package, otherwise, we will use some default information to generate the corresponding artifacthub-pkg.yaml file.**
42
+
43
+
- README.md : A markdown file as the documentation for your package, this file is **optional**, **if you do not provide this file, it will not be displayed on artifacthub.io**.
44
+
45
+
- (*.k) kcl program files: The source code of your KCL program.
46
+
22
47
### Publish your package by PR
23
48
24
49
#### 1. Clone the code repository
@@ -86,3 +111,19 @@ Finally, you need to submit a PR to the main branch of the repository with your
86
111
87
112
-[How to create PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
88
113
114
+
### Upgrade your package by PR
115
+
116
+
After completing the upload of the package content, you can upgrade your package by PR.
117
+
118
+
NOTE: **We do not provide any upgrade strategy that changes the content of the package but does not change the version number.** If you want to upgrade your package and want your upgraded package to be displayed on AH, you need to modify the version number of your package. That is, the version field in the package section of the kcl.mod file.
119
+
120
+
```
121
+
[package]
122
+
name = "my_package"
123
+
edition = "*"
124
+
version = "0.1.0" # change this field to upgrade your package
125
+
description = "This is my package."
126
+
```
127
+
128
+
**At the same time, you cannot upload the same version package multiple times.** Once the version number of your package has been used, you will not be able to use this version number again. The only way to upload this package again is to upgrade the version number.
0 commit comments