Skip to content

Commit

Permalink
Updates release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
catusf authored Nov 27, 2024
1 parent 0f8fd93 commit 62ea412
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/release_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,13 @@ jobs:
- name: Zip all artifacts for release
run: |
zip -9 -j $OUTPUT_DIR/all-stardict.zip $OUTPUT_DIR/stardict/*.* &&
zip -9 -j $OUTPUT_DIR/all-epub.zip $OUTPUT_DIR/epub/*.* &&
zip -9 -j $OUTPUT_DIR/all-kobo.zip $OUTPUT_DIR/kobo/*.* &&
zip -9 -j $OUTPUT_DIR/all-lingvo.zip $OUTPUT_DIR/lingvo/*.* &&
zip -9 -j $OUTPUT_DIR/all-kindle.zip $OUTPUT_DIR/kindle/*.* &&
zip -9 -j $OUTPUT_DIR/all-dictd.zip $OUTPUT_DIR/dictd/*.* &&
zip -9 -j $OUTPUT_DIR/all-yomitan.zip $OUTPUT_DIR/yomitan/*.* &&
ls -R -l $OUTPUT_DIR
- name: Create a new release draft
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "./output/*.zip,./output/kindle/*.mobi,./output/kobo/*.zip,./output/lingvo/*.dz,./output/epub/*.epub,./output/yomitan/*.zip"
artifacts: "./${OUTPUT_DIR}/*.zip"
body: If you can read this, we have forgotten to fill in the changelog. Sorry!
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/release_all_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,13 @@ jobs:
- name: Zip all artifacts for release
run: |
zip -9 -j $OUTPUT_DIR/all-stardict.zip $OUTPUT_DIR/stardict/*.* &&
zip -9 -j $OUTPUT_DIR/all-epub.zip $OUTPUT_DIR/epub/*.* &&
zip -9 -j $OUTPUT_DIR/all-kobo.zip $OUTPUT_DIR/kobo/*.* &&
zip -9 -j $OUTPUT_DIR/all-lingvo.zip $OUTPUT_DIR/lingvo/*.* &&
zip -9 -j $OUTPUT_DIR/all-kindle.zip $OUTPUT_DIR/kindle/*.* &&
zip -9 -j $OUTPUT_DIR/all-dictd.zip $OUTPUT_DIR/dictd/*.* &&
zip -9 -j $OUTPUT_DIR/all-yomitan.zip $OUTPUT_DIR/yomitan/*.* &&
ls -R -l $OUTPUT_DIR
- name: Create a new release draft
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "./ext-output/*.zip,./ext-output/kindle/*.mobi,./ext-output/kobo/*.zip,./ext-output/lingvo/*.dz,./ext-output/epub/*.epub,./ext-output/yomitan/*.zip"
artifacts: "./${OUTPUT_DIR}/*.zip"
body: If you can read this, we have forgotten to fill in the changelog. Sorry!
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
Expand Down
16 changes: 14 additions & 2 deletions bin/convert_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def elapsed_time(self):
def display_elapsed(self, label=""):
"""Display the elapsed time."""
elapsed = self.elapsed_time()
print(f"Label: {label}\nElapsed time: {elapsed['minutes']}:{elapsed['seconds']}.{elapsed['milliseconds']}s")
print(f"Label: {label}\n\tElapsed time: {elapsed['minutes']}:{elapsed['seconds']}.{elapsed['milliseconds']}s")


INFLECTION_DIR = './bin/inflections'
Expand Down Expand Up @@ -153,6 +153,7 @@ def process_dictionary(data_tuple):
cmd_line = f'mv {html}/*.mobi {output_folder}/kindle/'
else:
cmd_line = f'mv {html}/*.mobi {output_folder}/kindle/'

try:
print(cmd_line)
subprocess.run(cmd_line, shell=True, check=True)
Expand Down Expand Up @@ -323,10 +324,21 @@ def main() -> None:
# print(args_list[:3])

# process_dictionary(args_list[0])
with Pool(1) as pool:
with Pool(2) as pool:
pool.map(process_dictionary, args_list[:4])
# # pool.map(lambda Dict: process_dictionary(**Dict), args_list)

dirs = ['stardict', 'epub', 'kobo', 'lingvo', 'kindle', 'dictd', 'yomitan']

for dir in dirs:
cmd_line = f"zip -9 -j {output_folder}/all-{dir}.zip {output_folder}/{dir}/*.*"

try:
print(cmd_line)
subprocess.run(cmd_line, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error moving .mobi file: {e}")

if __name__ == "__main__":
timer = Timer()
timer.start()
Expand Down

0 comments on commit 62ea412

Please sign in to comment.