2019-07-14 21:54:45 +00:00
|
|
|
parameters:
|
|
|
|
rust_version: stable
|
|
|
|
github:
|
|
|
|
isPreRelease: false
|
|
|
|
repositoryName: "$(Build.Repository.Name)"
|
2019-07-15 04:04:53 +00:00
|
|
|
displayName: "Release to GitHub"
|
2019-07-14 21:54:45 +00:00
|
|
|
archiveName: "$(Build.Repository.Name)"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: ${{ parameters.name }}
|
|
|
|
displayName: ${{ parameters.displayName }}
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-16.04
|
|
|
|
steps:
|
|
|
|
- template: install-cross-rust.yml
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
MY_TAG="$(Build.SourceBranch)"
|
|
|
|
MY_TAG=${MY_TAG#refs/tags/}
|
|
|
|
echo $MY_TAG
|
|
|
|
echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG"
|
|
|
|
DATE="$(date +%Y-%m-%d)"
|
|
|
|
echo "##vso[task.setvariable variable=build.date]$DATE"
|
|
|
|
displayName: "Create date and tag variables"
|
|
|
|
- ${{ each build_target in parameters.targets }}:
|
|
|
|
- ? ${{ if not(or(eq(build_target, 'x86_64-apple-darwin'), eq(build_target, 'x86_64-pc-windows-msvc'))) }}
|
|
|
|
: - script: |
|
|
|
|
echo Start building ${{ build_target }}
|
|
|
|
cross build --target ${{ build_target }} --release
|
|
|
|
ls -l
|
|
|
|
ls -l target/${{ build_target }}/release/*
|
|
|
|
displayName: Relase build for target ${{ build_target }}
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Copy files for target ${{ build_target }}
|
|
|
|
inputs:
|
|
|
|
sourceFolder: "$(Build.SourcesDirectory)/target/${{ build_target }}/release"
|
|
|
|
contents: ${{ parameters.contents }}
|
|
|
|
targetFolder: "$(Build.BinariesDirectory)/${{ build_target }}"
|
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Gather assets
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: "$(Build.BinariesDirectory)/${{ build_target }}"
|
2019-07-15 04:20:19 +00:00
|
|
|
archiveType: "tar"
|
|
|
|
tarCompression: "gz"
|
|
|
|
archiveFile: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}-$(build.my_tag)-${{ build_target }}.tar.gz"
|
2019-07-14 21:54:45 +00:00
|
|
|
|
|
|
|
- task: GitHubRelease@0
|
|
|
|
displayName: Create release
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: ${{ parameters.github.gitHubConnection }}
|
|
|
|
tagSource: manual
|
|
|
|
title: "$(build.my_tag) - $(build.date)"
|
|
|
|
tag: "$(build.my_tag)"
|
|
|
|
assetUploadMode: replace
|
|
|
|
action: edit
|
|
|
|
assets: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}*"
|
|
|
|
repositoryName: ${{ parameters.github.repositoryName }}
|
|
|
|
isPreRelease: ${{ parameters.github.isPreRelease }}
|
|
|
|
|
|
|
|
- ${{ each build_target in parameters.targets }}:
|
|
|
|
- ${{ if eq(build_target, 'x86_64-apple-darwin') }}:
|
|
|
|
- job: ${{ parameters.name }}_macOS
|
|
|
|
displayName: ${{ parameters.displayName }} (macOS)
|
|
|
|
pool:
|
|
|
|
vmImage: macOS-10.13
|
|
|
|
steps:
|
|
|
|
- template: install-rust.yml
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
MY_TAG="$(Build.SourceBranch)"
|
|
|
|
MY_TAG=${MY_TAG#refs/tags/}
|
|
|
|
echo $MY_TAG
|
|
|
|
echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG"
|
|
|
|
DATE="$(date +%Y-%m-%d)"
|
|
|
|
echo "##vso[task.setvariable variable=build.date]$DATE"
|
|
|
|
displayName: "Create date and tag variables"
|
|
|
|
- script: |
|
|
|
|
echo Start building ${{ build_target }}
|
|
|
|
cargo build --release
|
|
|
|
ls -l
|
|
|
|
ls -l target/release/*
|
|
|
|
displayName: Relase build for target ${{ build_target }}
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Copy files for target ${{ build_target }}
|
|
|
|
inputs:
|
|
|
|
sourceFolder: "$(Build.SourcesDirectory)/target/release"
|
|
|
|
contents: ${{ parameters.contents }}
|
|
|
|
targetFolder: "$(Build.BinariesDirectory)/${{ build_target }}"
|
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Gather assets
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: "$(Build.BinariesDirectory)/${{ build_target }}"
|
2019-07-15 04:20:19 +00:00
|
|
|
archiveType: "tar"
|
|
|
|
tarCompression: "gz"
|
|
|
|
archiveFile: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}-$(build.my_tag)-${{ build_target }}.tar.gz"
|
2019-07-14 21:54:45 +00:00
|
|
|
|
|
|
|
- task: GitHubRelease@0
|
|
|
|
displayName: Create release
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: ${{ parameters.github.gitHubConnection }}
|
|
|
|
tagSource: manual
|
|
|
|
title: "$(build.my_tag) - $(build.date)"
|
|
|
|
tag: "$(build.my_tag)"
|
|
|
|
assetUploadMode: replace
|
|
|
|
action: edit
|
|
|
|
assets: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}*"
|
|
|
|
repositoryName: ${{ parameters.github.repositoryName }}
|
|
|
|
isPreRelease: ${{ parameters.github.isPreRelease }}
|
|
|
|
|
|
|
|
- ${{ if eq(build_target, 'x86_64-pc-windows-msvc') }}:
|
|
|
|
- job: ${{ parameters.name }}_msvc
|
|
|
|
displayName: ${{ parameters.displayName }} (Windows)
|
|
|
|
pool:
|
|
|
|
vmImage: vs2017-win2016
|
|
|
|
steps:
|
|
|
|
- template: install-rust.yml
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
MY_TAG="$(Build.SourceBranch)"
|
|
|
|
MY_TAG=${MY_TAG#refs/tags/}
|
|
|
|
echo $MY_TAG
|
|
|
|
echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG"
|
|
|
|
DATE="$(date +%Y-%m-%d)"
|
|
|
|
echo "##vso[task.setvariable variable=build.date]$DATE"
|
|
|
|
displayName: "Create date and tag variables"
|
|
|
|
- script: |
|
|
|
|
echo Start building ${{ build_target }}
|
|
|
|
cargo build --release
|
|
|
|
ls -l
|
|
|
|
ls -l target/release/*
|
|
|
|
displayName: Relase build for target ${{ build_target }}
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Copy files for target ${{ build_target }}
|
|
|
|
inputs:
|
|
|
|
sourceFolder: "$(Build.SourcesDirectory)/target/release"
|
|
|
|
contents: ${{ parameters.contents }}
|
|
|
|
targetFolder: "$(Build.BinariesDirectory)/${{ build_target }}"
|
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Gather assets
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: "$(Build.BinariesDirectory)/${{ build_target }}"
|
2019-07-15 04:20:19 +00:00
|
|
|
archiveType: "zip"
|
|
|
|
tarCompression: "None"
|
2019-07-14 21:54:45 +00:00
|
|
|
archiveFile: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}-$(build.my_tag)-${{ build_target }}.zip"
|
|
|
|
|
|
|
|
- task: GitHubRelease@0
|
|
|
|
displayName: Create release
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: ${{ parameters.github.gitHubConnection }}
|
|
|
|
tagSource: manual
|
|
|
|
title: "$(build.my_tag) - $(build.date)"
|
|
|
|
tag: "$(build.my_tag)"
|
|
|
|
assetUploadMode: replace
|
|
|
|
action: edit
|
|
|
|
assets: "$(Build.ArtifactStagingDirectory)/${{ parameters.archiveName }}*"
|
|
|
|
repositoryName: ${{ parameters.github.repositoryName }}
|
|
|
|
isPreRelease: ${{ parameters.github.isPreRelease }}
|