Skip to content

Commit

Permalink
chore: add workflow to publish to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
DoodleBears committed Jun 28, 2024
1 parent 349e1d2 commit b1a4bea
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Python Package

on:
push:
tags:
- "v*" # 仅在推送标签时触发

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9" # 选择 Python 版本

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*

- name: Clean up dist folder
run: rm -rf dist
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(*relpath):


setup(
name="langsplit",
name="split_lang",
version="0.1.0",
description="A package for splitting sentences by language (concatenating over-split substrings based on their language)",
long_description=read("README.md"),
Expand Down

0 comments on commit b1a4bea

Please sign in to comment.