From a8b64bdf5d2e4084e331d3a7d53a8fdbd6155a23 Mon Sep 17 00:00:00 2001 From: Lea Date: Sat, 29 Jul 2023 20:26:22 +0200 Subject: [PATCH] build css in workflow --- .forgejo/workflows/build-and-release.yaml | 34 +++++++++++++++++++++++ build.sh | 6 ++++ 2 files changed, 40 insertions(+) create mode 100644 .forgejo/workflows/build-and-release.yaml diff --git a/.forgejo/workflows/build-and-release.yaml b/.forgejo/workflows/build-and-release.yaml new file mode 100644 index 0000000..c272e97 --- /dev/null +++ b/.forgejo/workflows/build-and-release.yaml @@ -0,0 +1,34 @@ +name: Build and release + +on: + push: + branches: [master] + +jobs: + relesae: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + apt-get install -y npm + npm install -g less + + - name: Check out repository + uses: actions/checkout@v3 + + - name: Build CSS + run: ./build.sh + id: build + + - name: Publish release + uses: actions/forgejo-release@v1 + with: + direction: upload + release-dir: dist + token: ${{ github.token }} + tag: $(git rev-parse --short ${{ github.sha }}) + release-notes: | + ```ini + [ui] + THEMES = ${{ steps.build.outputs.themes }} + ``` diff --git a/build.sh b/build.sh index 3eaa563..0b48322 100755 --- a/build.sh +++ b/build.sh @@ -3,12 +3,18 @@ BASEDIR="$( cd "$( dirname "$0" )" && pwd )" cd "${BASEDIR}" +theme_list="" + for theme in edge gruvbox gruvbox-material everforest; do for variant in dark light auto; do + theme-list="$theme_list,$theme-$variant" lessc -x "src/${theme}-${variant}.less" > "dist/theme-${theme}-${variant}.css" done done for theme in nord palenight soft-era sonokai sonokai-andromeda sonokai-atlantis sonokai-espresso sonokai-maia sonokai-shusia; do + theme-list="$theme_list,$theme" lessc -x "src/${theme}.less" > "dist/theme-${theme}.css" done + +echo "themes=$theme_list" >> $GITHUB_OUTPUT