aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/workflow.yml
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-10-10 16:38:47 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-10-10 16:38:47 -0400
commit40b51358400dfbc875d031b5a6cd92d09f1f51d4 (patch)
treebdf75ff0da2a187bc07dd017411021975e1bfd52 /.github/workflows/workflow.yml
parent826b819b731849779dfeb0144d2372785a318832 (diff)
parent3c9753416961ce86094eb4bf812d1f352cf7ff7b (diff)
downloadlite-xl-colors-40b51358400dfbc875d031b5a6cd92d09f1f51d4.tar.gz
lite-xl-colors-40b51358400dfbc875d031b5a6cd92d09f1f51d4.zip
Merge remote-tracking branch 'upstream/master' into flexoki
Diffstat (limited to '.github/workflows/workflow.yml')
-rw-r--r--.github/workflows/workflow.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
new file mode 100644
index 0000000..6022eae
--- /dev/null
+++ b/.github/workflows/workflow.yml
@@ -0,0 +1,31 @@
+name: Update README
+
+on:
+ push:
+ branches: [master]
+
+jobs:
+ reorganize:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Generate table with `lpm`
+ run: |
+ wget https://github.com/lite-xl/lite-xl-plugin-manager/releases/download/latest/lpm.x86_64-linux -O lpm && chmod +x lpm
+ # Unstub all stubs so we can make proper previews.
+ ./lpm --userdir . init . && ./lpm --userdir . color install "*" && ./lpm purge --userdir .
+ ./lpm exec scripts/make_preview_image.lua colors/*
+ # Remove everything after the --- so we can regenerate it.
+ perl -pi -e 'exit(0) if $_ =~ m/^\-\-\-/' README.md
+ echo "---" >> README.md
+ echo -e "\n## Dark\n" >> README.md
+ ./lpm list --repository . --type color --tag "dark" --table 'url,{string.format("![%s_preview](previews/%s.svg)", addon.id,addon.id)}' --type color --header Theme,Preview >> README.md
+ echo -e "\n## Light\n" >> README.md
+ ./lpm list --repository . --type color --tag "light" --table 'url,{string.format("![%s_preview](previews/%s.svg)", addon.id,addon.id)}' --type color --header Theme,Preview >> README.md
+ if ! git diff --exit-code -s README.md; then
+ git config --global user.name "Github Actions" && git config --global user.email "<>"
+ git add README.md previews
+ git commit -m '[CI] Updated README.md.'
+ git push
+ fi
+