Creating your own metadata repositories - KSP-CKAN/CKAN GitHub Wiki
CKAN supports using multiple metadata repositories. This is useful if you have mods of your own that you wish CKAN managed or want to use prereleases.
- First, you will need .netkan files. Refer to Creating your own netkan files.
- Once you have one or more such files, download them and place them in a folder.
- Download netkan.exe and place it in the same folder.
- Open a Command Prompt/Terminal window, navigate to that folder, and type in netkan.exe xxx.netkan (replace xxx with the name of your netkan file) --verbose.
- Netkan.exe will attempt to "inflate" the .netkan file, which means it uses the information in said file, to create a .ckan file with information for a specific release of your mod. With the --verbose flag, it prints messages about its progress.
- If all is good, it will print a message like this:
Transformation written to .\(mod identifier here)-(mod version here).ckan
- Copy the link to this repository
- Open CKAN settings
- Under "Metadata Repositories", press new. Fill in the name field with anything you want.
- Paste the link to your repository, then add /archive/main.tar.gz to the end
- When done, the link should look as follows:
https://github.com/(your username)/(your repo name)/archive/main.tar.gz
Close the settings window and update repositories. The new mod should now appear in CKAN. When releasing a new version, run netkan.exe again and add the resulting .ckan to your repository.
If you receive this error:
[1] WARN CKAN.NetKAN.Transformers.GithubTransformer (null) - No releases found for ProgrammerFailure/My-KSP-patches
[1] FATAL CKAN.NetKAN.Program (null) - ProgrammerFailure-KSP-Patches missing required field download
It is likely because your github repository has no assets attached to it (The release has only Source code available to download). You can correct this by adding the following field to your .netkan:
x_netkan_github:
use_source_archive: true
Alternatively, you may specify a download & version in the netkan manually (see optional overrides in the metadata webtool). If you choose to do this, you will need to change the download & version with each new release, before rerunning netkan.exe.