SPFx Release Automation
Release a new SPFx version. The version argument is: $ARGUMENTS
Pre-flight checks
Before making changes, verify:
- Working tree is clean (
git status). If there are unrelated uncommitted changes, stop and ask the user how to handle them. - The new version is not already present in
Dockerfile,README.md, orDevelopmentContainers.md— if it is, the release may already be in flight; surface this and ask before continuing. - The tag
v$ARGUMENTSdoes not already exist locally or on origin (git tag --list,git ls-remote --tags origin).
Steps to perform
Create a release branch from the latest master:
git checkout master && git pull git checkout -b release/v$ARGUMENTSBranch name must be valid git (no spaces, no colons).
Update version in all files — find and replace the old version with
$ARGUMENTSin:Dockerfile(generator-sharepoint version)README.md(Available tags section — updatelatest,online, and add the new version row)DevelopmentContainers.md(devcontainer.json example)- Run
grep -rn "<old-version>"to catch any other references.
Commit changes with message:
SPFx v$ARGUMENTS - new version updatesSquash commits on the release branch (release branch only — never on master, since unrelated commits between the last tag and HEAD would get folded in):
- Get the last tag:
git describe --tags --abbrev=0 - Soft reset to that tag:
git reset --soft <last-tag> - Re-commit with the same message.
- Get the last tag:
Push the branch and open a PR (confirm with user first):
git push -u origin release/v$ARGUMENTS gh pr create --title "feat: new SPFx version v$ARGUMENTS" --body "..."After the PR merges, create and push the tag against the merged commit on master:
git checkout master && git pull git tag v$ARGUMENTS git push origin v$ARGUMENTSConfirm with the user before pushing the tag.
Always confirm with the user before any push or PR creation.
Source: pnp/docker-spfx — distributed by TomeVault.