-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,29 +104,18 @@ jobs: | |
|
||
oxipng: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # git push | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
token: ${{ secrets.PR_PUSH_TOKEN }} | ||
|
||
- name: "Run oxipng to reduce PNG sizes" | ||
run: | | ||
wget https://github.com/shssoichiro/oxipng/releases/download/v${OXIPNG_VERSION}/oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl.tar.gz \ | ||
-O /tmp/oxipng.tar.gz | ||
tar -xvzf /tmp/oxipng.tar.gz -C /tmp | ||
mv /tmp/oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl/oxipng ./oxipng | ||
chmod +x ./oxipng | ||
./oxipng --version | ||
./oxipng --strip safe --alpha -r src | ||
# See https://github.com/EndBug/add-and-commit#add--commit. | ||
- name: "Commit changes" | ||
uses: EndBug/add-and-commit@v9 | ||
# Dispatch workflow | ||
- uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
author_name: 'Godot-Rust Automation' | ||
author_email: '[email protected]' | ||
message: 'Auto-reduce PNG sizes' | ||
add: 'src/**/*.png' | ||
#token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow: 'push-oxipng-image.yml' | ||
inputs: '{ "repository": "${{ github.event.pull_request.head.repo.full_name }}", "branch": "${{ github.event.pull_request.head.ref }}" }' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (c) godot-rust; Bromeon and contributors. | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
name: "Push oxipng image" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
description: "owner/repo" | ||
required: true | ||
branch: | ||
description: "branch used for PR" | ||
required: true | ||
|
||
env: | ||
OXIPNG_VERSION: "9.1.1" | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: write # git push for oxipng | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
oxipng-write: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # git push | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
ref: ${{ github.event.inputs.branch }} | ||
token: ${{ secrets.PR_PUSH_TOKEN }} | ||
|
||
- name: "Run oxipng to reduce PNG sizes" | ||
run: | | ||
wget https://github.com/shssoichiro/oxipng/releases/download/v${OXIPNG_VERSION}/oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl.tar.gz \ | ||
-O /tmp/oxipng.tar.gz | ||
tar -xvzf /tmp/oxipng.tar.gz -C /tmp | ||
mv /tmp/oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl/oxipng ./oxipng | ||
chmod +x ./oxipng | ||
./oxipng --version | ||
./oxipng --strip safe --alpha -r src | ||
# See https://github.com/EndBug/add-and-commit#add--commit. | ||
- name: "Commit changes" | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: 'Godot-Rust Automation' | ||
author_email: '[email protected]' | ||
message: 'Auto-reduce PNG sizes' | ||
add: 'src/**/*.png' |