From df2845651350c4f5d4333bd399f98b4b6d2e29ae Mon Sep 17 00:00:00 2001 From: Anton Melser Date: Sun, 15 Oct 2023 17:14:56 +0800 Subject: [PATCH 1/2] Add Python package build validation Signed-off-by: Anton Melser --- .github/workflows/python.yml | 33 +++++++++++++++++++++++++++++++++ release-pypi-linux.sh | 10 ++++++---- release-pypi-macos.sh | 10 ++++++---- release-pypi-windows.cmd | 10 ++++++---- 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 439906862..ccf6e78e6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 }} diff --git a/release-pypi-linux.sh b/release-pypi-linux.sh index 8e5cb3c4f..b0a11bcf5 100644 --- a/release-pypi-linux.sh +++ b/release-pypi-linux.sh @@ -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 diff --git a/release-pypi-macos.sh b/release-pypi-macos.sh index f2dffe9a3..7b3c632a2 100644 --- a/release-pypi-macos.sh +++ b/release-pypi-macos.sh @@ -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 diff --git a/release-pypi-windows.cmd b/release-pypi-windows.cmd index 0cb08729b..21b9e96ee 100644 --- a/release-pypi-windows.cmd +++ b/release-pypi-windows.cmd @@ -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/* +) From e0bd224e69430c235dfd07f750976be1a0414edf Mon Sep 17 00:00:00 2001 From: Anton Melser Date: Sun, 15 Oct 2023 16:56:05 +0800 Subject: [PATCH 2/2] Release 1.1.7 Signed-off-by: Anton Melser --- CMakeLists.txt | 2 +- NEWS.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34145bc3c..1acb75a9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/NEWS.md b/NEWS.md index eac911fca..7df139ea3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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日 diff --git a/package-lock.json b/package-lock.json index 4b3803c73..e30981de5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencc", - "version": "1.1.6", + "version": "1.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencc", - "version": "1.1.6", + "version": "1.1.7", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 92b7b755d..ab73d5bf2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencc", - "version": "1.1.6", + "version": "1.1.7", "description": "Conversion between Traditional and Simplified Chinese", "author": "Carbo Kuo ", "license": "Apache-2.0",