Open/Update PR when rendered icons have changed #755
This file contains 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
name: Open/Update PR when rendered icons have changed | |
on: | |
push: | |
paths: | |
- '.github/workflows/open-pr-on-rendered-icons-changed.yaml' | |
- 'common/accent-colors.scss.in' | |
- 'icons/src/fullcolor/**' | |
- 'icons/src/symlinks/**' | |
schedule: | |
- cron: '8 0 * * *' | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
refresh-upstream: | |
name: Check rendered icon changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Yaru code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: true | |
- name: Setup common variables | |
id: env | |
run: | | |
echo "::set-output name=push-branch::auto-rendered-icons" | |
- name: Check Source changes | |
uses: dorny/paths-filter@v2 | |
id: check-changed | |
with: | |
base: ${{ steps.env.outputs.push-branch }} | |
filters: | | |
default: | |
- icons/src/fullcolor/default/** | |
- icons/src/fullcolor/render-bitmaps.py | |
mate: | |
- icons/src/fullcolor/mate/** | |
- icons/src/fullcolor/render-bitmaps.py | |
accented: | |
- common/accent-colors.scss.in | |
- icons/src/fullcolor/accented/** | |
- icons/src/fullcolor/render-bitmaps.py | |
symlinks: | |
- icons/src/symlinks/** | |
- name: Install dependencies | |
if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
run: | | |
sudo apt install software-properties-common | |
sudo add-apt-repository ppa:inkscape.dev/stable | |
sudo apt update | |
sudo apt install sassc python3-pip xvfb inkscape optipng scour | |
sudo pip3 install meson ninja | |
- name: Configure project | |
if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
run: | | |
meson _build -Dmate=true -Dmate-dark=true | |
- name: Render default icons and generate symlinks | |
if: steps.check-changed.outputs.default == 'true' | |
run: | | |
ninja -C _build -v \ | |
cleanup-rendered-icons-default \ | |
cleanup-symlinks-default | |
ninja -C _build -v render+symlink-icons-default | |
- name: Render mate icons and generate symlinks | |
if: steps.check-changed.outputs.mate == 'true' | |
run: | | |
ninja -C _build -v \ | |
cleanup-rendered-icons-mate \ | |
cleanup-symlinks-mate | |
ninja -C _build -v render+symlink-icons-mate | |
- name: Render accented icons and generate symlinks | |
if: steps.check-changed.outputs.accented == 'true' | |
run: | | |
ninja -C _build -v \ | |
cleanup-rendered-icons-accented \ | |
cleanup-symlinks-accented | |
ninja -C _build -v render+symlink-icons-accented | |
- name: Symlink all icons | |
if: steps.check-changed.outputs.symlinks == 'true' | |
run: | | |
find icons/Yaru{,-*} -type l -delete | |
ninja -C _build -v symlink-icons | |
- name: Check Rendering changes | |
if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
id: check-rendering | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then | |
changed=false | |
else | |
changed=true | |
fi | |
echo "::set-output name=changed::${changed}" | |
- name: Create or update Pull Request | |
if: steps.check-rendering.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: "icons: Update rendered icons and symlinks" | |
title: Auto rendered icons updates | |
labels: automated pr, new upstream | |
body: "[New rendered icons / symlinks changes](https://github.com/ubuntu/yaru/actions/workflows/open-pr-on-rendered-icons-changed.yaml) by GitHub Action" | |
branch: ${{ steps.env.outputs.push-branch }} |