From 609d1aad069e8e45a317b088662bd19617a2753c Mon Sep 17 00:00:00 2001 From: daquexian Date: Tue, 21 May 2019 07:31:47 +0800 Subject: [PATCH 1/4] ci template --- ci/onnx2bnn_build.yml | 41 ++----------------- ...late_onnx2bnn_build_python_all_version.yml | 20 +++++++++ ci/template_onnx2bnn_github_release.yml | 12 ++++++ 3 files changed, 35 insertions(+), 38 deletions(-) create mode 100644 ci/template_onnx2bnn_build_python_all_version.yml create mode 100644 ci/template_onnx2bnn_github_release.yml diff --git a/ci/onnx2bnn_build.yml b/ci/onnx2bnn_build.yml index ca24bcf..c00936c 100644 --- a/ci/onnx2bnn_build.yml +++ b/ci/onnx2bnn_build.yml @@ -47,55 +47,20 @@ jobs: 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' + - template: template_onnx2bnn_github_release.yml - job: Windows_Python_Package 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')) - inputs: - gitHubConnection: 'dabnn release' - repositoryName: '$(Build.Repository.Name)' - action: 'edit' - tag: '$(Build.SourceBranchName)' - target: '$(Build.SourceVersion)' - assets: '$(Build.ArtifactStagingDirectory)/*' - assetUploadMode: 'replace' + - 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 diff --git a/ci/template_onnx2bnn_build_python_all_version.yml b/ci/template_onnx2bnn_build_python_all_version.yml new file mode 100644 index 0000000..0dce96e --- /dev/null +++ b/ci/template_onnx2bnn_build_python_all_version.yml @@ -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 + diff --git a/ci/template_onnx2bnn_github_release.yml b/ci/template_onnx2bnn_github_release.yml new file mode 100644 index 0000000..84eb2e0 --- /dev/null +++ b/ci/template_onnx2bnn_github_release.yml @@ -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' + From 2acfddf6cbef78a973797d7aa28ea683efadca09 Mon Sep 17 00:00:00 2001 From: daquexian Date: Tue, 21 May 2019 07:38:47 +0800 Subject: [PATCH 2/4] Add macos ci --- ci/onnx2bnn_build.yml | 26 +++++++++----- ci/template_onnx2bnn_build_python.yml | 2 +- ...late_onnx2bnn_build_python_all_version.yml | 36 +++++++++---------- ci/template_onnx2bnn_github_release.yml | 20 +++++------ ci/template_onnx2bnn_upload_to_pypi.yml | 9 +++++ 5 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 ci/template_onnx2bnn_upload_to_pypi.yml 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) + From c5480b96d59a47d060da940c4a5143e95dae817f Mon Sep 17 00:00:00 2001 From: daquexian Date: Tue, 21 May 2019 09:28:16 +0800 Subject: [PATCH 3/4] Update --- ci/onnx2bnn_build.yml | 9 ++++----- ci/template_onnx2bnn_publish_artifacts.yml | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 ci/template_onnx2bnn_publish_artifacts.yml diff --git a/ci/onnx2bnn_build.yml b/ci/onnx2bnn_build.yml index 2ede1ee..b2203db 100644 --- a/ci/onnx2bnn_build.yml +++ b/ci/onnx2bnn_build.yml @@ -43,10 +43,7 @@ jobs: inputs: contents: 'onnx2bnn.AppImage' targetFolder: $(Build.ArtifactStagingDirectory) - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: $(Build.ArtifactStagingDirectory) - artifactName: onnx2bnn AppImage + - template: template_onnx2bnn_publish_artifacts.yml - template: template_onnx2bnn_github_release.yml - job: Windows pool: @@ -60,6 +57,7 @@ jobs: sourceFolder: '.setuptools-cmake-build\tools\onnx2bnn\Release\' contents: 'onnx2bnn.exe' targetFolder: $(Build.ArtifactStagingDirectory) + - template: template_onnx2bnn_publish_artifacts.yml - template: template_onnx2bnn_github_release.yml - template: template_onnx2bnn_upload_to_pypi.yml - job: macOS @@ -72,7 +70,8 @@ jobs: - task: CopyFiles@2 inputs: sourceFolder: '.setuptools-cmake-build/tools/onnx2bnn' - contents: 'onnx2bnn.*' + contents: 'onnx2bnn' targetFolder: $(Build.ArtifactStagingDirectory) + - template: template_onnx2bnn_publish_artifacts.yml - template: template_onnx2bnn_github_release.yml - template: template_onnx2bnn_upload_to_pypi.yml diff --git a/ci/template_onnx2bnn_publish_artifacts.yml b/ci/template_onnx2bnn_publish_artifacts.yml new file mode 100644 index 0000000..f013ada --- /dev/null +++ b/ci/template_onnx2bnn_publish_artifacts.yml @@ -0,0 +1,6 @@ +steps: +- task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: onnx2bnn + From bbe82e7a7ccfbd2e09da7b6e3d5e3c29bdedbcc0 Mon Sep 17 00:00:00 2001 From: daquexian Date: Wed, 22 May 2019 12:01:25 +0800 Subject: [PATCH 4/4] rename onnx2bnn to onnx2bnn-macos in macos ci --- ci/onnx2bnn_build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/onnx2bnn_build.yml b/ci/onnx2bnn_build.yml index b2203db..c38a2ff 100644 --- a/ci/onnx2bnn_build.yml +++ b/ci/onnx2bnn_build.yml @@ -67,10 +67,12 @@ jobs: - 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: sourceFolder: '.setuptools-cmake-build/tools/onnx2bnn' - contents: 'onnx2bnn' + contents: 'onnx2bnn-macos' targetFolder: $(Build.ArtifactStagingDirectory) - template: template_onnx2bnn_publish_artifacts.yml - template: template_onnx2bnn_github_release.yml