- '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: 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:
@ -17,15 +24,15 @@ jobs:
- 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
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 }}
@ -33,60 +40,51 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- uses: actions/setup-node@v1 - name: Set Up NodeJS 12.x
uses: actions/setup-node@v1
with: with:
node-version: "12.x" node-version: "12.x"
- run: yarn install
- run: yarn render:bibata-modern
- run: yarn render:bibata-original
- name: Set up Python - name: Caching pip packages
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Cache pip dependencies
uses: actions/cache@v2 uses: actions/cache@v2
id: pip-cache # use this to check for `cache-hit` (`steps.pip-cache.outputs.cache-hit != 'true'`)
with: with:
# 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 key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pip dependencies - name: Set up Python 3.8
run: | uses: actions/setup-python@v2
python -m pip install --upgrade pip with:
python -m pip install --upgrade setuptools python-version: "3.8"
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: Generating `Bibata-Modern` Cursor Theme
run: python build.py run: make modern
- name: Compressing Artifacts - name: Uploading `Bibata-Modern` Bitmaps artifact
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 uses: actions/upload-artifact@v2
with: with:
name: logs name: Bibata-Modern-Bitmaps
path: logs.tar.gz path: bitmaps/*
- name: Uploading `bitmaps` artifact - name: Uploading `Bibata-Modern` Theme artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bitmaps name: Bibata-Modern
path: bitmaps.tar.gz 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 uses: actions/upload-artifact@v2
with: with:
name: Bibata name: Bibata-Original-Bitmaps
path: Bibata.tar.gz 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: 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:

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