Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 88 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,115 @@
name: Release

on:
push:
branches:
- main
schedule:
- cron: "0 17 * * 2" # Weekly on Tuesday evenings
workflow_dispatch:
inputs:
dry-run:
description: Compute the next versions and release notes without publishing
type: boolean
default: false

jobs:
release-please:
name: Run Release Please

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
permissions:
contents: read

outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
paths_released: ${{ steps.release.outputs.paths_released }}
concurrency:
group: release

steps:
- name: Run release-please command
id: release
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0

build-and-publish:
name: Build & Publish
jobs:
release:
name: Release ${{ matrix.package.name }}

runs-on: ubuntu-latest

needs: [release-please]

if: needs.release-please.outputs.paths_released != '[]'
permissions:
contents: write # create the tag and GitHub release
id-token: write # npm trusted publishing

strategy:
fail-fast: false
matrix:
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}

permissions:
contents: read
id-token: write
package:
- name: gulp-browser-sync
path: plugins/gulp-browser-sync
- name: gulp-sharp
path: plugins/gulp-sharp

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Setup pnpm
# Quoted so the shell running the action does not expand the glob
- name: Generate release notes
id: notes
uses: orhun/git-cliff-action@a9a95522b26fe6403f7bb24031f21fb573d0f5ff # v4.9.1
with:
args: --include-path '${{ matrix.package.path }}/**' --tag-pattern '^${{ matrix.package.name }}-v[0-9]+\.[0-9]+\.[0-9]+$' --unreleased --bump --strip all --output ${{ runner.temp }}/RELEASE_NOTES.md

# git-cliff reports the latest tag as the next version when nothing is releasable
- name: Check for releasable changes
id: check
env:
NOTES: ${{ runner.temp }}/RELEASE_NOTES.md
VERSION: ${{ steps.notes.outputs.version }}
run: |
if ! grep -q '[^[:space:]]' "$NOTES" || git rev-parse -q --verify "refs/tags/$VERSION" >/dev/null; then
echo "No releasable changes since the last release"
echo "release=false" >> "$GITHUB_OUTPUT"
else
{ echo "## $VERSION"; echo; cat "$NOTES"; } >> "$GITHUB_STEP_SUMMARY"
echo "release=true" >> "$GITHUB_OUTPUT"
fi

- name: Setup pnpm & Node.js
if: steps.check.outputs.release == 'true'
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
runtime: node@latest
install: false

- name: Setup NodeJS
uses: actions/setup-node@v7
with:
node-version: latest
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
if: steps.check.outputs.release == 'true'
run: pnpm i --frozen-lockfile

- name: Build packages
run: pnpm -r build

- name: Publish package at ${{ matrix.path }}
run: npm publish
working-directory: ${{ matrix.path }}
- name: Build package
if: steps.check.outputs.release == 'true'
run: pnpm --filter "./${{ matrix.package.path }}" build

- name: Set package version
if: steps.check.outputs.release == 'true'
working-directory: ${{ matrix.package.path }}
env:
VERSION: ${{ steps.notes.outputs.version }}
run: pnpm version "${VERSION##*-v}" --no-git-tag-version --allow-same-version

# pnpm publishes via npm trusted publishing (OIDC) itself; the runner's npm is too old for it
# Skipping an already published version lets a failed run be retried safely
# Waiting for the version to be installable keeps the GitHub release from getting ahead of npm
- name: Publish package
if: steps.check.outputs.release == 'true'
working-directory: ${{ matrix.package.path }}
env:
DRY_RUN: ${{ inputs.dry-run }}
VERSION: ${{ steps.notes.outputs.version }}
run: |
name="$(jq -r .name package.json)"
if [[ "$DRY_RUN" == "true" ]]; then
pnpm publish --no-git-checks --dry-run
elif [[ -n "$(pnpm view "$name@${VERSION##*-v}" version 2>/dev/null)" ]]; then
echo "$name@${VERSION##*-v} is already published"
else
pnpm publish --no-git-checks --publish-wait-timeout 600000
fi

- name: Create GitHub release
if: steps.check.outputs.release == 'true' && !inputs.dry-run
env:
GH_TOKEN: ${{ github.token }}
NAME: ${{ matrix.package.name }}
NOTES: ${{ runner.temp }}/RELEASE_NOTES.md
VERSION: ${{ steps.notes.outputs.version }}
run: |
gh release create "$VERSION" --target "$GITHUB_SHA" --title "$NAME: v${VERSION##*-v}" --notes-file "$NOTES"
1 change: 0 additions & 1 deletion .release-please-manifest.json

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Each plugin includes detailed documentation and usage examples in its respective

We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

## Changelog

Release notes for every plugin version are published on the [GitHub Releases](https://github.com/forwardsoftware/gulp-plugins/releases) page.

## License

This project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details.
Expand Down
34 changes: 34 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# git-cliff configuration, see https://git-cliff.org/docs/configuration
# The release workflow runs it once per plugin with --include-path and --tag-pattern

[changelog]
body = """
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits %}
- {% if commit.scope %}**{{ commit.scope }}:** {% endif %}{% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }})\
{% endfor %}
{% endfor %}
"""
trim = true

[git]
conventional_commits = true
filter_unconventional = true
filter_commits = true
protect_breaking_commits = true
sort_commits = "newest"
# Group names are prefixed with an HTML comment to control their order
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
{ message = "^perf", group = "<!-- 2 -->Performance" },
{ message = "^refactor", group = "<!-- 3 -->Refactoring" },
{ message = "^docs", group = "<!-- 4 -->Documentation" },
{ message = "^chore", group = "<!-- 5 -->Miscellaneous" },
{ message = "^(ci|build|test|style)", skip = true },
]

[bump]
features_always_bump_minor = true
breaking_always_bump_major = true
2 changes: 2 additions & 0 deletions plugins/gulp-browser-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

> This file is no longer updated. Release notes for newer versions are published on the [GitHub Releases](https://github.com/forwardsoftware/gulp-plugins/releases?q=gulp-browser-sync&expanded=true) page.

## [1.0.1](https://github.com/forwardsoftware/gulp-plugins/compare/gulp-browser-sync-v1.0.0...gulp-browser-sync-v1.0.1) (2025-12-19)


Expand Down
4 changes: 4 additions & 0 deletions plugins/gulp-browser-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ async function watchFiles() {
export const watch = gulp.series(dist, gulp.parallel(browserServe, watchFiles));
```

## Changelog

Release notes for every version are published on the [GitHub Releases](https://github.com/forwardsoftware/gulp-plugins/releases?q=gulp-browser-sync&expanded=true) page.

## License

MIT
Expand Down
2 changes: 2 additions & 0 deletions plugins/gulp-sharp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

> This file is no longer updated. Release notes for newer versions are published on the [GitHub Releases](https://github.com/forwardsoftware/gulp-plugins/releases?q=gulp-sharp&expanded=true) page.

## [1.0.3](https://github.com/forwardsoftware/gulp-plugins/compare/gulp-sharp-v1.0.2...gulp-sharp-v1.0.3) (2026-09-29)


Expand Down
4 changes: 4 additions & 0 deletions plugins/gulp-sharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export default () => (
- All options available to `sharp` [`webp` method](https://sharp.pixelplumbing.com/api-output#webp).


## Changelog

Release notes for every version are published on the [GitHub Releases](https://github.com/forwardsoftware/gulp-plugins/releases?q=gulp-sharp&expanded=true) page.

## License

MIT
Expand Down
10 changes: 0 additions & 10 deletions release-please-config.json

This file was deleted.

Loading