ep6: translation #55
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
name: Build Subtitles | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '.github/**' | |
- 'README.md' | |
env: | |
PYTHONUNBUFFERED: "1" | |
WINEDEBUG: "-all" | |
jobs: | |
Build-CI-Versions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python Environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install wine64 | |
pip install --user git+https://github.com/FichteForks/Myaamori-Aegisub-Scripts.git@pr/fix-style-deduplication#subdirectory=scripts/sub-digest | |
pip install requests | |
winecfg | |
- name: Download Aegisub-cli | |
run: | | |
wget https://github.com/scrpr/aegisub-cli/releases/download/disable_unique_path/aegisub-cli.zip | |
unzip -q aegisub-cli.zip -d aegisub-cli/ | |
- name: Install custom fonts | |
run: | | |
wget https://github.com/Kitauji-Sub/subs-imas-shinycolors/releases/download/typeface/fonts_sc.zip | |
unzip -q fonts_sc.zip -d Fonts/ | |
sudo mv Fonts/* /usr/share/fonts/ | |
fc-cache -fv | |
- name: Build substitles | |
run: | | |
python build_scripts/build.py | |
- name: Pack files | |
run: | | |
export now=$(date +"%Y%m%d%H%M") | |
zip -r -j sc_subs_${now}.zip build/output/* | |
- name: Delete latest release | |
uses: dev-drprasad/delete-tag-and-release@v1.0 | |
with: | |
tag_name: latest | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
delete_release: true | |
# uses: actions/github-script@v7 | |
# with: | |
# github-token: ${{secrets.GITHUB_TOKEN}} | |
# script: | | |
# const { owner, repo } = context.repo | |
# try { | |
# const response = await github.rest.repos.getReleaseByTag({ owner, repo, tag: 'latest' }); | |
# const releaseid = response.data.id; | |
# await github.rest.repos.deleteRelease({ owner, repo, "release_id": releaseid }); | |
# } catch (error) { | |
# console.log('Skip deleting release:', error); | |
# } | |
# try { | |
# await github.rest.git.deleteRef({ owner, repo, ref: 'tags/latest' }); | |
# } catch (error) { | |
# console.log('Skipp deleting tag:', error); | |
# } | |
- name: Wait a sec | |
run: sleep 5 | |
- name: Publish | |
uses: "softprops/action-gh-release@v2" | |
with: | |
tag_name: "latest" | |
fail_on_unmatched_files: true | |
prerelease: true | |
draft: false | |
generate_release_notes: false | |
name: "自动生成构建 Automatic CI Build" | |
files: | | |
sc_subs_*.zip | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sc_subs_built | |
path: sc_subs_*.zip |