diff --git a/ci/onnx2bnn_build.yml b/ci/onnx2bnn_build.yml index c00936c..2ede1ee 100644 --- a/ci/onnx2bnn_build.yml +++ b/ci/onnx2bnn_build.yml @@ -27,7 +27,7 @@ pr: - dabnn/* jobs: -- job: Linux_AppImage +- job: LinuxAppImage pool: vmImage: 'ubuntu-16.04' steps: @@ -48,7 +48,7 @@ jobs: pathtoPublish: $(Build.ArtifactStagingDirectory) artifactName: onnx2bnn AppImage - template: template_onnx2bnn_github_release.yml -- job: Windows_Python_Package +- job: Windows pool: vmImage: 'vs2017-win2016' steps: @@ -61,10 +61,18 @@ jobs: contents: 'onnx2bnn.exe' targetFolder: $(Build.ArtifactStagingDirectory) - template: template_onnx2bnn_github_release.yml - - script: python -m twine upload dist/* --verbose - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) - displayName: Upload wheel to PyPI - workingDirectory: tools/onnx2bnn/python/ - env: - TWINE_USERNAME: $(twineUsername) - TWINE_PASSWORD: $(twinePassword) + - template: template_onnx2bnn_upload_to_pypi.yml +- job: macOS + pool: + vmImage: 'macOS-10.14' + steps: + - checkout: self + submodules: true + - template: template_onnx2bnn_build_python_all_version.yml + - task: CopyFiles@2 + inputs: + sourceFolder: '.setuptools-cmake-build/tools/onnx2bnn' + contents: 'onnx2bnn.*' + targetFolder: $(Build.ArtifactStagingDirectory) + - template: template_onnx2bnn_github_release.yml + - template: template_onnx2bnn_upload_to_pypi.yml diff --git a/ci/template_onnx2bnn_build_python.yml b/ci/template_onnx2bnn_build_python.yml index 01bf84f..2c3487e 100644 --- a/ci/template_onnx2bnn_build_python.yml +++ b/ci/template_onnx2bnn_build_python.yml @@ -1,6 +1,6 @@ steps: - script: python -m pip install --user --upgrade setuptools wheel twine displayName: Install setuptools, wheel and twine -- script: python setup.py sdist bdist_wheel +- script: python setup.py bdist_wheel workingDirectory: tools/onnx2bnn/python/ displayName: Build onnx2bnn python package diff --git a/ci/template_onnx2bnn_build_python_all_version.yml b/ci/template_onnx2bnn_build_python_all_version.yml index 0dce96e..74e5380 100644 --- a/ci/template_onnx2bnn_build_python_all_version.yml +++ b/ci/template_onnx2bnn_build_python_all_version.yml @@ -1,20 +1,20 @@ steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - addToPath: true - architecture: 'x64' - - template: template_onnx2bnn_build_python.yml - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.6' - addToPath: true - architecture: 'x64' - - template: template_onnx2bnn_build_python.yml - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.5' - addToPath: true - architecture: 'x64' - - template: template_onnx2bnn_build_python.yml +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + architecture: 'x64' +- template: template_onnx2bnn_build_python.yml +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.6' + addToPath: true + architecture: 'x64' +- template: template_onnx2bnn_build_python.yml +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.5' + addToPath: true + architecture: 'x64' +- template: template_onnx2bnn_build_python.yml diff --git a/ci/template_onnx2bnn_github_release.yml b/ci/template_onnx2bnn_github_release.yml index 84eb2e0..0e067e7 100644 --- a/ci/template_onnx2bnn_github_release.yml +++ b/ci/template_onnx2bnn_github_release.yml @@ -1,12 +1,12 @@ steps: - - task: GitHubRelease@0 - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) - inputs: - gitHubConnection: 'dabnn release' - repositoryName: '$(Build.Repository.Name)' - action: 'edit' - tag: '$(Build.SourceBranchName)' - target: '$(Build.SourceVersion)' - assets: '$(Build.ArtifactStagingDirectory)/*' - assetUploadMode: 'replace' +- task: GitHubRelease@0 + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + inputs: + gitHubConnection: 'dabnn release' + repositoryName: '$(Build.Repository.Name)' + action: 'edit' + tag: '$(Build.SourceBranchName)' + target: '$(Build.SourceVersion)' + assets: '$(Build.ArtifactStagingDirectory)/*' + assetUploadMode: 'replace' diff --git a/ci/template_onnx2bnn_upload_to_pypi.yml b/ci/template_onnx2bnn_upload_to_pypi.yml new file mode 100644 index 0000000..df57b90 --- /dev/null +++ b/ci/template_onnx2bnn_upload_to_pypi.yml @@ -0,0 +1,9 @@ +steps: +- script: python -m twine upload dist/* --verbose + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + displayName: Upload wheel to PyPI + workingDirectory: tools/onnx2bnn/python/ + env: + TWINE_USERNAME: $(twineUsername) + TWINE_PASSWORD: $(twinePassword) +