Skip to content

Commit

Permalink
Add Python package build validation AND Release 1.1.7 (#824)
Browse files Browse the repository at this point in the history
* Add Python package build validation
* Release 1.1.7
  • Loading branch information
AntonOfTheWoods authored Oct 15, 2023
1 parent cc46501 commit e5d6c5f
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 16 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,36 @@ jobs:
run: python setup.py build_ext install
- name: Test with pytest
run: cd python && pytest

test-pypi:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1

- name: Build package and upload from docker (Linux)
if: runner.os == 'Linux'
run: |
docker run --rm -v "${PWD}:/opt/OpenCC" \
-e TWINE_USERNAME=__token__ \
-e TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} \
ubuntu:22.04 /bin/bash /opt/OpenCC/release-pypi-linux.sh testonly
- name: Build package and upload (macOS)
if: runner.os == 'macOS'
run: bash release-pypi-macos.sh testonly
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Build package and upload (Windows)
if: runner.os == 'Windows'
run: |
C:\Miniconda/condabin/conda.bat init powershell
./release-pypi-windows.cmd testonly
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ set (PACKAGE_URL https://github.com/BYVoid/Opencc)
set (PACKAGE_BUGREPORT https://github.com/BYVoid/Opencc/issues)
set (OPENCC_VERSION_MAJOR 1)
set (OPENCC_VERSION_MINOR 1)
set (OPENCC_VERSION_REVISION 6)
set (OPENCC_VERSION_REVISION 7)

if (CMAKE_BUILD_TYPE MATCHES Debug)
set (version_suffix .Debug)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change History of OpenCC

## Version 1.1.7

2023年10月15日

* 添加提交时 python 包重建以验证包生成 ([#822](https://github.com/BYVoid/OpenCC/pull/822))。
* 支持Python 3.12 和 Node 20,移除針對Python 3.7和Node 16的構建 ([#820](https://github.com/BYVoid/OpenCC/pull/820))。
* add mingw-w64 ci ([#802](https://github.com/BYVoid/OpenCC/pull/802))。
* Add support of CMake config modules ([#763](https://github.com/BYVoid/OpenCC/pull/763))。
* 若干其他小修復。

## Version 1.1.6

2022年12月08日
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencc",
"version": "1.1.6",
"version": "1.1.7",
"description": "Conversion between Traditional and Simplified Chinese",
"author": "Carbo Kuo <[email protected]>",
"license": "Apache-2.0",
Expand Down
10 changes: 6 additions & 4 deletions release-pypi-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ for VERSION in 3.8 3.9 3.10 3.11 3.12; do
rm -rf build python/opencc/clib OpenCC.egg-info
done

# Upload to PyPI
conda activate py3.8
python -m pip install twine
python -m twine upload dist/*
if [ "$1" != "testonly" ]; then
# Upload to PyPI
conda activate py3.8
python -m pip install twine
python -m twine upload dist/*
fi
10 changes: 6 additions & 4 deletions release-pypi-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ for VERSION in 3.8 3.9 3.10 3.11 3.12; do
rm -rf build python/opencc/clib OpenCC.egg-info
done

# Upload to PyPI
conda activate py3.8
python -m pip install twine
python -m twine upload dist/*
if [ "$1" != "testonly" ]; then
# Upload to PyPI
conda activate py3.8
python -m pip install twine
python -m twine upload dist/*
fi
10 changes: 6 additions & 4 deletions release-pypi-windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ for %%v in (%VERSIONS%) do (
rmdir /S /Q build python\opencc\clib OpenCC.egg-info
)

REM Upload to PyPI
C:\Miniconda/condabin/conda.bat activate py3.8
python -m pip install twine
python -m twine upload dist/*
if NOT "%~1"=="testonly" (
REM Upload to PyPI
C:\Miniconda/condabin/conda.bat activate py3.8
python -m pip install twine
python -m twine upload dist/*
)

0 comments on commit e5d6c5f

Please sign in to comment.