Skip to content

Commit

Permalink
Merge pull request #26 from JDAI-CV/ci_macos
Browse files Browse the repository at this point in the history
onnx2bnn macos CI
  • Loading branch information
daquexian authored May 22, 2019
2 parents 9e40eda + bbe82e7 commit 072cad0
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 51 deletions.
74 changes: 24 additions & 50 deletions ci/onnx2bnn_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pr:
- dabnn/*

jobs:
- job: Linux_AppImage
- job: LinuxAppImage
pool:
vmImage: 'ubuntu-16.04'
steps:
Expand All @@ -43,63 +43,37 @@ jobs:
inputs:
contents: 'onnx2bnn.AppImage'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: onnx2bnn AppImage
- 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'
- job: Windows_Python_Package
- template: template_onnx2bnn_publish_artifacts.yml
- template: template_onnx2bnn_github_release.yml
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- checkout: self
submodules: true
- 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
- template: template_onnx2bnn_build_python_all_version.yml
- task: CopyFiles@2
inputs:
sourceFolder: '.setuptools-cmake-build\tools\onnx2bnn\Release\'
contents: 'onnx2bnn.exe'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- template: template_onnx2bnn_publish_artifacts.yml
- template: template_onnx2bnn_github_release.yml
- 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
- script: 'cp .setuptools-cmake-build/tools/onnx2bnn/onnx2bnn .setuptools-cmake-build/tools/onnx2bnn/onnx2bnn-macos'
displayName: 'Rename onnx2bnn'
- task: CopyFiles@2
inputs:
gitHubConnection: 'dabnn release'
repositoryName: '$(Build.Repository.Name)'
action: 'edit'
tag: '$(Build.SourceBranchName)'
target: '$(Build.SourceVersion)'
assets: '$(Build.ArtifactStagingDirectory)/*'
assetUploadMode: 'replace'
- 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)
sourceFolder: '.setuptools-cmake-build/tools/onnx2bnn'
contents: 'onnx2bnn-macos'
targetFolder: $(Build.ArtifactStagingDirectory)
- template: template_onnx2bnn_publish_artifacts.yml
- template: template_onnx2bnn_github_release.yml
- template: template_onnx2bnn_upload_to_pypi.yml
2 changes: 1 addition & 1 deletion ci/template_onnx2bnn_build_python.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions ci/template_onnx2bnn_build_python_all_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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

12 changes: 12 additions & 0 deletions ci/template_onnx2bnn_github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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'

6 changes: 6 additions & 0 deletions ci/template_onnx2bnn_publish_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: onnx2bnn

9 changes: 9 additions & 0 deletions ci/template_onnx2bnn_upload_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 072cad0

Please sign in to comment.