This repository uses GitHub Actions to automatically create releases when the plugin version is updated. This ensures immutable releases and maintains consistency between package.json and manifest.json.
-
Version Update Detection: When you push changes to
mainthat include updates topackage.jsonormanifest.json, the workflow checks if the version has changed. -
Version Consistency: The system ensures that
package.jsonandmanifest.jsonhave matching version numbers. -
Automatic Release Creation: If versions match and have changed, a new GitHub release is automatically created with:
main.js(compiled plugin)manifest.json(plugin metadata)styles.css(plugin styles)
-
Release Notes: Automatic generation of release notes with installation instructions.
A separate validation workflow runs on all pushes and pull requests to:
- Check version consistency between files
- Validate manifest.json structure
- Run linting and type checking
- Test the build process
- Verify all required release assets are present
# For bug fixes
npm run update-version patch
# For new features
npm run update-version minor
# For breaking changes
npm run update-version major
# Review changes, test, then commit and push
git add .
git commit -m "Bump version to x.x.x"
git push origin mainThis method:
- Updates both
package.jsonandmanifest.jsonversions - Gives you control over when to commit and push
- Ensures version consistency between files
# For bug fixes
npm version patch
# For new features
npm version minor
# For breaking changes
npm version major
# Push the changes (this triggers the release)
git push origin main --follow-tagsThis method:
- Updates
package.jsonversion - Runs the
versionscript which updatesmanifest.jsonandversions.json - Creates a git commit and tag automatically
- When pushed, triggers the automatic release
- Update the version in both
package.jsonandmanifest.json:// package.json { "version": "1.3.0" } // manifest.json { "version": "1.3.0" }
- Commit and push:
git add package.json manifest.json # Change "1.3.0" to your desired version git commit -m "Bump version to 1.3.0" git push origin main
- Developer Action - Update version using one of the methods above
- GitHub Action Triggered - On push to
mainwith version file changes - Version Check - Validates version consistency and checks if it's a new version
- Build Process - Installs dependencies, runs linting, and builds the plugin
- Release Creation - Creates a GitHub release with proper assets
- Asset Upload - Uploads
main.js,manifest.json, andstyles.css
- Version Mismatch Detection - Prevents releases if
package.jsonandmanifest.jsonversions don't match - Duplicate Release Prevention - Won't create a release if the version already exists as a tag
- Build Validation - Ensures the plugin builds successfully before creating a release
- Asset Verification - Confirms all required files are present and non-empty
- Check the Actions tab to monitor workflow runs
- Failed builds will prevent releases and show detailed error messages
- Successful releases appear in the Releases section with all required assets
❌ Version mismatch between package.json (1.2.0) and manifest.json (1.1.0)
Solution: Ensure both files have the same version number.
❌ Build failed: main.js was not generated
Solution: Fix TypeScript compilation errors and ensure the build script works locally.
❌ Missing required files for release: styles.css
Solution: Ensure all required files (main.js, manifest.json, styles.css) exist after the build.
- Always test locally before pushing version updates:
npm run build npm run lint
- Use semantic versioning:
patch(1.0.1) for bug fixesminor(1.1.0) for new featuresmajor(2.0.0) for breaking changes
- Review the validation workflow on pull requests to catch issues early
- Monitor the Actions tab after pushing to ensure successful release
- Keep release notes meaningful by making descriptive commit messages
This automated system ensures that every version update results in a proper, immutable release with all necessary assets for Obsidian plugin installation.