Repository navigation
[WIP] Deployments via GitHub actions v3 - #183
Draft
ajaynes-godaddy wants to merge 58 commits into
Draft
ajaynes-godaddy wants to merge 58 commits into
ajaynes-godaddy wants to merge 58 commits into
Conversation
# Conflicts: # helpers/arguments.js # tasks/lint.js
The PHP-lint condition in compile() checked the function reference itself (always truthy) rather than calling it, so --skip-linting never actually skipped lintPhpTask here. Pre-existing bug from this PR, unrelated to the merge conflict resolution in the prior commit.
…ipts - Guard sake.initConfig() behind a SAKE_TEST_MODE env var, since importing lib/sake.js otherwise calls initConfig() at module load time and exits the process outside a real plugin directory - Add a minimal fixture plugin directory and a chdir helper so tests can exercise sake's config logic against a realistic plugin - Add npm test and test:watch scripts, and a throwaway import-crash smoke check across every tasks/*.js file to prove the gate works
Runs on ubuntu-latest with actions SHA-pinned to node24-native releases (checkout v7.0.1, setup-node v7.0.0), resolving the Node version from package.json's existing engines field rather than hardcoding one.
….js style replaceVersionTask now falls back to --new-version (via newPluginVersion()) when no version has been set via the interactive prompt, so it can be invoked standalone (e.g. from CI) rather than only inside the full deploy series. Also removes stray semicolons and trailing whitespace in prompt.js introduced by the non-interactive-mode changes, to match the rest of the file's style.
Covers the logic introduced for MWC-1505: isNonInteractive()/isDryRunDeploy()/ newPluginVersion() in helpers/arguments.js, the --skip-linting gating in compile(), the --dry-run/--non-interactive gating in deployTask(), the --new-version fallback in replaceVersionTask(), and the non-interactive short-circuits in promptDeployTask/promptWcUploadTask/promptTestedReleaseZipTask. Builds on the test infrastructure merged in from PR #182 rather than reinventing it; does not re-cover the pre-existing functions/behavior already tested by PR #181.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for non-interactive (CI-driven) deploys to sake's deploy flow, and brings this branch up to date with the test infrastructure landing separately so the new logic has coverage. Builds on the prior WIP deploy work rather than starting over.
Issue: MWC-1505
Details
bin/sake.jspropagates the spawnedgulpprocess's exit code so CI can detect deploy failures.helpers/arguments.jsaddsisNonInteractive(),isDryRunDeploy(), andnewPluginVersion().tasks/compile.js's--skip-lintingflag now actually skipslintPhpTask(fixes a bug where the function reference was checked instead of invoked).tasks/deploy.js'sdeployTaskskips the WooCommerce upload/WordPress.org deploy steps during--dry-run, skips docs-issue creation when--non-interactiveis set, andreplaceVersionTaskfalls back to--new-versionso it can run standalone outside the full deploy flow.tasks/prompt.js's three prompts (version, WC upload, tested-zip confirmation) all skip their inquirer prompt in non-interactive mode.This PR deliberately targets the test infrastructure branch from #182 rather than master, so this non-interactive deploy work can ship with real test coverage from the start instead of reinventing that infrastructure separately.
Check the issues filed in the plugin release actions repo for guidance on the action-side implementation.
QA
Setup
Steps
npx sake deploy --non-interactive --dry-run --new-version=1.2.3npx sake compile --skip-lintingnpm testBefore merge