diff --git a/.github/workflows/ci-skip.yml b/.github/workflows/ci-skip.yml new file mode 100644 index 0000000..ac93cfd --- /dev/null +++ b/.github/workflows/ci-skip.yml @@ -0,0 +1,31 @@ +name: ci + +# Counterpart to ci.yml: when a change can't affect the image, report the +# required `build` and `test` checks as passed without building anything. +# Keep the path list identical to the one in ci.yml. +on: + push: + branches: + - main + paths-ignore: + - Dockerfile + - docker-bake.hcl + - .github/workflows/ci.yml + pull_request: + branches: + - main + paths-ignore: + - Dockerfile + - docker-bake.hcl + - .github/workflows/ci.yml + +jobs: + build: + runs-on: ubuntu-latest + steps: + - run: echo "No image-affecting changes; skipping build." + test: + runs-on: ubuntu-latest + needs: build + steps: + - run: echo "No image-affecting changes; skipping tests." diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d21df49..d96623e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,23 @@ name: ci +# The image depends only on these files (the Dockerfile has no COPY/ADD), so +# other changes skip the build. ci-skip.yml reports the same required checks +# as passed for those changes. Keep both path lists identical. on: push: branches: - main + paths: + - Dockerfile + - docker-bake.hcl + - .github/workflows/ci.yml pull_request: branches: - main + paths: + - Dockerfile + - docker-bake.hcl + - .github/workflows/ci.yml jobs: build: diff --git a/AGENTS.md b/AGENTS.md index 7f5eea4..7e65f48 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,7 +42,7 @@ Steps: `git checkout main && git pull && git checkout -b release/vX.Y.Z` 2. Update the version: - `Dockerfile`: the `@microsoft/generator-sharepoint` version. - - `README.md`: in the Available tags section, update `latest` and `online` and add a row for `X.Y.Z`. + - `README.md`: the version in parentheses in the note under the title, and in the Available tags section update `latest` and `online` and add a row for `X.Y.Z`. - `README.md`: the Visual Studio development containers link points to `docs/vX.Y.Z/DevelopmentContainers.md`. - Run `grep -rn ""` to catch any other references. 3. Create the versioned docs folder as described in "Versioned docs" above. @@ -52,4 +52,10 @@ Steps: - Soft reset to it: `git reset --soft ` - Commit again with the same message. 6. Push the branch and open a PR: `git push -u origin release/vX.Y.Z`, then `gh pr create --title "feat: new SPFx version vX.Y.Z"`. -7. After the PR merges, tag the merged commit on main: `git checkout main && git pull && git tag vX.Y.Z && git push origin vX.Y.Z`. +7. After the PR merges, tag the merged commit on main: `git checkout main && git pull && git tag vX.Y.Z && git push origin vX.Y.Z`. Pushing the tag is what publishes the release (see "CI flow" below). Never tag the release branch: the repo squash-merges, so a tag there points at a commit that isn't on main, and pushing it would publish an image before review. + +## CI flow + +- `ci.yml` runs on PRs and pushes to main that touch `Dockerfile`, `docker-bake.hcl`, or itself. It builds the test stages and does not publish anything. For any other change, `ci-skip.yml` reports the same required `build` and `test` checks as passed without building. The path lists in the two files must stay identical. +- `build-and-push.yaml` runs only when a `vX.Y.Z` tag is pushed. It builds the multiplatform image and pushes it to Docker Hub as `X.Y.Z`, `latest`, and `online`. Merging a PR does not trigger it. +- `update-dockerhub-description.yaml` runs automatically after a successful "Image Build and Push" and syncs the root `README.md` to the Docker Hub repository overview. It can also be run manually from the Actions tab. diff --git a/README.md b/README.md index 85d613d..8ebf3ef 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Docker images for running the [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) development environment. -> This README covers the **latest** SharePoint Framework version. For instructions for other versions, see the [versioned docs folder](https://github.com/pnp/docker-spfx/tree/main/docs) on GitHub. +> This README covers the **latest** SharePoint Framework version (1.24.2). For instructions for other versions, see the [versioned docs folder](https://github.com/pnp/docker-spfx/tree/main/docs) on GitHub. [![Pulls from Docker Hub](https://img.shields.io/docker/pulls/m365pnp/spfx.svg)](https://hub.docker.com/r/m365pnp/spfx)