Skip to content
Draft
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
65 changes: 65 additions & 0 deletions .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Compress images on demand (workflow_dispatch), and at 12am every Sunday (schedule).
# Open a Pull Request if any images can be compressed.
name: Compress Images
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
Comment on lines +4 to +7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per PikachuEXE#87 (comment)

Suggested change
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
on:
workflow_dispatch:
push:
branches: [development]
paths:
- '_icons/**'
- 'src/renderer/assets/img/**'


permissions: {}

jobs:
compress:
# As this action runs on a schedule, only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
# Still allow the workflow to be manually triggered.
# If a fork does need this workflow, they can change this condition in their fork to include their repository.
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'
Comment on lines +13 to +16

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt needed anymore because there isnt a schedule

Suggested change
# As this action runs on a schedule, only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
# Still allow the workflow to be manually triggered.
# If a fork does need this workflow, they can change this condition in their fork to include their repository.
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'


name: Compress
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0

- name: Install Oxipng
run: cargo install oxipng
shell: bash

- name: Use Node.js 24.x
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
package-manager-cache: false

- name: Install pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 10
cache: false

- name: Compress SVG Images
run: pnpm dlx svgo -r -f . -o .
shell: bash

- name: Compress PNG Images
run: oxipng -o max --strip safe --recursive ./_icons ./src
shell: bash
Comment on lines +50 to +56

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeted dirs directly, remove recursive option as there isnt anything below those dirs. Let me know if you would prefer to include recursive anyway

Suggested change
- name: Compress SVG Images
run: pnpm dlx svgo -r -f . -o .
shell: bash
- name: Compress PNG Images
run: oxipng -o max --strip safe --recursive ./_icons ./src
shell: bash
- name: Compress SVG Images
run: |
pnpm dlx svgo -f ./_icons -o ./_icons
pnpm dlx svgo -f ./src/renderer/assets/img -o ./src/renderer/assets/img
shell: bash
- name: Compress PNG Images
run: oxipng -o max --strip safe ./_icons ./src/renderer/assets/img
shell: bash


- name: Create New Pull Request If Needed
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
title: Compressed Images Nightly
branch-suffix: timestamp
commit-message: Compress Images
body: |
Images automagically compressed by tools in `.github/workflows/compress-images.yml`
32 changes: 32 additions & 0 deletions .github/workflows/filediff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Filediff on Images
on:
pull_request:
branches: [ development ]

permissions: {}

jobs:
filediff:
name: filediff
runs-on: ubuntu-latest

permissions:
contents: read
issues: write
pull-requests: write
repository-projects: read

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Create filediff comment
uses: PikachuEXE/filediff@2cfa654ec8e72e7a78c504f0e862ca83738bf3b7 # v0.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_branch: ${{ github.event.repository.default_branch }}
dir_glob: "**/*.png,**/*.svg"
file_details_open: false
Binary file modified _icons/iconColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/renderer/assets/img/defaultBanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/renderer/assets/img/yt_logo_mono_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading