From c2e92552fce2890da0a46dc8ff18940054e2d85c Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Thu, 25 Feb 2021 16:57:33 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 'bibata-pr-ci' workflow merged to 'bibata-build'. - Makefile supports install & uninstall - GitHub workflow path changed --- .github/workflows/bibata-ci.yml | 146 ++++++++++++----------- .github/workflows/bibata-pr-build.yml | 94 --------------- .github/workflows/bibata-rainbow-ci.yml | 148 ++++++++++++------------ Makefile | 28 +++-- 4 files changed, 164 insertions(+), 252 deletions(-) delete mode 100644 .github/workflows/bibata-pr-build.yml diff --git a/.github/workflows/bibata-ci.yml b/.github/workflows/bibata-ci.yml index b570114a..0cde113e 100644 --- a/.github/workflows/bibata-ci.yml +++ b/.github/workflows/bibata-ci.yml @@ -1,92 +1,90 @@ name: bibata-ci on: - push: - paths-ignore: - - "**.md" - - "**.bbcode" - - "packages/rainbow/**" - - LICENSE - branches: [main, dev] + push: + paths-ignore: + - "**.md" + - "**.bbcode" + - "bitmapper/packages/rainbow/**" + - LICENSE + branches: [main, dev] + pull_request: + paths-ignore: + - "**.md" + - "**.bbcode" + - "bitmapper/packages/rainbow/**" + - LICENSE + branches: [main] jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v2 - - name: Install build dependencies (apt) - run: | - sudo apt install libx11-dev libxcursor-dev libpng-dev - continue-on-error: false + - name: Install build dependencies (apt) + run: sudo apt install -y libx11-dev libxcursor-dev libpng-dev + continue-on-error: false - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + - name: Caching yarn packages + uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - - uses: actions/setup-node@v1 - with: - node-version: "12.x" - - run: yarn install - - run: yarn render:bibata-modern - - run: yarn render:bibata-original + - name: Set Up NodeJS 12.x + uses: actions/setup-node@v1 + with: + node-version: "12.x" - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" + - name: Caching pip packages + uses: actions/cache@v2 + id: pip-cache # use this to check for `cache-hit` (`steps.pip-cache.outputs.cache-hit != 'true'`) + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- - - name: Cache pip dependencies - uses: actions/cache@v2 - with: - # This path is specific to Ubuntu - path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" - - name: Install pip dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - python setup.py install - continue-on-error: false + - name: Generating `Bibata-Modern` Cursor Theme + run: make modern - - name: Generating `Bibata` Cursor Theme - run: python build.py + - name: Uploading `Bibata-Modern` Bitmaps artifact + uses: actions/upload-artifact@v2 + with: + name: Bibata-Modern-Bitmaps + path: bitmaps/* - - name: Compressing Artifacts - run: | - tar -cvzf logs.tar.gz build.log - tar -cvzf bitmaps.tar.gz bitmaps - tar -cvzf Bibata.tar.gz themes + - name: Uploading `Bibata-Modern` Theme artifact + uses: actions/upload-artifact@v2 + with: + name: Bibata-Modern + path: themes/* - - name: Uploading `Bibata` Build Log artifact - uses: actions/upload-artifact@v2 - with: - name: logs - path: logs.tar.gz + - name: Generating `Bibata-Original` Cursor Theme + run: make original - - name: Uploading `bitmaps` artifact - uses: actions/upload-artifact@v2 - with: - name: bitmaps - path: bitmaps.tar.gz + - name: Uploading `Bibata-Original` Bitmaps artifact + uses: actions/upload-artifact@v2 + with: + name: Bibata-Original-Bitmaps + path: bitmaps/* - - name: Uploading `Bibata` Theme artifact - uses: actions/upload-artifact@v2 - with: - name: Bibata - path: Bibata.tar.gz + - name: Uploading `Bibata-Original` Theme artifact + uses: actions/upload-artifact@v2 + with: + name: Bibata-Original + path: themes/* diff --git a/.github/workflows/bibata-pr-build.yml b/.github/workflows/bibata-pr-build.yml deleted file mode 100644 index bfa3fdf1..00000000 --- a/.github/workflows/bibata-pr-build.yml +++ /dev/null @@ -1,94 +0,0 @@ - -name: bibata-pr - -on: - - pull_request: - paths-ignore: - - "**.md" - - "**.bbcode" - - "packages/rainbow/**" - - LICENSE - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install build dependencies (apt) - run: | - sudo apt install libx11-dev libxcursor-dev libpng-dev - continue-on-error: false - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - uses: actions/setup-node@v1 - with: - node-version: "12.x" - - run: yarn install - - run: yarn render:bibata-modern - - run: yarn render:bibata-original - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Cache pip dependencies - uses: actions/cache@v2 - with: - # This path is specific to Ubuntu - path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install pip dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - python setup.py install - continue-on-error: false - - - name: Generating `Bibata` Cursor Theme - run: python build.py - - - name: Compressing Artifacts - run: | - tar -cvzf logs.tar.gz build.log - tar -cvzf bitmaps.tar.gz bitmaps - tar -cvzf Bibata.tar.gz themes - - - name: Uploading `Bibata` Build Log artifact - uses: actions/upload-artifact@v2 - with: - name: logs - path: logs.tar.gz - - - name: Uploading `bitmaps` artifact - uses: actions/upload-artifact@v2 - with: - name: bitmaps - path: bitmaps.tar.gz - - - name: Uploading `Bibata` Theme artifact - uses: actions/upload-artifact@v2 - with: - name: Bibata - path: Bibata.tar.gz diff --git a/.github/workflows/bibata-rainbow-ci.yml b/.github/workflows/bibata-rainbow-ci.yml index 54ae3d77..6899ca4b 100644 --- a/.github/workflows/bibata-rainbow-ci.yml +++ b/.github/workflows/bibata-rainbow-ci.yml @@ -1,92 +1,92 @@ name: bibata-rainbow-ci on: - push: - paths: - - "packages/rainbow/**" - branches: [main, dev] - pull_request: - paths: - - "packages/rainbow/**" - branches: [main] + push: + paths: + - "bitmapper/packages/rainbow/**" + branches: [main, dev] + pull_request: + paths: + - "bitmapper/packages/rainbow/**" + branches: [main] jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v2 - - name: Install build dependencies (apt) - run: | - sudo apt install libx11-dev libxcursor-dev libpng-dev - continue-on-error: false + - name: Install build dependencies (apt) + run: | + sudo apt install libx11-dev libxcursor-dev libpng-dev + continue-on-error: false - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - - uses: actions/setup-node@v1 - with: - node-version: "12.x" - - run: yarn install - - run: yarn render:bibata-rainbow + - uses: actions/setup-node@v1 + with: + node-version: "12.x" + - run: yarn install + - run: yarn render:bibata-rainbow - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" - - name: Cache pip dependencies - uses: actions/cache@v2 - with: - # This path is specific to Ubuntu - path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- + - name: Cache pip dependencies + uses: actions/cache@v2 + with: + # This path is specific to Ubuntu + path: ~/.cache/pip + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- - - name: Install pip dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - python setup.py install - continue-on-error: false + - name: Install pip dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python setup.py install + continue-on-error: false - - name: Generating `Bibata Rainbow` Cursor Theme - run: python build.py -x + - name: Generating `Bibata Rainbow` Cursor Theme + run: python build.py -x - - name: Compressing Artifacts - run: | - tar -cvzf logs.tar.gz build.log - tar -cvzf bitmaps.tar.gz bitmaps - tar -cvzf Bibata.tar.gz themes + - name: Compressing Artifacts + run: | + tar -cvzf logs.tar.gz build.log + tar -cvzf bitmaps.tar.gz bitmaps + tar -cvzf Bibata.tar.gz themes - - name: Uploading `Bibata Rainbow` Build Log artifact - uses: actions/upload-artifact@v2 - with: - name: logs - path: logs.tar.gz + - name: Uploading `Bibata Rainbow` Build Log artifact + uses: actions/upload-artifact@v2 + with: + name: logs + path: logs.tar.gz - - name: Uploading `bitmaps` artifact - uses: actions/upload-artifact@v2 - with: - name: bitmaps - path: bitmaps.tar.gz + - name: Uploading `bitmaps` artifact + uses: actions/upload-artifact@v2 + with: + name: bitmaps + path: bitmaps.tar.gz - - name: Uploading `Bibata Rainbow` Theme artifact - uses: actions/upload-artifact@v2 - with: - name: Bibata - path: Bibata.tar.gz + - name: Uploading `Bibata Rainbow` Theme artifact + uses: actions/upload-artifact@v2 + with: + name: Bibata + path: Bibata.tar.gz diff --git a/Makefile b/Makefile index 6a198271..77f49a1f 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,14 @@ render_modern: bitmapper svg build: bitmaps @cd builder && make setup build +build_unix: bitmaps + @rm -rf themes + @cd builder && make setup build_unix + +build_windows: bitmaps + @rm -rf themes + @cd builder && make setup build_windows + build_modern: bitmaps @cd builder && make setup build_modern @@ -47,30 +55,30 @@ build_original: bitmaps .ONESHELL: SHELL:=/bin/bash -src = "./themes/Bibata-*-*" +src = ./themes/Bibata-* local := ~/.icons -local_dest := $(local)/$(theme) +local_dest := $(local)/Bibata-* root := /usr/share/icons -root_dest := $(root)/$(theme) +root_dest := $(root)/Bibata-* -install: $(src) +install: themes @if [[ $EUID -ne 0 ]]; then - @echo "> Installing '$(theme)' cursors inside $(local)/..." + @echo "> Installing 'Bibata' cursors inside $(local)/..." @mkdir -p $(local) - @cp -r $(src) $(local_dest) && echo "> Installed!" + @cp -r $(src) $(local)/ && echo "> Installed!" @else - @echo "> Installing '$(theme)' cursors inside $(root)/..." + @echo "> Installing 'Bibata' cursors inside $(root)/..." @mkdir -p $(root) - @sudo cp -r $(src) $(root_dest) && echo "> Installed!" + @sudo cp -r $(src) $(root)/ && echo "> Installed!" @fi uninstall: @if [[ $EUID -ne 0 ]]; then - @echo "> Removing '$(local_dest)'..." + @echo "> Removing 'Bibata' cursors from '$(local)'..." @rm -rf $(local_dest) @else - @echo "> Removing '$(root_dest)'..." + @echo "> Removing 'Bibata' cursors from '$(root)'..." @sudo rm -rf $(root_dest) @fi