semantic-release / wordpress Goto Github PK
View Code? Open in Web Editor NEW🐶 Semantic Release plugin for packaging up WordPress plugins / themes
License: MIT License
🐶 Semantic Release plugin for packaging up WordPress plugins / themes
License: MIT License
npm ERR! Could not resolve dependency:
npm ERR! peer semantic-release@"^21.0.7 || ^22.0.0" from @semantic-release/[email protected]
npm ERR! node_modules/@semantic-release/wordpress
npm ERR! dev @semantic-release/wordpress@"^1.6.1" from the root project
Close #212
No response
The pre-existing convention with many other tools is a .distignore
file. It would be better to leverage this more widely used convention.
Support .distignore
as the default with .distexclude
as a deprecated backwards compatible option.
Actually, a note that as I was searching through the code I don't actually see any support for .distexclude
. I see tests for .distinclude
but no tests or references to .distexclude
at all.
I'm getting the following results.
An error occurred while running semantic-release: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at Module.join (node:path:1171:7)
at success (file:///node_modules/@semantic-release/[secure]/dist/success.js:6:26)
at validator (file:///node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///node_modules/semantic-release/lib/plugins/pipeline.js:38:42
at next (file:///node_modules/semantic-release/node_modules/p-reduce/index.js:16:10) {
code: 'ERR_INVALID_ARG_TYPE',
pluginName: '@semantic-release/[secure]'
}
AggregateError:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at success (file:///node_modules/@semantic-release/[secure]/dist/success.js:6:26)
at validator (file:///node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///node_modules/semantic-release/lib/plugins/pipeline.js:38:42
at next (file:///node_modules/semantic-release/node_modules/p-reduce/index.js:16:10)
at file:///node_modules/semantic-release/lib/plugins/pipeline.js:55:13
at async pluginsConfigAccumulator.<computed> [as success] (file:///node_modules/semantic-release/lib/plugins/index.js:87:11)
at async run (file:///node_modules/semantic-release/index.js:215:3)
at async Module.default (file:///node_modules/semantic-release/index.js:275:22)
at async default (file:///node_modules/semantic-release/cli.js:55:5) {
errors: [
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at Module.join (node:path:1171:7)
at success (file:///node_modules/@semantic-release/[secure]/dist/success.js:6:26)
at validator (file:///node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///node_modules/semantic-release/lib/plugins/pipeline.js:38:42
at next (file:///node_modules/semantic-release/node_modules/p-reduce/index.js:16:10) {
code: 'ERR_INVALID_ARG_TYPE',
pluginName: '@semantic-release/[secure]'
}
]
}
The release package is completed successfully.
semantic-release
version"semantic-release": "^22.0.8", "@semantic-release/wordpress": "^1.5.4"
Buildkite/Local
No response
semantic-release
configuration{
"branches": [
{
"name": "main",
"channel": "main"
},
{
"name": "develop",
"prerelease": "rc"
},
{
"name": "feature/Build-Release-Tooling",
"prerelease": "beta"
}
],
"ci": false,
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Change Log"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "npm run build"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
],
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug": "internal-theme-name",
"withAssets": false,
"withReadme": true,
"withVersionFile": true,
"include": [
"build"
],
"versionFiles": [
"style.css"
]
}
]
],
"preset": "conventionalcommits",
"publishConfig": {
"access": "restricted"
}
}
[9:55:14 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/exec"
[9:55:14 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
[9:55:14 PM] [semantic-release] [@semantic-release/git] › ℹ Found 1 file(s) to commit
[9:55:16 PM] [semantic-release] [@semantic-release/git] › ℹ Prepared Git release: 0.2.0-beta.1
[9:55:16 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/git"
[9:55:16 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[9:55:16 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[9:55:16 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/exec"
[9:55:16 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/exec"
[9:55:16 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/[secure]"
[9:55:16 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/[secure]"
[9:55:18 PM] [semantic-release] › ✔ Created tag 0.2.0-beta.1
[9:55:18 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/exec"
[9:55:18 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/exec"
[9:55:18 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/[secure]"
[9:55:18 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/[secure]"
[9:55:18 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/exec"
[9:55:18 PM] [semantic-release] › ✔ Completed step "success" of plugin "@semantic-release/exec"
[9:55:18 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/[secure]"
[9:55:18 PM] [semantic-release] › ✘ Failed step "success" of plugin "@semantic-release/[secure]"
[9:55:18 PM] [semantic-release] › ✘ An error occurred while running semantic-release: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
Files that should be excluded remain in the release in the release output.
In the example below...
Files that match the exclude pattern should be excluded from the release output.
In the example below...
semantic-release
version22.0.12
GitHub Actions
@semantic-release/changelog
@semantic-release/git
@semantic-release/github
@semantic-release/wordpress
semantic-release
configuration.distignore
assets/src/**/*.*
assets/test.js
example.js
.releaserc
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/wordpress",
{
"type": "plugin",
"slug": "demo-wsu-plugin",
"releasePath": "/tmp/release",
"withAssets": false,
"withReadme": true,
"withVersionFile": false,
"versionFiles": [
"includes/plugin.php"
]
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "/tmp/release/package.zip",
"name": "release-${nextRelease.version}.zip"
}
]
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): set version refs to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Run webteam/demo--gh-actions/.github/actions/standard-release@main
Run npm install @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/wordpress @semantic-release/exec
npm WARN deprecated [email protected]: Renamed to read-package-up
added 227 packages, and audited 1981 packages in 9s
298 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
Run npx semantic-release
[6:16:49 PM] [semantic-release] › ℹ Running semantic-release version 22.0.12
[6:16:49 PM] [semantic-release] › ℹ Running semantic-release version 22.0.12
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/wordpress"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/github"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/git"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "verifyRelease" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/changelog"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/wordpress"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/git"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/wordpress"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/github"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/github"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/wordpress"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/github"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "fail" from "@semantic-release/exec"
[6:16:50 PM] [semantic-release] › ✔ Loaded plugin "fail" from "@semantic-release/github"
[6:16:51 PM] [semantic-release] › ✔ Run automated release from branch main on repository https://github.com/webteam/demo--plugin
[6:16:51 PM] [semantic-release] › ✔ Allowed to push to the Git repository
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/changelog"
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[6:16:51 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/wordpress"
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/wordpress"
[6:16:51 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/github"
[6:16:51 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication (https://api.github.com)
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/github"
[6:16:51 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/git"
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/git"
[6:16:51 PM] [semantic-release] › ℹ Found git tag v1.6.5 associated with version 1.6.5 on branch main
[6:16:51 PM] [semantic-release] › ℹ Found 1 commits since last release
[6:16:51 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[6:16:51 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analyzing commit: fix: again
[6:16:51 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ The release type for the commit is patch
[6:16:51 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analysis of 1 commits complete: patch release
[6:16:51 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[6:16:51 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ℹ The next release version is 1.6.6
[6:16:51 PM] [semantic-release] › ℹ Start step "verifyRelease" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ✔ Completed step "verifyRelease" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[6:16:51 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[6:16:51 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/exec"
[6:16:51 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/changelog"
[6:16:51 PM] [semantic-release] [@semantic-release/changelog] › ℹ Update /home/runner/work/demo--plugin/demo--plugin/demo--plugin/CHANGELOG.md
[6:16:51 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/changelog"
[6:16:51 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/wordpress"
[6:16:51 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/wordpress"
[6:16:51 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
[6:16:52 PM] [semantic-release] [@semantic-release/git] › ℹ Found 1 file(s) to commit
[6:16:52 PM] [semantic-release] [@semantic-release/git] › ℹ Prepared Git release: v1.6.6
[6:16:52 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/git"
[6:16:52 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[6:16:52 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[6:16:52 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/exec"
[6:16:52 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/exec"
[6:16:54 PM] [semantic-release] › ✔ Created tag v1.6.6
[6:16:54 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/exec"
[6:16:54 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/wordpress"
[6:16:54 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/wordpress"
[6:16:54 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/github"
[6:16:55 PM] [semantic-release] [@semantic-release/github] › ℹ Published file https://github.com/webteam/demo--plugin/releases/download/untagged-be8fbbc96e395e0c0456/release-1.6.6.zip
[6:16:56 PM] [semantic-release] [@semantic-release/github] › ℹ Published GitHub release: https://github.com/webteam/demo--plugin/releases/tag/v1.6.6
[6:16:56 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/github"
[6:16:56 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/exec"
[6:16:56 PM] [semantic-release] › ✔ Completed step "success" of plugin "@semantic-release/exec"
[6:16:56 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/wordpress"
[6:16:56 PM] [semantic-release] › ✔ Completed step "success" of plugin "@semantic-release/wordpress"
[6:16:56 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/github"
[6:16:58 PM] [semantic-release] › ✔ Completed step "success" of plugin "@semantic-release/github"
[6:16:58 PM] [semantic-release] › ✔ Published release 1.6.6 on default channel
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@types/adm-zip
, adm-zip
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@babel/core
, @babel/preset-env
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
).github/workflows/release.yml
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
.github/workflows/test.yml
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
package.json
@semantic-release/error ^4.0.0
class-transformer ^0.5.1
class-transformer-validator ^0.9.1
class-validator ^0.14.0
execa ^8.0.1
fs-extra ^11.1.1
glob ^10.3.3
read-pkg ^9.0.0
reflect-metadata ^0.2.0
replace-in-file ^7.0.1
@babel/core 7.24.7
@babel/preset-env 7.24.7
@types/adm-zip ^0.5.5
@types/fs-extra 11.0.4
@types/jest 29.5.12
@types/node 20.14.7
@types/semantic-release__error 3.0.3
@types/signale 1.4.7
@types/sinon 17.0.3
@typescript-eslint/eslint-plugin 6.21.0
@typescript-eslint/parser 6.21.0
adm-zip ^0.5.16
babel-jest 29.7.0
eslint 8.56.0
eslint-config-prettier 9.1.0
eslint-plugin-prettier 5.1.3
jest 29.7.0
prettier 3.3.3
rimraf 5.0.5
semantic-release 24.1.1
signale 1.4.0
sinon 17.0.1
ts-jest 29.1.5
typescript 5.3.3
semantic-release >=20.1.0
node >=20.8.1
.nvmrc
node 20
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>semantic-release/.github)
Hi @seebeen, thanks for the immediate response.
I did a test but with this configuration the file verification fails.
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist/my-theme"
}
],
i think because inside verify-theme.ts
concat path with slug.
wordpress/lib/utils/verify-theme.ts
Line 9 in 2e63d93
So the path in verify state is "./dist/my-theme/my-theme" and in prepare state is "./dist/my-theme"
In my case the correct path is "./dist/my-theme".
[5:13:15 PM] [semantic-release] › ✘ ETHEMEFILENOTFOUND Your theme must contain these files: style.css, functions.php
Check if the files exist, and if not create them: style.css, functions.php.
AggregateError:
SemanticReleaseError: Your theme must contain these files: style.css, functions.php
at getError (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/get-error.js:5:12)
at verifyTheme (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/verify-theme.js:13:13)
at async verifyConditions (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/verify-conditions.js:12:17)
at async validator (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds/my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44)
at file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async pluginsConfigAccumulator.<computed> [as verifyConditions] (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/index.js:87:11)
at async run (file:///builds/my-theme/theme/node_modules/semantic-release/index.js:106:3)
at async Module.default (file:///builds/my-theme/theme/node_modules/semantic-release/index.js:275:22)
at async default (file:///builds/my-theme/theme/node_modules/semantic-release/cli.js:55:5) {
errors: [
SemanticReleaseError: Your theme must contain these files: style.css, functions.php
at getError (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/get-error.js:5:12)
at verifyTheme (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/verify-theme.js:13:13)
at async verifyConditions (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/verify-conditions.js:12:17)
at async validator (file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds/my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds/my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
code: 'ETHEMEFILENOTFOUND',
details: 'Check if the files exist, and if not create them: style.css, functions.php.',
semanticRelease: true,
pluginName: '@semantic-release/wordpress'
}
]
For test this user case, the prepare.specs.ts and verify-theme.spec.ts must have the same options
{
type: 'theme',
slug: 'complete-theme',
path: './test/fixtures/complete-theme',
copyFiles: false,
}
Originally posted by @AntoninoBonanno in #120 (comment)
hi @seebeen,
I generate my theme files inside the dist folder and I want the version to be replaced in this folder and then proceed to create the .zip file.
So i use this configuration
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist/"
}
],
the verification step is successful but when the version replacement is carried out I get an error.
I think the file is not found because in verify-theme.ts
the path is concatenated with the slug
wordpress/lib/utils/verify-theme.ts
Line 9 in 2e63d93
however in prepare.ts
the path is not concatenated with the slug
Line 28 in 2e63d93
My style.css
is correct
/*
Theme Name: My Theme
Theme URI: https://gitlab.com....
Author: Antonino Bonanno
Version: 0.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: my-theme
Text Domain: my-theme
Requires at least: 6.3
Tested up to: 6.3.0
Requires PHP: 8.1
*/
The version is replaced and the zip is passed through a specific path
semantic-release
version22.0.5
GitLab
"@semantic-release/wordpress": "^1.5.3",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^12.0.6",
semantic-release
configuration[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "my-theme",
"withReadme": true,
"copyFiles": false,
"releasePath": "/tmp/wp-release",
"path": "./dist/"
}
],
[11:30:50 PM] [semantic-release] › ✘ EFILEINVALID File is invalid: style.css
The file is invalid: style.css.
AggregateError
at prepare (file:///builds/my-theme/theme/node_modules/@semantic-release/wordpress/dist/prepare.js:28:15)
at async validator (file:///builds//my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds//my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds//my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
[errors]: [
SemanticReleaseError: File is invalid: style.css
at getError (file:///builds//my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/get-error.js:5:12)
at replaceVersions (file:///builds//my-theme/theme/node_modules/@semantic-release/wordpress/dist/utils/replace-versions.js:20:25)
at async prepare (file:///builds//my-theme/theme/node_modules/@semantic-release/wordpress/dist/prepare.js:26:21)
at async validator (file:///builds//my-theme/theme/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
at async file:///builds//my-theme/theme/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
at async Promise.all (index 0)
at async next (file:///builds//my-theme/theme/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
code: 'EFILEINVALID',
details: 'The file is invalid: style.css.',
semanticRelease: true,
pluginName: '@semantic-release/wordpress'
}
]
}
In the documentation the zip name is my-plugin.zip
(<slug>.zip
)
Line 44 in e8b42e5
but inside code and test the name of zip is package.zip
Lines 20 to 28 in e8b42e5
wordpress/test/3-publish-plugin.spec.ts
Line 77 in e8b42e5
and actually the name of the generated zip file is package.zip
I'm not sure if this is a documentation issue or an implementation issue but the requirement that the readme.txt
needs to be in the .wordpress-org
directory seems completely wrong as this is not the correct standard. The readme.txt
file is required to be in the root of the plugin or theme directory.
Support readme.txt
in the repository root as is the general best practice.
semantic-release
version"semantic-release": "^22.0.8", "@semantic-release/wordpress": "^1.5.4"
Buildkite
semantic-release
configuration{
"branches": ["main", "feature/Build-Release-Tooling"],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Change Log"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md"]
}
],
[
"@semantic-release/wordpress",
{
"type": "theme",
"slug" : "internal-theme-name",
"withReadme": true,
"withVersionFile": true
}
]
],
}
Just testing this out locally at the moment and trying to get clarification on the correct configuration.
Update the library to support semantic-release v24
Upgrade for semantic-release v24
No response
If the zip command is not present this code will return an error but packageResult.stderr
is empty and the publish stage will be triggered anyway.
Then it shows an error on the screen that is not easily understandable.
Lines 18 to 35 in e8b42e5
It would be a good idea to check whether the zip
command is already present during the verify stage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.