Sublime Forum

How to host a .sublime-package in GitHub

#1

I’m trying to create my first couple of SublimeText plugins and the docs suggest I need to include the .sublime-package file. But I can’t work out how to do so and looking for tips?

I’m using Github, and it doesn’t look like authors include the sublime-package in repository code. So I’ve created a Tag manually, created a Release from this Tag and intended to upload the .sublime-package file to the release - however it’s not a valid file type in GitHub. So I’m a bit stumped. Can anyone help?

Thanks!

0 Likes

#2

.sublime-package is auto created by Package Control during downloading.

I believe Package Control download zip tarball by github tags, add a meta file into it and rename/repack it into a .sublime-package file, which is just a zip file with a different file extension.

0 Likes

#3

Do you know if there’s a worked example somewhere? I’ve tried looking at a few existing plugins to see how they work and they’re all terribly inconsistent leaving me more confused :confused:

0 Likes

#4

Not sure what you have seen but it’s literally how most (like >90% or maybe >95%) plugins work. And… there is nothing to see actually. It’s the default behavior…

0 Likes

#5

If you must want an example: https://github.com/glutanimate/sublime-deselect
Those are ALL source codes of the https://packagecontrol.io/packages/Deselect plugin.

0 Likes

#6

Hmm ok, thanks. So looking there there doesn’t seem to be any “.sublime-package” at all. Maybe I’ll try without and see what happens!

0 Likes

#7
  1. Just create a github repository for each package.
  2. Create SemVer compatible release tags
  3. Register the repository to Package Control’s default channel to be public.

Example:

A File Icon

Repository:

https://github.com/SublimeText/AFileIcon

Channel entry

You can attach sublime-package files for manual installation by

  1. git archive --format zip -o "Package.sublime-package" master from your local checked out worktree
  2. attach them to a GH release using “gh” CLI tool gh release create ...

Some authors of closed source packages decided to prebuild such sublime-package files and register direct links to them, but that’s not recommended for simple open-source packages using pure python plugins.

0 Likes

#8

Ok thanks! I’ve updated the package repository so will see if it get’s accepted.

0 Likes