Skip to content

Commit cf23616

Browse files
authored
release: v1.2.0 (#16)
1 parent f991615 commit cf23616

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.github/workflows/Release-pypi.yml .github/workflows/Release.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Release-pypi
1+
name: Release
22

33
on:
44
workflow_dispatch:
55

6+
push:
7+
tags:
8+
- "v*"
9+
610
jobs:
7-
Pypi:
11+
pypi:
812
strategy:
913
matrix:
1014
python-version: ["3.9"]
@@ -32,3 +36,14 @@ jobs:
3236
uses: pypa/gh-action-pypi-publish@release/v1
3337
with:
3438
password: ${{ secrets.PYPI_API }}
39+
40+
github:
41+
needs: [pypi]
42+
runs-on: ubuntu-20.04
43+
steps:
44+
- uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
48+
- name: Release
49+
uses: softprops/action-gh-release@v2

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ license = "GPL-3.0-only"
3939
name = "yuisub"
4040
readme = "README.md"
4141
repository = "https://github.com/TensoRaws/yuisub"
42-
version = "1.1.2"
42+
version = "1.2.0"
4343

4444
# Requirements
4545
[tool.poetry.dependencies]

tests/test_translator.py

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77
from . import util
88

99

10+
def test_translator_sub_init() -> None:
11+
translator = SubtitleTranslator(
12+
torch_device=util.DEVICE,
13+
whisper_model=util.MODEL_NAME,
14+
model=util.OPENAI_MODEL,
15+
api_key=util.OPENAI_API_KEY,
16+
base_url=util.OPENAI_BASE_URL,
17+
bangumi_url=util.BANGUMI_URL,
18+
bangumi_access_token=util.BANGUMI_ACCESS_TOKEN,
19+
)
20+
21+
assert translator.model == util.OPENAI_MODEL
22+
assert translator.api_key == util.OPENAI_API_KEY
23+
assert translator.base_url == util.OPENAI_BASE_URL
24+
assert translator.bangumi_url == util.BANGUMI_URL
25+
assert translator.bangumi_access_token == util.BANGUMI_ACCESS_TOKEN
26+
27+
1028
@pytest.mark.skipif(os.environ.get("GITHUB_ACTIONS") == "true", reason="Skipping test when running on CI")
1129
async def test_translator_sub() -> None:
1230
translator = SubtitleTranslator(

0 commit comments

Comments
 (0)