-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for publishing
- Loading branch information
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- toPub | ||
|
||
jobs: | ||
pub_tools: | ||
name: Run pub_tools | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run pub_tools | ||
run: | | ||
python ./pub_tools/pub.py | ||
- name: Commit and push | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "Action@Github.com" | ||
git add . || true | ||
git commit -m "Auto version bump" || true | ||
git push -u origin HEAD:HEAD || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.append(os.getcwd()) | ||
|
||
from paifulogger import __version__ | ||
|
||
|
||
def build_pyproject(): | ||
if "dev" in __version__: | ||
print("Dev version, not building.") | ||
return None | ||
|
||
with open("requirements.txt", "r") as f: | ||
requirements = [f"{line.strip()}" for line in f.readlines()] | ||
|
||
pyproject = f"""[build-system] | ||
requires = ["setuptools>=61.0.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
[project] | ||
name = "PaifuLogger" | ||
version = "{__version__}" | ||
description = "Logging tenhou paifu into excel or html file with some key information." | ||
readme = "README.md" | ||
authors = [{{ name = "Jim137", email = "jim@mail.jim137.eu.org" }}] | ||
license = {{ file = "LICENSE" }} | ||
classifiers = [ | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
keywords = ["mahjong", "review", "logger", "paifu", "tenhou", "haifu", "paipu", "riichi-mahjong"] | ||
dependencies = {requirements} | ||
requires-python = ">=3.10" | ||
[project.urls] | ||
Homepage = "https://github.com/Jim137/Tenhou-Paifu-Logger" | ||
[project.scripts] | ||
log = "paifulogger.__main__:main" | ||
plog = "paifulogger.__main__:main" | ||
pdl = "paifulogger.paifu_dl:paifu_dl" | ||
[tool.setuptools.packages.find] | ||
exclude = [ | ||
"Paifu", | ||
"牌譜", | ||
] | ||
[tool.setuptools.package-data] | ||
"paifulogger.localizations" = [ | ||
"*.json", | ||
]""".replace( | ||
"'", '"' | ||
) | ||
|
||
with open("pyproject.toml", "w") as f: | ||
f.write(pyproject) | ||
|
||
|
||
if __name__ == "__main__": | ||
print(__version__) | ||
build_pyproject() |