Skip to content

Commit

Permalink
Merge pull request #7 from tobyxdd/feat/ci
Browse files Browse the repository at this point in the history
feat/ci
  • Loading branch information
eligao authored Jul 31, 2023
2 parents d60ed2a + ec4aeda commit 21a5ce2
Show file tree
Hide file tree
Showing 175 changed files with 346 additions and 24 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on: [push, workflow_dispatch]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build artifacts
run: |
python ./src/generate.py
zip -r dist.zip ./dist
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./dist.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./dist/*
name: Release ${{ github.ref }}
draft: false
prerelease: false
fail_on_unmatched_files: true
272 changes: 272 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
# Created by https://www.toptal.com/developers/gitignore/api/python,windows,macos,linux,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=python,windows,macos,linux,visualstudiocode

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/python,windows,macos,linux,visualstudiocode


# Project specific ignores
File renamed without changes.
24 changes: 0 additions & 24 deletions generate.py

This file was deleted.

Binary file removed large/001_典.png
Binary file not shown.
Binary file removed large/002_孝.png
Binary file not shown.
Binary file removed large/003_急.png
Binary file not shown.
Binary file removed large/004_乐.png
Binary file not shown.
Binary file removed large/005_麻.png
Binary file not shown.
Binary file removed large/006_批.png
Binary file not shown.
Binary file removed large/007_蚌.png
Binary file not shown.
Binary file removed large/008_绷.png
Binary file not shown.
Binary file removed large/009_盒.png
Binary file not shown.
Binary file removed large/010_赢.png
Binary file not shown.
Binary file removed large/011_输.png
Binary file not shown.
Binary file removed large/012_对.png
Binary file not shown.
Binary file removed large/013_退.png
Binary file not shown.
Binary file removed large/014_寄.png
Binary file not shown.
Binary file removed large/015_创.png
Binary file not shown.
Binary file removed large/016_绝.png
Binary file not shown.
Binary file removed large/017_秀.png
Binary file not shown.
Binary file removed large/018_谔.png
Binary file not shown.
Binary file removed large/019_鼠.png
Binary file not shown.
Binary file removed large/020_兔.png
Binary file not shown.
Binary file removed large/021_神.png
Binary file not shown.
Binary file removed large/022_殖.png
Binary file not shown.
Binary file removed large/023_友.png
Binary file not shown.
Binary file removed large/024_人.png
Binary file not shown.
Binary file removed large/025_躺.png
Binary file not shown.
Binary file removed large/026_卷.png
Diff not rendered.
Binary file removed large/027_润.png
Diff not rendered.
Binary file removed large/028_狂.png
Diff not rendered.
Binary file removed large/029_图.png
Diff not rendered.
Binary file removed large/030_了.png
Diff not rendered.
Binary file removed large/031_献.png
Diff not rendered.
Binary file removed large/032_忠.png
Diff not rendered.
Binary file removed large/033_支.png
Diff not rendered.
Binary file removed large/034_洼.png
Diff not rendered.
Binary file removed large/035_爆.png
Diff not rendered.
Binary file removed large/036_死.png
Diff not rendered.
Binary file removed large/037_歇.png
Diff not rendered.
Binary file removed large/038_反.png
Diff not rendered.
Binary file removed large/039_共.png
Diff not rendered.
Binary file removed large/040_中.png
Diff not rendered.
Binary file removed large/041_美.png
Diff not rendered.
Binary file removed large/042_日.png
Diff not rendered.
Binary file removed large/043_韩.png
Diff not rendered.
Binary file removed large/044_党.png
Diff not rendered.
Binary file removed large/045_雅.png
Diff not rendered.
Binary file removed large/046_俗.png
Diff not rendered.
Binary file removed large/047_佛.png
Diff not rendered.
Binary file removed large/048_草.png
Diff not rendered.
Binary file removed large/049_逼.png
Diff not rendered.
Binary file removed large/050_冲.png
Diff not rendered.
Binary file removed large/051_浪.png
Diff not rendered.
Binary file removed large/052_汗.png
Diff not rendered.
Binary file removed large/053_包.png
Diff not rendered.
Binary file removed large/054_子.png
Diff not rendered.
Binary file removed large/055_习.png
Diff not rendered.
Binary file removed large/056_毛.png
Diff not rendered.
Binary file removed large/057_腊.png
Diff not rendered.
Binary file removed large/058_偷.png
Diff not rendered.
Binary file removed large/059_傻.png
Diff not rendered.
Binary file removed large/060_善.png
Diff not rendered.
Binary file removed large/061_编.png
Diff not rendered.
Binary file removed large/062_恰.png
Diff not rendered.
Binary file removed large/063_哈.png
Diff not rendered.
Binary file removed large/064_拉.png
Diff not rendered.
Binary file removed large/065_摇.png
Diff not rendered.
Binary file removed large/066_晶.png
Diff not rendered.
Binary file removed large/067_哥.png
Diff not rendered.
Binary file removed large/068_粪.png
Diff not rendered.
Binary file removed large/069_钓.png
Diff not rendered.
Binary file removed large/070_灵.png
Diff not rendered.
Binary file removed large/071_车.png
Diff not rendered.
Binary file removed large/072_软.png
Diff not rendered.
Binary file removed large/073_硬.png
Diff not rendered.
Binary file removed large/074_抄.png
Diff not rendered.
Binary file removed large/075_爬.png
Diff not rendered.
Binary file removed large/076_原.png
Diff not rendered.
Binary file removed large/077_马.png
Diff not rendered.
Binary file removed large/078_唉.png
Diff not rendered.
Binary file removed large/079_资.png
Diff not rendered.
Binary file removed large/080_本.png
Diff not rendered.
Binary file removed large/081_我.png
Diff not rendered.
Binary file removed large/082_爹.png
Diff not rendered.
Binary file removed large/083_爷.png
Diff not rendered.
Binary file removed large/084_拳.png
Diff not rendered.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pillow==10.0.0
Binary file removed small/001_典.png
Diff not rendered.
Binary file removed small/002_孝.png
Diff not rendered.
Binary file removed small/003_急.png
Diff not rendered.
Binary file removed small/004_乐.png
Diff not rendered.
Binary file removed small/005_麻.png
Diff not rendered.
Binary file removed small/006_批.png
Diff not rendered.
Binary file removed small/007_蚌.png
Diff not rendered.
Binary file removed small/008_绷.png
Diff not rendered.
Binary file removed small/009_盒.png
Diff not rendered.
Binary file removed small/010_赢.png
Diff not rendered.
Binary file removed small/011_输.png
Diff not rendered.
Binary file removed small/012_对.png
Diff not rendered.
Binary file removed small/013_退.png
Diff not rendered.
Binary file removed small/014_寄.png
Diff not rendered.
Binary file removed small/015_创.png
Diff not rendered.
Binary file removed small/016_绝.png
Diff not rendered.
Binary file removed small/017_秀.png
Diff not rendered.
Binary file removed small/018_谔.png
Diff not rendered.
Binary file removed small/019_鼠.png
Diff not rendered.
Binary file removed small/020_兔.png
Diff not rendered.
Binary file removed small/021_神.png
Diff not rendered.
Binary file removed small/022_殖.png
Diff not rendered.
Binary file removed small/023_友.png
Diff not rendered.
Binary file removed small/024_人.png
Diff not rendered.
Binary file removed small/025_躺.png
Diff not rendered.
Binary file removed small/026_卷.png
Diff not rendered.
Binary file removed small/027_润.png
Diff not rendered.
Binary file removed small/028_狂.png
Diff not rendered.
Binary file removed small/029_图.png
Diff not rendered.
Binary file removed small/030_了.png
Diff not rendered.
Binary file removed small/031_献.png
Diff not rendered.
Binary file removed small/032_忠.png
Diff not rendered.
Binary file removed small/033_支.png
Diff not rendered.
Binary file removed small/034_洼.png
Diff not rendered.
Binary file removed small/035_爆.png
Diff not rendered.
Binary file removed small/036_死.png
Diff not rendered.
Binary file removed small/037_歇.png
Diff not rendered.
Binary file removed small/038_反.png
Diff not rendered.
Binary file removed small/039_共.png
Diff not rendered.
Binary file removed small/040_中.png
Diff not rendered.
Binary file removed small/041_美.png
Diff not rendered.
Binary file removed small/042_日.png
Diff not rendered.
Binary file removed small/043_韩.png
Diff not rendered.
Binary file removed small/044_党.png
Diff not rendered.
Binary file removed small/045_雅.png
Diff not rendered.
Binary file removed small/046_俗.png
Diff not rendered.
Binary file removed small/047_佛.png
Diff not rendered.
Binary file removed small/048_草.png
Diff not rendered.
Binary file removed small/049_逼.png
Diff not rendered.
Binary file removed small/050_冲.png
Diff not rendered.
Binary file removed small/051_浪.png
Diff not rendered.
Binary file removed small/052_汗.png
Diff not rendered.
Binary file removed small/053_包.png
Diff not rendered.
Binary file removed small/054_子.png
Diff not rendered.
Binary file removed small/055_习.png
Diff not rendered.
Binary file removed small/056_毛.png
Diff not rendered.
Binary file removed small/057_腊.png
Diff not rendered.
Binary file removed small/058_偷.png
Diff not rendered.
Binary file removed small/059_傻.png
Diff not rendered.
Binary file removed small/060_善.png
Diff not rendered.
Binary file removed small/061_编.png
Diff not rendered.
Binary file removed small/062_恰.png
Diff not rendered.
Binary file removed small/063_哈.png
Diff not rendered.
Binary file removed small/064_拉.png
Diff not rendered.
Binary file removed small/065_摇.png
Diff not rendered.
Binary file removed small/066_晶.png
Diff not rendered.
Binary file removed small/067_哥.png
Diff not rendered.
Binary file removed small/068_粪.png
Diff not rendered.
Binary file removed small/069_钓.png
Diff not rendered.
Binary file removed small/070_灵.png
Diff not rendered.
Binary file removed small/071_车.png
Diff not rendered.
Binary file removed small/072_软.png
Diff not rendered.
Binary file removed small/073_硬.png
Diff not rendered.
Binary file removed small/074_抄.png
Diff not rendered.
Binary file removed small/075_爬.png
Diff not rendered.
Binary file removed small/076_原.png
Diff not rendered.
Binary file removed small/077_马.png
Diff not rendered.
Binary file removed small/078_唉.png
Diff not rendered.
Binary file removed small/079_资.png
Diff not rendered.
Binary file removed small/080_本.png
Diff not rendered.
Binary file removed small/081_我.png
Diff not rendered.
Binary file removed small/082_爹.png
Diff not rendered.
Binary file removed small/083_爷.png
Diff not rendered.
Binary file removed small/084_拳.png
Diff not rendered.
1 change: 1 addition & 0 deletions src/LETTERS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LETTERS = '典孝急乐麻批蚌绷盒赢输对退寄创绝秀谔鼠兔神殖友人躺卷润狂图了献忠支洼爆死歇反共中美日韩党雅俗佛草逼冲浪汗包子习毛腊偷傻善编恰哈拉摇晶哥粪钓灵车软硬抄爬原马唉资本我爹爷拳'
32 changes: 32 additions & 0 deletions src/generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from PIL import Image, ImageDraw, ImageFont
import os

from LETTERS import LETTERS

FONT = ImageFont.truetype('assets/三极隶书简体.ttf', 650)

OUTPUT_DIR = 'dist'
SMALL_SUBDIR = f'{OUTPUT_DIR}/small'
LARGE_SUBDIR = f'{OUTPUT_DIR}/large'

os.makedirs(SMALL_SUBDIR, exist_ok=True)
os.makedirs(LARGE_SUBDIR, exist_ok=True)

def main() -> None:
i = 0
for letter in LETTERS:
i += 1
image = Image.new('RGBA', (1000, 1000), (0, 0, 0, 0))

draw = ImageDraw.Draw(image)
draw.ellipse((10, 10, 990, 990), outline='black', fill='white', width=30)
draw.ellipse((80, 80, 920, 920), outline='black', fill='white', width=60)
draw.text((500, 410), letter, fill='black', anchor='mm', font=FONT)

image.resize((100, 100), Image.LANCZOS).save(
f'{SMALL_SUBDIR}/{i:03d}_{letter}.png') # for emoji
image.resize((512, 512), Image.LANCZOS).save(
f'{LARGE_SUBDIR}/{i:03d}_{letter}.png') # for sticker

if __name__ == '__main__':
main()

0 comments on commit 21a5ce2

Please sign in to comment.