-
Notifications
You must be signed in to change notification settings - Fork 0
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
103 additions
and
1 deletion.
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,40 @@ | ||
name: Fetch Res | ||
|
||
on: | ||
workflow_dispatch: ~ | ||
|
||
jobs: | ||
Fetch-Wiki: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install httpx black | ||
- name: Fetch Remote Files | ||
run: | | ||
cd compiler | ||
python main.py | ||
cd .. | ||
black . | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
- name: Commit changes | ||
run: | | ||
git add . | ||
git commit -S -m ":bento: Update res" | ||
git push |
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,26 @@ | ||
from httpx import get | ||
|
||
url = "https://raw.githubusercontent.com/fribbels/hsr-optimizer/main/src/data/character_promotions.json" | ||
|
||
|
||
def get_content() -> str: | ||
req = get(url) | ||
return req.text | ||
|
||
|
||
def save_content(content: str) -> None: | ||
with open( | ||
"../src/starrailrelicscore/data/character_promotions.json", | ||
"w", | ||
encoding="utf-8", | ||
) as file: | ||
file.write(content) | ||
|
||
|
||
def main(): | ||
content = get_content() | ||
save_content(content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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,24 @@ | ||
from httpx import get | ||
|
||
url = "https://raw.githubusercontent.com/PaiGramTeam/HonkaiStarRailWikiDataParser/remote/data/relic_config.json" | ||
|
||
|
||
def get_content() -> str: | ||
req = get(url) | ||
return req.text | ||
|
||
|
||
def save_content(content: str) -> None: | ||
with open( | ||
"../src/starrailrelicscore/data/relic_config.json", "w", encoding="utf-8" | ||
) as file: | ||
file.write(content) | ||
|
||
|
||
def main(): | ||
content = get_content() | ||
save_content(content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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,13 @@ | ||
from get_metadata import main as get_metadata | ||
from get_character_promotions import main as get_character_promotions | ||
from get_relic_config import main as get_relic_config | ||
|
||
|
||
def main(): | ||
get_metadata() | ||
get_character_promotions() | ||
get_relic_config() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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