Create built releases of a project based on the WordPress plugin Version
header in your main plugin file and then falling back to the version
property in
either composer.json
or package.json
. When the version is updated in either
file, the action will build the project, push a new tag up with the version, and
create a release. Optionally, the release can be drafted or published.
The most common use of this workflow is for WordPress plugins or other packages that require built assets (such as ones from Webpack or Gulp) to be included to work but we don't want to include those assets in version control.
When the plugin's version is incremented on
alleyinteractive/create-wordpress-plugin
-based plugins via npm run release
,
the action will push a built version of the plugin to the *-built
branch and
then create a release with the built assets. If the plugin's version was not
incremented, the action will still push the latest changes to the *-built
branch but will not create a release. This allows for a single workflow to
create a built version of a branch as well as a built release.
Example usage in a workflow:
name: Built Branch and Release
on:
push:
branches:
- develop
- main
- production
permissions:
contents: write
jobs:
release:
name: "Create Release"
runs-on: ubuntu-latest
steps:
- uses: alleyinteractive/action-release@develop
Specify using
with
keyword.
- Specify the command to run for build.
- Accepts a string.
- Defaults to
'npm run build'
.
- Specify if the release should be drafted for a new release.
- Accepts a boolean string
- Defaults to
false
.
- Specify the GitHub token to use.
- Accepts a string.
- Defaults to
${{ github.token }}
.
- Specify the Node.js version to use.
- Accepts a string.
- Defaults to
lts/*
.
- Specify the PHP version to use.
- Accepts a string.
- Defaults to
'8.1'
.
- Specify if the build step should be skipped.
- Accepts a boolean string.
- Defaults to
'false'
.
- Specify if the Composer install step should be skipped.
- Accepts a boolean string.
- Defaults to
'false'
.
- Specify if the NPM install step (
npm ci
/npm install
) should be skipped. - Accepts a boolean string.
- Defaults to
'false'
.
Please see CHANGELOG for more information on what has changed recently.
This project is actively maintained by Alley Interactive.
The GNU General Public License (GPL) license. Please see License File for more information.⏎