Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🐶 Semantic Release plugin for packaging up WordPress plugins / themes

License

NotificationsYou must be signed in to change notification settings

semantic-release/wordpress

semantic-release plugin to create a zip file for aWordPress plugin or theme.

node-current (scoped)NPM Version (with dist tag)NPM Version (with dist tag)ReleaseScrutinizer coverage (GitHub/BitBucket)

StepDescription
verifyConditionsVerify if the theme / plugin is valid. Check that the necessary files exist and if they contain needed metadata
prepareCopy the theme / plugins files and optionally prepare the asset bundle
publishCreate a zip file for the theme / plugin, and optionally zip the assets
successClean up the intermediate files

Install

$ npm install -D @semantic-release/wordpress

Usage

The plugin can be configured in thesemantic-release configuration file:

{"plugins": ["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",    ["@semantic-release/wordpress", {"type":"plugin","slug" :"my-plugin","withAssets":true,"withReadme":true,"withVersionFile":true,    }]  ]}

With this example, for each release, the plugin will:

  • Verify that the plugin is valid
  • Create a zip file for the plugin (/tmp/wp-release/my-plugin.zip)
  • Create a zip file for the assets (/tmp/wp-release/assets.zip)
  • Copy the readme.txt file (/tmp/wp-release/readme.txt)
  • Create a version file (/tmp/wp-release/version.txt)

Configuration

Plugin uses no environment variables, but has a lot of configuration options

Options

OptionsDescriptionDefault
typeType of the package to create. Can beplugin orthemeNone.You must set this explicitly
slugPackage slug.None.You must set this explicitly
pathThe path of root folder that contains plugin or theme./
withAssetsDoes the package have assets (screenshots, banners, logo)false
withReadmeDoes the package have a readme.txt filefalse
withVersionFileDo we need to create a file with the next release versiontrue
releasePathBase path for all of the release files/tmp/wp-release
versionFilesArray of additional files containing the package version.[]
includeFiles to include in the package zip file.**/*
excludeFiles to exclude from the package zip fileList of files and folders defined inconstants.ts

Versioning

Plugin will automatically replace versions in your main file (for plugins) and thestyle.css file (for themes).We follow the WordPress codex, so your plugin file must have the same slug as the plugin folder.

If you have other variables which need to have the version replaced, you can add them to theversionFiles option.

If you need any further processing of the package files, next release version will be output to/tmp/wp-release/VERSION file, if thewithVersionFile option is set totrue.

Important

Version in your plugin / theme must be set to 0.0.0 for this plugin to work

Assets

If your package is onwp.org repository, you might have assets (screenshots, banners, logos) which you want to include in the assets file. Plugin respects the Codex, and expects those to be in.wordpress-org/assets folder. Main theme screenshot should be namedscreenshot and should be there as well.

Readme

readme.txt is a special Markdown file needed for packages onwp.org to work. It can be in the.wordpress-org folder, or in the repository root.
Plugin will automatically replace the version in the file if thewithReadme option is set totrue.

Warning

Version in your readme.txt must also be set to 0.0.0 for this plugin to work

Include / Exclude

By default, plugin will include all files in the package zip file. If you want to exclude some files, you can use theexclude option. It accepts an array of files and folders, and usesglob for path resolution.You can also use theinclude option which works in the same manner.

Notes

  • Include and exclude options are not mutually exclusive so you can use both.
  • Plugin also looks for.distinclude and.distexclude /.distignore files which take precedence over the options set in the plugin.
  • By default we exclude a lot of build artifacts and files which are not needed in the package. You can see the full list inconstants.ts.

Examples

Plugin with assets, readme and additional version files

{"plugins": [    ["@semantic-release/wordpress", {"type":"plugin","slug" :"my-plugin","withAssets":true,"withReadme":true,"withVersionFile":false,"versionFiles": ["constants.php","includes/db-schema.php"      ]    }]  ]}

About

🐶 Semantic Release plugin for packaging up WordPress plugins / themes

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp