XF 2.1 How to make a new release of existing add-on?

sajal

Active member
I've made a custom add-on with 1.0.0 version, and now I've added a few features into it, and I want to release it as a 1.0.1, what's the standard process for that?

Do I need to modify the addon.json manually to change the version number and then run the xf-addon:build-release command?
 
Bump version: php cmd.php xf-addon:bump-version OzzModz/Refreshonline --version-id 1000170 --version-string 1.0.1

Build Addon: php cmd.php xf-addon:build-release OzzModz/Refreshonline
 
You can run the bump-version command without any options.

It prompts you for the values it requires, plus it reads back to you the current values. Also the string isn't required in either case because it can be automatically inferred from the version ID if it follows our recommended format.
 
You can run the bump-version command without any options.

It prompts you for the values it requires, plus it reads back to you the current values. Also the string isn't required in either case because it can be automatically inferred from the version ID if it follows our recommended format.

How does one use that, what's the command php cmd.php xf-addon:bump-version OzzModz/Refreshonline?
 
If only it would have me reconfirm the version ID though. How many times have I bumped add-ons to version 10.X and had to go into the DB to rectify that. 😔

I have had to go int the DB a few times myself to correct that.
 
Don't forget you can use the -help argument on any command to find more info:
Code:
% php cmd.php xf-addon:bump-version -help
Usage:
  xf-addon:bump-version [options] [--] <id>

Arguments:
  id                                   Add-On ID

Options:
      --version-id=VERSION-ID          If provided, this will be used as the new version ID
      --version-string=VERSION-STRING  If provided, this will be used as the new version string
      --from-json                      Bump the add-on version in the database from the specified addon.json
  -f, --force                          Skip validation of version ID (ignores downgrades)
  -h, --help                           Display this help message
  -q, --quiet                          Do not output any message
  -V, --version                        Display this application version
      --ansi                           Force ANSI output
      --no-ansi                        Disable ANSI output
  -n, --no-interaction                 Do not ask any interactive question
  -v|vv|vvv, --verbose                 Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Bumps the version of the specified add-on
 
Unfortunately that doesn't update the xf_addon table with the correct version so you then either have to sync the JSON file or actually perform an upgrade of the add-on in the Admin CP.

The main problem with the JSON and database being out of sync is that if you modify any templates, the templates will have a change version of the add-on as per the database rather than the JSON file.
 
Unfortunately that doesn't update the xf_addon table with the correct version so you then either have to sync the JSON file or actually perform an upgrade of the add-on in the Admin CP.

The main problem with the JSON and database being out of sync is that if you modify any templates, the templates will have a change version of the add-on as per the database rather than the JSON file.
Thanks for pointing that out, will remember that in the future.
 
Back
Top Bottom