0.16.1 #36
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-centos: | |
name: Centos5 | |
runs-on: ubuntu-latest | |
container: | |
image: docker://hoshizora/manylinux1-clang_x86_64 | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: Checkout Old Version googletest | |
run: cd third_party/googletest && git checkout v1.8.x && cd ../.. | |
- name: Update CMake | |
run: /opt/python/cp36-cp36m/bin/pip install "cmake<3.20" | |
- name: Configure Build | |
run: mkdir build && cd build && /opt/python/cp36-cp36m/bin/cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_USE_MIMALLOC=0 -DKIWI_USE_CPUINFO=0 .. | |
- 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: Archive binaries | |
uses: actions/upload-artifact@v1 | |
with: | |
name: asset_Centos5 | |
path: asset.tgz | |
upload-asset-from-centos: | |
name: Upload asset from Centos5 | |
needs: build-centos | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: asset_Centos5 | |
path: arts | |
- 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: arts/asset.tgz | |
asset_name: kiwi_lnx_centos5_x86_64_${{ steps.get_release.outputs.tag_name }}.tgz | |
asset_content_type: application/octet-stream | |
build-centos6: | |
name: Centos6 | |
runs-on: ubuntu-latest | |
container: | |
image: docker://quay.io/pypa/manylinux2010_x86_64 | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: Update CMake | |
run: | | |
/opt/python/cp36-cp36m/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/cp36-cp36m/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/ | |
- name: Archive binaries | |
uses: actions/upload-artifact@v1 | |
with: | |
name: asset_Centos6 | |
path: asset.tgz | |
- run: | | |
mv build/bindings/java/kiwi-java*.jar kiwi-java.jar | |
- name: Archive jar binaries | |
uses: actions/upload-artifact@v1 | |
with: | |
name: jar_Centos6 | |
path: kiwi-java.jar | |
upload-asset-from-centos6: | |
name: Upload asset from Centos6 | |
needs: build-centos6 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: asset_Centos6 | |
path: arts | |
- 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: arts/asset.tgz | |
asset_name: kiwi_lnx_x86_64_${{ steps.get_release.outputs.tag_name }}.tgz | |
asset_content_type: application/octet-stream | |
- uses: actions/download-artifact@v2 | |
with: | |
name: jar_Centos6 | |
path: arts | |
- 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: arts/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-11] | |
arch: [x86_64, arm64] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} - ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v2 | |
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 ModelGenerator/sj.* ModelGenerator/extract.mdl ModelGenerator/*.dict ModelGenerator/combiningRule.txt ModelGenerator/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@v2 | |
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@v2 | |
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 ./ModelGenerator 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 |