- 'bibata-pr-ci' workflow merged to 'bibata-build'.
- Makefile supports install & uninstall
- GitHub workflow path changed
This commit is contained in:
ful1e5 2021-02-25 16:57:33 +05:30
parent b7b0797458
commit c2e92552fc
4 changed files with 164 additions and 252 deletions

View file

@ -5,9 +5,16 @@ on:
paths-ignore:
- "**.md"
- "**.bbcode"
- "packages/rainbow/**"
- "bitmapper/packages/rainbow/**"
- LICENSE
branches: [main, dev]
pull_request:
paths-ignore:
- "**.md"
- "**.bbcode"
- "bitmapper/packages/rainbow/**"
- LICENSE
branches: [main]
jobs:
build:
@ -17,15 +24,15 @@ jobs:
- uses: actions/checkout@v2
- name: Install build dependencies (apt)
run: |
sudo apt install libx11-dev libxcursor-dev libpng-dev
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)"
- uses: actions/cache@v2
- 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 }}
@ -33,60 +40,51 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/setup-node@v1
- name: Set Up NodeJS 12.x
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
- 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:
# 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') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
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: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Generating `Bibata` Cursor Theme
run: python build.py
- name: Generating `Bibata-Modern` Cursor Theme
run: make modern
- 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
- name: Uploading `Bibata-Modern` Bitmaps artifact
uses: actions/upload-artifact@v2
with:
name: logs
path: logs.tar.gz
name: Bibata-Modern-Bitmaps
path: bitmaps/*
- name: Uploading `bitmaps` artifact
- name: Uploading `Bibata-Modern` Theme artifact
uses: actions/upload-artifact@v2
with:
name: bitmaps
path: bitmaps.tar.gz
name: Bibata-Modern
path: themes/*
- name: Uploading `Bibata` Theme artifact
- name: Generating `Bibata-Original` Cursor Theme
run: make original
- name: Uploading `Bibata-Original` Bitmaps artifact
uses: actions/upload-artifact@v2
with:
name: Bibata
path: Bibata.tar.gz
name: Bibata-Original-Bitmaps
path: bitmaps/*
- name: Uploading `Bibata-Original` Theme artifact
uses: actions/upload-artifact@v2
with:
name: Bibata-Original
path: themes/*

View file

@ -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

View file

@ -3,11 +3,11 @@ name: bibata-rainbow-ci
on:
push:
paths:
- "packages/rainbow/**"
- "bitmapper/packages/rainbow/**"
branches: [main, dev]
pull_request:
paths:
- "packages/rainbow/**"
- "bitmapper/packages/rainbow/**"
branches: [main]
jobs:

View file

@ -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