Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python package build validation AND Release 1.1.7 #824

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/*
)