-
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.
- Loading branch information
Showing
5 changed files
with
174 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,67 @@ | ||
.git | ||
__pycache__ | ||
LICENSE | ||
output.md | ||
assets | ||
Style-Bert-VITS2 | ||
output | ||
streamlit | ||
SourceSage.md | ||
data | ||
.gitignore | ||
.SourceSageignore | ||
*.png | ||
Changelog | ||
SourceSageAssets | ||
SourceSageAssetsDemo | ||
__pycache__ | ||
.pyc | ||
**/__pycache__/** | ||
modules\__pycache__ | ||
.svg | ||
sourcesage.egg-info | ||
.pytest_cache | ||
dist | ||
build | ||
.env | ||
example | ||
|
||
.gaiah.md | ||
.Gaiah.md | ||
tmp.md | ||
tmp2.md | ||
.SourceSageAssets | ||
tests | ||
template | ||
aira.egg-info | ||
aira.Gaiah.md | ||
README_template.md | ||
|
||
egg-info | ||
oasis_article.egg-info | ||
.harmon_ai | ||
.aira | ||
|
||
article_draft | ||
issue_creator.log | ||
oasis.log | ||
|
||
debug_output | ||
*.log | ||
|
||
html_replacement1.html | ||
html_raw.html | ||
html_content.html | ||
html_with_placeholders.html | ||
markdown_html.html | ||
markdown_text.md | ||
markdown_text2.md | ||
|
||
saved_article.html | ||
memo.md | ||
content.md | ||
|
||
.SourceSageAssets | ||
docs | ||
.github | ||
.venv |
File renamed without changes.
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,48 @@ | ||
import os | ||
import sys | ||
from loguru import logger | ||
|
||
def update_files(new_repo_name): | ||
logger.info(f"リポジトリ名を '{new_repo_name}' に更新します") | ||
|
||
files_to_update = [ | ||
'.github/workflows/publish-to-pypi.yml', | ||
'.github/workflows/sync-to-huggingface.yml', | ||
'.github/release_notes/.sourcesage_releasenotes_iris.yml' | ||
] | ||
|
||
for file_path in files_to_update: | ||
full_path = os.path.join(os.getcwd(), file_path) | ||
if not os.path.exists(full_path): | ||
logger.warning(f"ファイル {full_path} が見つかりません。スキップします。") | ||
continue | ||
|
||
logger.info(f"{file_path} の処理を開始します") | ||
|
||
with open(full_path, 'r', encoding='utf-8') as file: | ||
content = file.read() | ||
|
||
updated_content = content.replace('HarmonAI_III', new_repo_name) | ||
|
||
if content != updated_content: | ||
with open(full_path, 'w', encoding='utf-8') as file: | ||
file.write(updated_content) | ||
logger.success(f"{file_path} を更新しました") | ||
else: | ||
logger.info(f"{file_path} には変更が必要ありませんでした") | ||
|
||
if __name__ == "__main__": | ||
|
||
if len(sys.argv) != 2: | ||
logger.error("使用方法: python update_repo_name.py <新しいリポジトリ名>") | ||
sys.exit(1) | ||
|
||
new_repo_name = sys.argv[1] | ||
logger.info(f"スクリプトを開始します。新しいリポジトリ名: {new_repo_name}") | ||
|
||
try: | ||
update_files(new_repo_name) | ||
logger.success("リポジトリ名の更新が完了しました") | ||
except Exception as e: | ||
logger.exception(f"更新処理中にエラーが発生しました: {str(e)}") | ||
sys.exit(1) |
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,30 @@ | ||
name: Publish Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/HarmonAI_III | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: 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,29 @@ | ||
name: Sync to Hugging Face hub | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
# to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-to-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
- name: Remove .github and PNG files from history | ||
run: | | ||
git filter-branch --force --index-filter \ | ||
'git rm -rf --cached --ignore-unmatch .github *.png' \ | ||
--prune-empty --tag-name-filter cat -- --all | ||
- name: Push to Hugging Face hub | ||
env: | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
run: | | ||
git push -f https://MakiAi:[email protected]/spaces/MakiAi/HarmonAI_III main |