feat: ✨ use manifest from latest valid github release for BRAT #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently started to use semantic-release and the excellent brianrodri/semantic-release-obsidian-plugin which allows using
semantic-release
for Obsidian plugins (which can even be run locally, as no CI environment is needed).One of the issues I ran into was the way how BRAT looks for (beta) releases in a repository, which is incompatible with development of new versions via dedicated branches and (pre-)releases built from these.
With this PR, I aim to propose to change the way how BRAT detects (Beta) Versions of plugins, and to base it on up-to-date information taken from the list of releases:
Specifically, it will fetch the
manifest.json
from the latest (pre-) release in the repository to install and update plugins.This makes BRAT independent of the version numbering in the repository root, and allows developers to use
semantic-release
andbeta
branches to develop pre-releases that all work with BRAT.BREAKING:
manifest-beta.json
is not necessary anymore, although having it in a repository doesn't hurt at all. IMHO the change is still backwards-compatible with the old way.As far as I can tell, Obsidian and plugins like the Obsidian plugin tracker currently look at the master
manifest.json
in the default branch of a plugin repository when updating plugins, which is also compatible with this change. If a developer releases a “beta” version as an independent but “full” release in his repository (e.g. by manually creating it), BRAT will pick it up independently of the version number in the mastermainfest.json
.Furthermore, this change might also solve #81 and help with #61 as BRAT will download the latest official release automatically if there is no newer pre-release.
Finally, it will also make BRAT more robust, as it will always use the true release list as its source of truth.
See brianrodri/semantic-release-obsidian-plugin#1 for a patch that would build and commit a pre-release from pre-release branches (
beta
and similar).Also note that there is an inconsistency in Obsidian's Plugin doc vis-à-vis version numbers: They reference Semantic Versioning but insist that versions can “only use numbers and periods (
.
)”. Semantic beta version numbers also contain dashes (e.g.1.2.3-beta.1
). I'd argue the latter is valid and therefore can also be used for Obsidian plugin versions, at least while developing.