Skip to content

Commit

Permalink
Merge pull request #54 from moeyashi/feature/35
Browse files Browse the repository at this point in the history
Feature/35
  • Loading branch information
moeyashi authored Mar 11, 2024
2 parents 14efc99 + d338088 commit 22e083b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 72 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/update-wr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update WR

on:
schedule:
# 15時に実行
- cron: "0 7 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: eifinger/setup-rye@v2
id: setup-rye
with:
enable-cache: true
working-directory: ./wr-python
- name: Install dependencies
if: steps.setup-rye.outputs.cache-hit != 'true'
run: |
rye sync --no-lock
- name: Create track.js
run: rye run python ./src/wr_python/make_track_js.py
- uses: peter-evans/create-pull-request@v6
with:
add-paths: "src/const/track.js"
commit-message: "feat(track.js): update WR"
delete-branch: true
title: Update WR
8 changes: 6 additions & 2 deletions wr-python/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# wr-python

LeaderBoard.pyが本体です
## make track.js

sample.py(とdata.csv)は自分が使っていた時のサンプルです
```bash
cd ./wr-python
rye sync
rye run python ./src/wr_python/make_track_js.py
```
5 changes: 0 additions & 5 deletions wr-python/data.csv

This file was deleted.

56 changes: 0 additions & 56 deletions wr-python/sample.py

This file was deleted.

13 changes: 4 additions & 9 deletions wr-python/src/wr_python/make_track_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,8 @@
}


print(template.render(wr=wr))
track_js = template.render(wr=wr)

# with open("data.csv", "w", newline="") as f:
# writer = csv.writer(f)

# writer.writerow(trackList)
# writer.writerow(WRList)
# writer.writerow(RRList)
# writer.writerow(AllWRList)
# writer.writerow(AllRRList)
with open("../src/const/track.js", "w", encoding='utf-8') as f:
f.write(track_js)
f.write("\n")

0 comments on commit 22e083b

Please sign in to comment.