Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use manifest-beta for BRAT pre-releases #1

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

johannrichard
Copy link

@johannrichard johannrichard commented Dec 28, 2024

Thanks for a great plugin! I implemented a small change that will create a manifest-beta.json in case a pre-release is detected (e.g. when committing to a beta or next branch). This will then create a manifest-beta.json for that pre-release and commit it to the branch, but will leave the manifest.json untouched.

Because of the way BRAT (currently) works, you either have to set your pre-release branch as the default branch and update it's manifest.json manually whenever a new version is published, or copy the manifest-beta.json from your pre-release branch to the default branch.

I'm not sure which one is the best way, or if there are better ways to solve this (including updating BRAT such that a branch could be specified instead of manifest-beta.json or a fixed version number).

- use the `manifest-beta.json` for pre-releases
- leave `manifest.json` untouched for pre-releases
@johannrichard
Copy link
Author

johannrichard commented Dec 29, 2024

I submitted TfTHacker/obsidian42-brat#93 to obsidian42-brat. In case it is integrated, the code required to create, update and commit the manifest-beta.json would not be needed anymore, and the problem outlined above would vanish. Happy to keep that PR open as aa draft as long as this question is not solved.

@brianrodri brianrodri changed the title feat: ✨ use manifest-beta for BRAT pre-releases feat: use manifest-beta for BRAT pre-releases Jan 1, 2025
@brianrodri
Copy link
Owner

brianrodri commented Jan 1, 2025

This looks great, thanks for the contribution! I'd be happy to merge this in but please add a TODO(TfTHacker/obsidian42-brat#93) comment somewhere so that I can remember to remove it once and if your PR goes through.

I'm not a big user of BRAT, so let me know what'd improve your experience the most. Thanks again and happy new years! 🎉

@brianrodri
Copy link
Owner

Heads up I merged in some changes to your branch so that it's passing my checks!

TODO(TfTHacker/obsidian42-brat#93): Make sure to remove code if BRAT integrates changes to use GitHub pre-releases
@johannrichard
Copy link
Author

@brianrodri I have continued playing around with the plugin. It's really great! I have written up a small Gist with a sample .releaserc.yaml which contains a boilerplate configuration that should work with minimal adjustments for almost every Obsidian plugin. This works without polluting the package.json (which is especially useful when tinkering with (development) forks, for which one can now release test versions with a breeze).

I also wrote up a small README.md on Using semantic-release for your Obsidian plugin and development forks alike that briefly explains how to use your plugin in different contexts.

Copy link
Owner

@brianrodri brianrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks @johannrichard! I've gone ahead and given the code changes a genuine review, PTAL!

I'll also play around with the .yml snippet on a private repository to quickly confirm, then I'll open a PR myself with the changes. Would you mind reviewing those changes when I get around to it?

Finally, thanks again!!

src/prepare.js Show resolved Hide resolved
if (prerelease === false) {
return false;
}
return (
Copy link
Owner

@brianrodri brianrodri Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little complicated, could you please split these into a chain of if-else with brief comments describing how a user might "land" in each branch?

Also, please add some unit tests to demonstrate the same ideas (and so codecov stays at 100% 😊)

README.md Outdated Show resolved Hide resolved
Add some more detail on pre-release branches.
The plugin must be specified as `semantic-release-obsidian-plugin` in the `plugins` list. Otherwise, `semantic-release` will fail.
@johannrichard
Copy link
Author

PS: I saw there's a longer thread in the Obsidian Forum on GitHub actions. None of them mention your semantic-release plugin, and all of them involve quite complex setups with additional scripts. I was thinking a) of replying by adding a pointer to your plugin (b/c it's really great and works well out of the box 🥳) and b) of shamelessly adding a link to my small write-up (relevant parts of which we can also integrate into your plugin's doc if you prefer).

Please let me know what you think of a) and b).

@brianrodri
Copy link
Owner

Haha b) sounds good to me!

They'll need a link to this repo to file feature requests anyway 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants