diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-09-17 15:34:31 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-09-17 15:35:55 -0400 |
commit | 5f7a391fd1efff6fad4bc507acc38e82c90276b6 (patch) | |
tree | 7fb3f26c13f47ea0fb3c5de77e7aa2883478dfc3 /.github/workflows/workflow.yml | |
parent | 5bc91eaa6dc45019a98dc27b98923e446b767c28 (diff) | |
download | lite-xl-colors-5f7a391fd1efff6fad4bc507acc38e82c90276b6.tar.gz lite-xl-colors-5f7a391fd1efff6fad4bc507acc38e82c90276b6.zip |
Added in auto-generation and ran for the first time.
Diffstat (limited to '.github/workflows/workflow.yml')
-rw-r--r-- | .github/workflows/workflow.yml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..4117b73 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,34 @@ +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 + perl -pi -e 'exit(0) if $_ =~ m/^\-\-\-/' README.md + echo "---" >> README.md + echo -e "\n## Dark\n" >> README.md + echo "| Theme | Preview" >> README.md + echo "| :------------------------------------------------------------ | :----------------------------------------------------" >> README.md + ./lpm table manifest.json --type color --tag "dark" | tail -n +3 | perl -pe '($w) = $_ =~ m/`([^`]+)`/; $_ =~ s/$/ \!\[$w\_preview\](previews\/$w.svg)/ if $w' >> README.md + echo -e "\n## Light\n" >> README.md + echo "| Theme | Preview" >> README.md + echo "| :------------------------------------------------------------ | :----------------------------------------------------" >> README.md + ./lpm table manifest.json --type color --tag "light" | tail -n +3 | perl -pe '($w) = $_ =~ m/`([^`]+)`/; $_ =~ s/$/ \!\[$w\_preview\](previews\/$w.svg)/ if $w' >> 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 + |