🚀 Github Action 'build'

This commit is contained in:
ful1e5 2021-02-03 17:32:50 +05:30
parent e4aa2ccbee
commit f4e1a7377a
12 changed files with 37 additions and 39 deletions

View file

@ -27,6 +27,11 @@ jobs:
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: Set Up NodeJS 12.x
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- 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)"
@ -39,51 +44,44 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- uses: actions/setup-node@v1 - name: Set up Python 3.8
with:
node-version: "12.x"
- run: yarn install
- run: yarn render
- name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: "3.x" python-version: "3.8"
- name: Cache pip dependencies - name: Get pip cache directory path
uses: actions/cache@v2 id: pip-cache-dir-path
run: echo "::set-output name=dir::$(pip cache dir)"
- 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: ${{ steps.pip-cache-dir-path.outputs.dir }}
path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
continue-on-error: false
- name: Generating `macOSBigSur` Cursor Theme - name: Generating `macOSBigSur` Cursor Theme
run: python build.py run: make
- name: Compressing Artifacts - name: Compressing Artifacts
run: | run: |
tar -cvzf logs.tar.gz build.log tar -cvzf macOSBigSur.tar.gz themes/macOSBigSur
tar -cvzf bitmaps.tar.gz bitmaps
tar -cvzf macOSBigSur.tar.gz themes
- 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
- name: Uploading `macOSBigSur` Theme artifact - name: Uploading `macOSBigSur` UNIX Theme artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: macOSBigSur name: macOSBigSur
path: macOSBigSur.tar.gz path: macOSBigSur.tar.gz
- name: Uploading `macOSBigSur` Windows Theme artifact
uses: actions/upload-artifact@v2
with:
name: macOSBigSur_Windows
path: themes/macOSBigSur_Windows/*

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
########## Custom ########## Custom
pngs bitmaps
themes themes
builder/files.txt builder/files.txt

View file

@ -9,21 +9,21 @@ root_dest := $(root)/$(theme)
all: clean render build all: clean render build
unix: clean render pngs unix: clean render bitmaps
@cd builder && make build_unix @cd builder && make build_unix
windows: clean render pngs windows: clean render bitmaps
@cd builder && make build_windows @cd builder && make build_windows
.PHONY: all .PHONY: all
clean: clean:
@rm -rf pngs themes @rm -rf bitmaps themes
render: bitmap svg render: bitmapper svg
@cd bitmap && $(MAKE) @cd bitmapper && $(MAKE)
build: pngs build: bitmaps
@cd builder && $(MAKE) @cd builder && $(MAKE)
.ONESHELL: .ONESHELL:

View file

@ -1,6 +1,6 @@
{ {
"name": "apple_cursor_bitmap", "name": "apple_cursor_bitmapper",
"version": "1.0.7", "version": "1.0.8",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"watch": "nodemon --inspect src/index.ts", "watch": "nodemon --inspect src/index.ts",

View file

@ -4,7 +4,7 @@ import { readdirSync, existsSync } from "fs";
// Directory resolve // Directory resolve
const projectRoot = path.resolve(__dirname, "../../"); const projectRoot = path.resolve(__dirname, "../../");
const outDir = path.resolve(projectRoot, "pngs"); const outDir = path.resolve(projectRoot, "bitmaps");
const staticSvgDir = path.resolve(projectRoot, "svg", "static"); const staticSvgDir = path.resolve(projectRoot, "svg", "static");
const animatedSvgDir = path.resolve(projectRoot, "svg", "animated"); const animatedSvgDir = path.resolve(projectRoot, "svg", "animated");

View file

@ -29,7 +29,7 @@ parser.add_argument(
dest="png_dir", dest="png_dir",
metavar="PNG", metavar="PNG",
type=str, type=str,
default="../pngs", default="../bitmaps",
help="To change pngs directory. (default: %(default)s)", help="To change pngs directory. (default: %(default)s)",
) )