0.20.2 #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Release assets | |
on: | |
release: | |
types: [created] | |
jobs: | |
build-centos7: | |
name: Centos7 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- uses: bab2min/run-on-arch-action@multiple-step | |
with: | |
image: quay.io/pypa/manylinux2014_x86_64 | |
githubToken: ${{ github.token }} | |
multipleRun: | | |
- name: Update CMake | |
run: | | |
/opt/python/cp310-cp310/bin/pip install cmake | |
yum install java-1.8.0-openjdk-devel.x86_64 -y | |
- name: Configure Build | |
run: mkdir build && cd build && /opt/python/cp310-cp310/bin/cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_JAVA_BINDING=1 .. | |
- name: Build | |
run: cd build && make -j2 | |
- run: | | |
mkdir result | |
cd result | |
mkdir include && mkdir lib && mkdir bin | |
mv ../build/libkiwi* lib/ | |
mv ../build/kiwi-* bin/ | |
mv ../build/test/kiwi-* bin/ | |
cp -r ../include/kiwi include/ | |
tar -zcvf ../asset.tgz include/ lib/ bin/ | |
- run: | | |
mv build/bindings/java/kiwi-java*.jar kiwi-java.jar | |
- name: Upload release binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: asset.tgz | |
asset_name: kiwi_lnx_x86_64_${{ steps.get_release.outputs.tag_name }}.tgz | |
asset_content_type: application/octet-stream | |
- name: Upload release jar | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: kiwi-java.jar | |
asset_name: kiwi-java-${{ steps.get_release.outputs.tag_name }}-lnx-x86-64.jar | |
asset_content_type: application/octet-stream | |
build-macos: | |
strategy: | |
matrix: | |
os: [macos-13] | |
arch: [x86_64, arm64] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} - ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Configure Build | |
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DKIWI_CPU_ARCH=${{ matrix.arch }} -DKIWI_JAVA_BINDING=1 .. | |
- name: Build | |
run: cd build && make -j2 | |
- run: | | |
mkdir result | |
cd result | |
mkdir include && mkdir lib && mkdir bin | |
mv ../build/libkiwi* lib/ | |
mv ../build/kiwi-* bin/ | |
mv ../build/test/kiwi-* bin/ | |
cp -r ../include/kiwi include/ | |
tar -zcvf ../asset.tgz include/ lib/ bin/ | |
- name: Upload release binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: asset.tgz | |
asset_name: kiwi_mac_${{ matrix.arch }}_${{ steps.get_release.outputs.tag_name }}.tgz | |
asset_content_type: application/octet-stream | |
- run: | | |
mv build/bindings/java/kiwi-java*.jar kiwi-java.jar | |
- name: Upload release jar | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: kiwi-java.jar | |
asset_name: kiwi-java-${{ steps.get_release.outputs.tag_name }}-mac-${{ matrix.arch }}.jar | |
asset_content_type: application/octet-stream | |
- if: matrix.arch == 'arm64' | |
run: tar -zcvf model.tgz models/base/sj.* models/base/extract.mdl models/base/*.dict models/base/combiningRule.txt models/base/skipbigram.mdl | |
- name: Upload release binary | |
if: matrix.arch == 'arm64' | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: model.tgz | |
asset_name: kiwi_model_${{ steps.get_release.outputs.tag_name }}_base.tgz | |
asset_content_type: application/octet-stream | |
build-windows: | |
strategy: | |
matrix: | |
os: [windows-2019] | |
arch: [Win32, x64] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Init | |
run: | | |
mkdir build | |
- name: Build | |
uses: lukka/run-cmake@v3 | |
with: | |
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | |
cmakeBuildType: Release | |
buildWithCMake: true | |
cmakeAppendedArgs: -G"Visual Studio 16 2019" -A${{ matrix.arch }} -DKIWI_JAVA_BINDING=1 | |
buildWithCMakeArgs: --config Release | |
buildDirectory: build | |
- run: | | |
mkdir result | |
cd result | |
mkdir include; mkdir lib; mkdir bin | |
mv ..\build\Release\*.dll lib\ | |
mv ..\build\Release\*.exp lib\ | |
mv ..\build\Release\*.lib lib\ | |
mv ..\build\Release\*.exe bin\ | |
mv ..\build\test\Release\*.exe bin\ | |
cp -r ..\include\kiwi include\ | |
Compress-Archive -Path 'include', 'lib', 'bin' -DestinationPath ..\asset.zip | |
- name: Upload release binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: asset.zip | |
asset_name: kiwi_win_${{ matrix.arch }}_${{ steps.get_release.outputs.tag_name }}.zip | |
asset_content_type: application/octet-stream | |
- run: | | |
mv build/bindings/java/kiwi-java*.jar kiwi-java.jar | |
- name: Upload release jar | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: kiwi-java.jar | |
asset_name: kiwi-java-${{ steps.get_release.outputs.tag_name }}-win-${{ matrix.arch }}.jar | |
asset_content_type: application/octet-stream | |
build-other-arch: | |
strategy: | |
matrix: | |
arch: [aarch64, ppc64le] | |
name: Centos7-${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- uses: bab2min/run-on-arch-action@use-custom-image | |
id: runcmd | |
with: | |
image: quay.io/pypa/manylinux2014_${{ matrix.arch }} | |
githubToken: ${{ github.token }} | |
setup: | | |
mkdir -p "${PWD}/artifacts" | |
dockerRunArgs: | | |
--volume "${PWD}/artifacts:/artifacts" | |
run: | | |
yum install java-1.8.0-openjdk-devel -y | |
mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_USE_MIMALLOC=0 -DKIWI_JAVA_BINDING=1 .. | |
make -j2 && popd | |
./build/test/kiwi-test | |
mkdir eval_results && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/ | |
cd build | |
mkdir include && mkdir lib && mkdir bin | |
mv libkiwi* lib/ | |
mv kiwi-* bin/ | |
mv test/kiwi-* bin/ | |
cp -r ../include/kiwi include/ | |
tar -zcvf /artifacts/asset.tgz include/ lib/ bin/ | |
mv bindings/java/kiwi-java*.jar /artifacts/kiwi-java.jar | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Upload release binary | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: artifacts/asset.tgz | |
asset_name: kiwi_lnx_${{ matrix.arch }}_${{ steps.get_release.outputs.tag_name }}.tgz | |
asset_content_type: application/octet-stream | |
- name: Upload release jar | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: artifacts/kiwi-java.jar | |
asset_name: kiwi-java-${{ steps.get_release.outputs.tag_name }}-lnx-${{ matrix.arch }}.jar | |
asset_content_type: application/octet-stream | |
build-emscripten: | |
name: Emscripten | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- uses: mymindstorm/setup-emsdk@v14 | |
- name: Build | |
run: | | |
cd bindings/wasm | |
./build.sh | |
- uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: bindings/wasm/package | |
- name: Build documenation | |
run: | | |
cd bindings/wasm/package | |
npm run doc | |
- name: Publish documenation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: bindings/wasm/package/doc | |
destination_dir: ./kiwi-nlp |