Sublime Forum

[Article] Fastest way to add new version of your Sublime Text 3 package

#1

Article.

1. Motivation

When I create new release for my Sublime Text package, I need:

  1. Add changelog to GitHub release page,
  2. Update Changelog.md,
  3. Update version in messages.json,
  4. Add changelog to messages/<version>.txt file,

It may take a lot of time. Possibly, another inexperienced developers of Sublime Text 3 packages have similar problems.

2. Demonstration

I push commit to my GitHub repository → I input in command line:

release-it --no-npm.publish -n -V

Result: 1, 2:

Changelog.md and messages.json:

messages/<version>.txt and package.json:

Releases page:

If you want to have same behavior, read the article.

Thanks.

4 Likes

#2

I update an article.

In 6.2.0 version author of release-it add new variables. Now we can use same content for each .release-it.json file:

{
    "buildCommand": "changelog -f - -u https:\/\/${repo.host}\/${repo.repository} | tee messages\/${version}.txt | cat - Changelog.md > temp && mv temp Changelog.md && sed -i '\/\\\"install\\\": \\\"messages\\\/install\\.txt\\\"\/i\\\"${version}\\\": \\\"messages\\\/${version}\\.txt\\\",' messages.json && js-beautify -r messages.json",
    "changelogCommand": "changelog -f -",
    "github": {
        "release": true,
        "tokenRef": "GITHUB_TOKEN"
    },
    "safeBump": false,
    "src": {
        "tagName": "st3-%s"
    }
}

Thanks.

0 Likes

#3

There’s an issue with your site - luckily I have stacked monitors to read everything but there is no way to scroll…

Also, I do something similar for certain actions… I use batch files for a lot of repetitive tasks by making each file a function then calling them as needed - here’s an example of a versioning management system to manage a version.txt file for some of my addons - it’s outdated but still works - I was planning on adding a projects system to it so one file could manage multiple version files and do more - they can easily be used to compile changelog files and more - https://bitbucket.org/Acecool/acecooldev_versioning

I have yet to check out your article, but from first glance it looks like it’ll be an interesting read - it’s always nice to see how others resolve efficiency problems.

1 Like

#4

Scrolling requires javascript (from cdn.jsdelivr.net), which isn’t the greatest user experience.


Thanks for the article and sharing your workflow. release-it might just be something that I could adopt, though I’m wary of the automatic changelog generation. I’ll probably try it one day or another anyway.

FYI, you can set npm.publish in the config as well, so you don’t have to provide it via CLI every time.

3 Likes

#5

Thanks, fixed!

Also, in 7.3.0 and higher release-it versions we need "addUntrackedFiles": true, option. Now .release-it.json file should look like this:

{
    "buildCommand": "changelog -f - -u https:\/\/${repo.host}\/${repo.repository} | tee messages\/${version}.txt | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md && sed -i '\/\\\"install\\\": \\\"messages\\\/install\\.txt\\\"\/i\\\"${version}\\\": \\\"messages\\\/${version}\\.txt\\\",' messages.json && js-beautify -r messages.json",
    "changelogCommand": "changelog -f -",
    "github": {
        "release": true,
        "tokenRef": "GITHUB_TOKEN"
    },
    "npm": {
        "publish": false
    },
    "safeBump": false,
    "src": {
        "addUntrackedFiles": true,
        "tagName": "st3-%s"
    }
}

Thanks.

0 Likes