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
51 changes: 20 additions & 31 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,51 @@
name: release-please

on:
push:
branches:
- master
name: release-please

permissions:
contents: read

jobs:
list_modules:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- id: set-matrix
run: echo "matrix=$(find . -type f -name 'Dockerfile' | awk -F/ '{print $3"/"$4}' | jq -Rsc '. / "\n" - [""]')" >> "$GITHUB_OUTPUT"
release-please:
name: release-${{ matrix.subject }}
runs-on: ubuntu-latest
needs: list_modules
permissions:
contents: write
issues: write
pull-requests: write
outputs:
paths_released: ${{ steps.release.outputs.paths_released }}
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}

publish:
name: publish ${{ matrix.path }}
needs: release-please
if: ${{ needs.release-please.outputs.paths_released != '' && needs.release-please.outputs.paths_released != '[]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
subject: ${{ fromJSON(needs.list_modules.outputs.matrix) }}
env:
SUBJECT: ${{ matrix.subject }}
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
steps:
- name: Set environment
run: echo "PACKAGE_NAME=thumbor-plugins-${SUBJECT#*/}" >> "$GITHUB_ENV"
- uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3.7.13
id: release
with:
monorepo-tags: true
release-type: python
path: thumbor_plugins/${{ matrix.subject }}
package-name: ${{ env.PACKAGE_NAME }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
if: ${{ steps.release.outputs.releases_created }}
with:
python-version: '3.x'
- name: Build package
if: ${{ steps.release.outputs.releases_created }}
working-directory: ./thumbor_plugins/${{ matrix.subject }}
working-directory: ${{ matrix.path }}
run: |
pip install -U pip
pip install -U build
python -m pip install -U pip build
python -m build
- name: Publish a Python distribution to PyPI
if: ${{ steps.release.outputs.releases_created }}
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: thumbor_plugins/${{ matrix.subject }}/dist
packages-dir: ${{ matrix.path }}/dist
skip-existing: true
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ release cycle. There is no root package to install.
`Content-Type` instead).
- CI (`.github/workflows/test.yml`) builds its matrix by finding every
`Dockerfile` under `thumbor_plugins/`, runs each package's tests in its own
image, and uploads coverage to Coveralls. The release workflow discovers
packages the same way, so a Dockerfile is what registers a package with
both.
image, and uploads coverage to Coveralls. The release workflow does not
look at Dockerfiles: it only releases the paths listed in
`release-please-config.json`.

## Code style

Expand Down Expand Up @@ -131,12 +131,14 @@ Makefile ← make test_<plugin> and make test_unit
release-please only looks at the commits that touch that package's
directory.
- Never hand-edit a `CHANGELOG.md`, the `version` in a `setup.py`, or
`.release-please-manifest.json`; the release PR changes all three.
`.release-please-manifest.json`; the release PR changes all three. The
only exception is adding a new package to the manifest.
- Every change must include tests. Run `make test_<plugin>` for the package
you touched before opening a PR.
- To add an optimizer, copy an existing directory, rename the package in
`setup.py`, `config.py` and the `config` import, give it a Dockerfile that
installs its binary, and add it to the README table.
installs its binary, register it in `release-please-config.json` and
`.release-please-manifest.json`, and add it to the README table.
- Dependabot opens daily PRs for `test_requirements.txt`. A stale workflow
is checked in, but GitHub disabled it for inactivity in June 2022, so it
closes nothing.
Expand Down
37 changes: 36 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
{
"bootstrap-sha": "abbad25f2d17370e46b0ad4921713312ba30d989"
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"bootstrap-sha": "abbad25f2d17370e46b0ad4921713312ba30d989",
"release-type": "python",
"include-component-in-tag": true,
"include-v-in-tag": true,
"separate-pull-requests": true,
"packages": {
"thumbor_plugins/optimizers/gifv": {
"component": "thumbor-plugins-gifv",
"package-name": "thumbor-plugins-gifv"
},
"thumbor_plugins/optimizers/jp2": {
"component": "thumbor-plugins-jp2",
"package-name": "thumbor-plugins-jp2"
},
"thumbor_plugins/optimizers/jpegrecompress": {
"component": "thumbor-plugins-jpegrecompress",
"package-name": "thumbor-plugins-jpegrecompress"
},
"thumbor_plugins/optimizers/mozjpeg": {
"component": "thumbor-plugins-mozjpeg",
"package-name": "thumbor-plugins-mozjpeg"
},
"thumbor_plugins/optimizers/optipng": {
"component": "thumbor-plugins-optipng",
"package-name": "thumbor-plugins-optipng"
},
"thumbor_plugins/optimizers/pngcrush": {
"component": "thumbor-plugins-pngcrush",
"package-name": "thumbor-plugins-pngcrush"
},
"thumbor_plugins/optimizers/pngquant": {
"component": "thumbor-plugins-pngquant",
"package-name": "thumbor-plugins-pngquant"
}
}
}
Loading