Skip to content

Commit

Permalink
Restructure for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TylersApps committed May 13, 2024
1 parent 5ec03c3 commit 5298dbb
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 15 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy repository to Github Pages

on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: |
./build_site.sh _site
- uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
79 changes: 79 additions & 0 deletions build_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

# This script has been specially modified to exclude the branch, in order to maintain backwards compatibility
# feederbox826//2024-04-06

# builds a repository of scrapers
# outputs to _site with the following structure:
# index.yml
# <scraper_id>.zip
# Each zip file contains the scraper.yml file and any other files in the same directory

outdir="$1"
if [ -z "$outdir" ]; then
outdir="_site"
fi

rm -rf "$outdir"
mkdir -p "$outdir"

buildPlugin()
{
f=$1

if grep -q "^#pkgignore" "$f"; then
return
fi

# get the scraper id from the directory
dir=$(dirname "$f")
plugin_id=$(basename "$f" .yml)

echo "Processing $plugin_id"

# create a directory for the version
version=$(git log -n 1 --pretty=format:%h -- "$dir"/*)
updated=$(TZ=UTC0 git log -n 1 --date="format-local:%F %T" --pretty=format:%ad -- "$dir"/*)

# create the zip file
# copy other files
zipfile=$(realpath "$outdir/$plugin_id.zip")

pushd "$dir" > /dev/null
zip -r "$zipfile" . > /dev/null
popd > /dev/null

name=$(grep "^name:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
description=$(grep "^description:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
ymlVersion=$(grep "^version:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
version="$ymlVersion-$version"
# set IFS
IFS=$'\n' dep=$(grep "^# requires:" "$f" | cut -c 12- | sed -e 's/\r//')

# write to spec index
echo "- id: $plugin_id
name: $name
metadata:
description: $description
version: $version
date: $updated
path: $plugin_id.zip
sha256: $(sha256sum "$zipfile" | cut -d' ' -f1)" >> "$outdir"/index.yml

# handle dependencies
if [ ! -z "$dep" ]; then
echo " requires:" >> "$outdir"/index.yml
for d in ${dep//,/ }; do
echo " - $d" >> "$outdir"/index.yml
done
fi

echo "" >> "$outdir"/index.yml
}

find ./plugins -mindepth 1 -name *.yml | while read file; do
buildPlugin "$file"
done
find ./themes -mindepth 1 -name *.yml | while read file; do
buildPlugin "$file"
done
17 changes: 8 additions & 9 deletions dracula-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
/* =========<< DRACULA OFFICIAL COLORS >>========= */

/* Standard */
--dracula_background: #282A36; /* #fff */
--dracula_background: #282A36;
--dracula_foreground: #F8F8F2;
--dracula_selection: #44475A; /* #334350 */
--dracula_selection: #44475A;
--dracula_comment: #6272A4;
--dracula_red: #FF5555; /* #db3737 */
--dracula_orange: #FFB86C; /* #d9822b */
--dracula_red: #FF5555;
--dracula_orange: #FFB86C;
--dracula_yellow: #f1fa8c;
--dracula_green: #50FA7B; /* #0f9960 */
--dracula_purple: #BD93F9; /* #137cbd */
--dracula_green: #50FA7B;
--dracula_purple: #BD93F9;
--dracula_cyan: #8BE9FD;
--dracula_pink: #FF79C6; /* #17a2b8 */
--dracula_pink: #FF79C6;

/* ANSI */
--ansi_black: #21222C;
Expand Down Expand Up @@ -4805,5 +4805,4 @@ div.thumbnail-section
text-shadow: 1px 1px 1px var(--my_superdark);
stroke: var(--ansi_red);
stroke-width: 15;
}

}
12 changes: 6 additions & 6 deletions setup.yml → dracula-theme.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Dracula Theme
description: A dark theme for Stash based on the popular Dracula theme.
version: 1
ui:
css:
- dracula-theme.css
name: Dracula Theme
description: A dark theme for Stash based on the popular Dracula theme.
version: 1
ui:
css:
- dracula-theme.css
8 changes: 8 additions & 0 deletions index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- id: stashDraculaTheme
name: Stash Dracula Theme
metadata:
description: Dracula Theme for Stash by UncertainMongoose (Yoyo128)
version: 0.1
date: 5/12/2025
path: dracula-theme.zip
sha256: Attempt to pull your plugin via Stash for the first time and it will spit out the expected sha256 that you can then paste here.

0 comments on commit 5298dbb

Please sign in to comment.