ci: add workflow to render all logos
This will render all logos to be seen in `all_logos.md` using typst
This commit is contained in:
parent
d3a1d12c34
commit
7527c3b18f
48
.github/workflows/check.yml
vendored
48
.github/workflows/check.yml
vendored
@ -1,7 +1,14 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
name: CI
|
||||
|
||||
env:
|
||||
PF_INFO: "ascii"
|
||||
PF_PAD1: 0
|
||||
PF_PAD2: 0
|
||||
PF_PAD3: 0
|
||||
|
||||
jobs:
|
||||
checks:
|
||||
name: ${{ matrix.name }} (${{ matrix.target }})
|
||||
@ -77,12 +84,49 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --target=${{ matrix.target }}
|
||||
args: --target=${{ matrix.target }} --target-dir=/tmp
|
||||
use-cross: ${{ matrix.cross }}
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pfetch-${{ matrix.target }}
|
||||
path: /tmp/${{ matrix.target }}/debug/pfetch
|
||||
|
||||
- name: Test
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --target=${{ matrix.target }}
|
||||
if: ${{ !matrix.cross }}
|
||||
render:
|
||||
needs: checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Jetbrains Mono
|
||||
run: sudo apt update && sudo apt install -y fonts-jetbrains-mono
|
||||
|
||||
- name: Install typst
|
||||
uses: yusancky/setup-typst@v2
|
||||
with:
|
||||
version: 'v0.8.0'
|
||||
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: pfetch-x86_64-unknown-linux-gnu
|
||||
path: /tmp/
|
||||
|
||||
- name: Run render script
|
||||
run: sudo chmod +x /tmp/pfetch && cd ./tools/ && ./render_all.sh /tmp/pfetch
|
||||
|
||||
- name: Commit Files
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
add:
|
||||
assets all_logos.md
|
||||
default_author: github_actions
|
||||
message: "chore(logos): re-render all logos"
|
||||
|
||||
@ -23,6 +23,8 @@ Leap, OpenWrt, Oracle Linux _(new)_, Parabola, Pop!\_OS _(updated)_, PureOS,
|
||||
Raspbian, Rocky Linux _(new)_, SerenityOS, Slackware, Solus, SteamOS _(new)_,
|
||||
Solaris, Ubuntu, Vanilla OS _(new)_, Void Linux, Windows _(new)_, Xeonix Linux
|
||||
|
||||
You can check out how they look [here](./all_logos.md).
|
||||
|
||||
For all other distributions, a penguin will be displayed.
|
||||
|
||||
_Credit to [the original pfetch](https://github.com/dylanaraps/pfetch) and
|
||||
|
||||
@ -49,6 +49,7 @@ commit_parsers = [
|
||||
{ message = "^style", group = "Styling"},
|
||||
{ message = "^test", group = "Testing"},
|
||||
{ message = "^chore\\(release\\): prepare for", skip = true},
|
||||
{ message = "^chore\\(logos\\): re-render all logos", skip = true},
|
||||
{ message = "^chore", group = "Miscellaneous"},
|
||||
{ body = ".*security", group = "Security"},
|
||||
]
|
||||
|
||||
8
print_all.sh → tools/all_logos.txt
Executable file → Normal file
8
print_all.sh → tools/all_logos.txt
Executable file → Normal file
@ -1,10 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A small script to run pfetch (command specified with arguments) with all available logos
|
||||
|
||||
while read -r logo; do
|
||||
PF_ASCII=$logo "$@"
|
||||
done << EOF
|
||||
alma
|
||||
alpine
|
||||
android
|
||||
@ -70,4 +63,3 @@ vanilla
|
||||
void
|
||||
windows
|
||||
xeonix
|
||||
EOF
|
||||
7
tools/print_all.sh
Executable file
7
tools/print_all.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# A small script to run pfetch (command specified with arguments) with all available logos
|
||||
|
||||
while read -r logo; do
|
||||
PF_ASCII=$logo "$@"
|
||||
done < ./all_logos.txt
|
||||
14
tools/render_all.sh
Executable file
14
tools/render_all.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "# List Of All Logos" > ../all_logos.md
|
||||
echo "Generated using \`./tools/render_all.sh\`" >> ../all_logos.md
|
||||
while read -r logo; do
|
||||
echo "$logo"
|
||||
PF_ASCII=$logo "$@" > ./tmp || exit 1
|
||||
mkdir -p ../assets/logos
|
||||
typst compile -f svg renderer.typ ../assets/logos/"$logo".svg || exit 1
|
||||
echo "## $logo" >> ../all_logos.md
|
||||
echo "<img src=\"./assets/logos/$logo.svg\" width=\"230\">" >> ../all_logos.md
|
||||
echo "" >> ../all_logos.md
|
||||
done < ./all_logos.txt
|
||||
rm tmp
|
||||
12
tools/renderer.typ
Normal file
12
tools/renderer.typ
Normal file
@ -0,0 +1,12 @@
|
||||
#import "@preview/ansi-render:0.5.0": *
|
||||
|
||||
#set page(width: auto, height: auto, margin: .5cm)
|
||||
|
||||
#ansi-render(
|
||||
read("./tmp"),
|
||||
theme: terminal-themes.putty,
|
||||
bold-is-bright: true,
|
||||
font: "JetBrains Mono",
|
||||
inset: 8pt,
|
||||
radius: 5pt,
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user