diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8efeaf2..ed93722 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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" diff --git a/README.md b/README.md index 3abbd94..6da68ff 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cliff.toml b/cliff.toml index eaa5d3c..3cb0f15 100644 --- a/cliff.toml +++ b/cliff.toml @@ -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"}, ] diff --git a/print_all.sh b/tools/all_logos.txt old mode 100755 new mode 100644 similarity index 74% rename from print_all.sh rename to tools/all_logos.txt index ebc3a75..e954b52 --- a/print_all.sh +++ b/tools/all_logos.txt @@ -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 diff --git a/tools/print_all.sh b/tools/print_all.sh new file mode 100755 index 0000000..ee85fe4 --- /dev/null +++ b/tools/print_all.sh @@ -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 diff --git a/tools/render_all.sh b/tools/render_all.sh new file mode 100755 index 0000000..0ac6f96 --- /dev/null +++ b/tools/render_all.sh @@ -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 "" >> ../all_logos.md + echo "" >> ../all_logos.md +done < ./all_logos.txt +rm tmp diff --git a/tools/renderer.typ b/tools/renderer.typ new file mode 100644 index 0000000..40dc02f --- /dev/null +++ b/tools/renderer.typ @@ -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, +)