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

@ -1,92 +1,90 @@
name: bibata-ci name: bibata-ci
on: on:
push: push:
paths-ignore: paths-ignore:
- "**.md" - "**.md"
- "**.bbcode" - "**.bbcode"
- "packages/rainbow/**" - "bitmapper/packages/rainbow/**"
- LICENSE - LICENSE
branches: [main, dev] branches: [main, dev]
pull_request:
paths-ignore:
- "**.md"
- "**.bbcode"
- "bitmapper/packages/rainbow/**"
- LICENSE
branches: [main]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install build dependencies (apt) - name: Install build dependencies (apt)
run: | run: sudo apt install -y libx11-dev libxcursor-dev libpng-dev
sudo apt install libx11-dev libxcursor-dev libpng-dev continue-on-error: false
continue-on-error: false
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2 - name: Caching yarn packages
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) uses: actions/cache@v2
with: id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} with:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
restore-keys: | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn- restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/setup-node@v1 - name: Set Up NodeJS 12.x
with: uses: actions/setup-node@v1
node-version: "12.x" with:
- run: yarn install node-version: "12.x"
- run: yarn render:bibata-modern
- run: yarn render:bibata-original
- name: Set up Python - name: Caching pip packages
uses: actions/setup-python@v2 uses: actions/cache@v2
with: id: pip-cache # use this to check for `cache-hit` (`steps.pip-cache.outputs.cache-hit != 'true'`)
python-version: "3.x" with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip dependencies - name: Set up Python 3.8
uses: actions/cache@v2 uses: actions/setup-python@v2
with: with:
# This path is specific to Ubuntu python-version: "3.8"
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 - name: Generating `Bibata-Modern` Cursor Theme
run: | run: make modern
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 - name: Uploading `Bibata-Modern` Bitmaps artifact
run: python build.py uses: actions/upload-artifact@v2
with:
name: Bibata-Modern-Bitmaps
path: bitmaps/*
- name: Compressing Artifacts - name: Uploading `Bibata-Modern` Theme artifact
run: | uses: actions/upload-artifact@v2
tar -cvzf logs.tar.gz build.log with:
tar -cvzf bitmaps.tar.gz bitmaps name: Bibata-Modern
tar -cvzf Bibata.tar.gz themes path: themes/*
- name: Uploading `Bibata` Build Log artifact - name: Generating `Bibata-Original` Cursor Theme
uses: actions/upload-artifact@v2 run: make original
with:
name: logs
path: logs.tar.gz
- name: Uploading `bitmaps` artifact - name: Uploading `Bibata-Original` Bitmaps artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bitmaps name: Bibata-Original-Bitmaps
path: bitmaps.tar.gz path: bitmaps/*
- name: Uploading `Bibata` Theme artifact - name: Uploading `Bibata-Original` Theme artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Bibata name: Bibata-Original
path: Bibata.tar.gz 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

@ -1,92 +1,92 @@
name: bibata-rainbow-ci name: bibata-rainbow-ci
on: on:
push: push:
paths: paths:
- "packages/rainbow/**" - "bitmapper/packages/rainbow/**"
branches: [main, dev] branches: [main, dev]
pull_request: pull_request:
paths: paths:
- "packages/rainbow/**" - "bitmapper/packages/rainbow/**"
branches: [main] branches: [main]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install build dependencies (apt) - name: Install build dependencies (apt)
run: | run: |
sudo apt install libx11-dev libxcursor-dev libpng-dev sudo apt install libx11-dev libxcursor-dev libpng-dev
continue-on-error: false continue-on-error: false
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2 - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: "12.x" node-version: "12.x"
- run: yarn install - run: yarn install
- run: yarn render:bibata-rainbow - run: yarn render:bibata-rainbow
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: "3.x" python-version: "3.x"
- name: Cache pip dependencies - name: Cache pip dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
# This path is specific to Ubuntu # This path is specific to Ubuntu
path: ~/.cache/pip path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file # 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('requirements.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
${{ runner.os }}- ${{ runner.os }}-
- name: Install pip dependencies - name: Install pip dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install --upgrade setuptools python -m pip install --upgrade setuptools
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python setup.py install python setup.py install
continue-on-error: false continue-on-error: false
- name: Generating `Bibata Rainbow` Cursor Theme - name: Generating `Bibata Rainbow` Cursor Theme
run: python build.py -x run: python build.py -x
- name: Compressing Artifacts - name: Compressing Artifacts
run: | run: |
tar -cvzf logs.tar.gz build.log tar -cvzf logs.tar.gz build.log
tar -cvzf bitmaps.tar.gz bitmaps tar -cvzf bitmaps.tar.gz bitmaps
tar -cvzf Bibata.tar.gz themes tar -cvzf Bibata.tar.gz themes
- name: Uploading `Bibata Rainbow` Build Log artifact - name: Uploading `Bibata Rainbow` Build Log artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: logs name: logs
path: logs.tar.gz path: logs.tar.gz
- name: Uploading `bitmaps` artifact - name: Uploading `bitmaps` artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bitmaps name: bitmaps
path: bitmaps.tar.gz path: bitmaps.tar.gz
- name: Uploading `Bibata Rainbow` Theme artifact - name: Uploading `Bibata Rainbow` Theme artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Bibata name: Bibata
path: Bibata.tar.gz path: Bibata.tar.gz

View file

@ -34,6 +34,14 @@ render_modern: bitmapper svg
build: bitmaps build: bitmaps
@cd builder && make setup build @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 build_modern: bitmaps
@cd builder && make setup build_modern @cd builder && make setup build_modern
@ -47,30 +55,30 @@ build_original: bitmaps
.ONESHELL: .ONESHELL:
SHELL:=/bin/bash SHELL:=/bin/bash
src = "./themes/Bibata-*-*" src = ./themes/Bibata-*
local := ~/.icons local := ~/.icons
local_dest := $(local)/$(theme) local_dest := $(local)/Bibata-*
root := /usr/share/icons root := /usr/share/icons
root_dest := $(root)/$(theme) root_dest := $(root)/Bibata-*
install: $(src) install: themes
@if [[ $EUID -ne 0 ]]; then @if [[ $EUID -ne 0 ]]; then
@echo "> Installing '$(theme)' cursors inside $(local)/..." @echo "> Installing 'Bibata' cursors inside $(local)/..."
@mkdir -p $(local) @mkdir -p $(local)
@cp -r $(src) $(local_dest) && echo "> Installed!" @cp -r $(src) $(local)/ && echo "> Installed!"
@else @else
@echo "> Installing '$(theme)' cursors inside $(root)/..." @echo "> Installing 'Bibata' cursors inside $(root)/..."
@mkdir -p $(root) @mkdir -p $(root)
@sudo cp -r $(src) $(root_dest) && echo "> Installed!" @sudo cp -r $(src) $(root)/ && echo "> Installed!"
@fi @fi
uninstall: uninstall:
@if [[ $EUID -ne 0 ]]; then @if [[ $EUID -ne 0 ]]; then
@echo "> Removing '$(local_dest)'..." @echo "> Removing 'Bibata' cursors from '$(local)'..."
@rm -rf $(local_dest) @rm -rf $(local_dest)
@else @else
@echo "> Removing '$(root_dest)'..." @echo "> Removing 'Bibata' cursors from '$(root)'..."
@sudo rm -rf $(root_dest) @sudo rm -rf $(root_dest)
@fi @fi