2019-09-21 10:07:27 +00:00
|
|
|
parameters:
|
|
|
|
github:
|
|
|
|
isPreRelease: false
|
|
|
|
repositoryName: '$(Build.Repository.Name)'
|
2019-09-21 10:20:46 +00:00
|
|
|
gitHubConnection: "MyGithubConnection"
|
2019-09-21 10:07:27 +00:00
|
|
|
dependsOn: []
|
|
|
|
displayName: "Release to github"
|
|
|
|
|
2019-09-21 10:09:41 +00:00
|
|
|
steps:
|
2019-09-21 10:42:23 +00:00
|
|
|
- script: |
|
|
|
|
VER=$(cat Cargo.toml| grep version -m 1 | awk -F '"' '{ print $2 }')
|
2019-09-21 10:54:19 +00:00
|
|
|
echo '##vso[task.setvariable variable=vers]'v$VER
|
2019-09-21 11:46:00 +00:00
|
|
|
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
|
|
|
|
displayName: Obtain version from Cargo.toml on Unix
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
Select-String -Path "Cargo.toml" -Pattern "version" | Select-Object -First 1 -outvariable v
|
|
|
|
$vv = [regex]::match($v, '"([^"]+)"').Groups[1].Value
|
|
|
|
echo "##vso[task.setvariable variable=vers]v$vv"
|
|
|
|
condition: eq(variables['Agent.OS'], 'Windows_NT')
|
|
|
|
displayName: Obtain version from Cargo.toml on Windows
|
2019-09-21 10:42:23 +00:00
|
|
|
|
2019-09-21 10:07:27 +00:00
|
|
|
- task: GitHubRelease@0
|
|
|
|
displayName: Create GitHub release
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: ${{ parameters.github.gitHubConnection }}
|
|
|
|
tagSource: manual
|
2019-09-21 10:42:23 +00:00
|
|
|
title: '$(vers)'
|
|
|
|
tag: '$(vers)'
|
2019-09-21 10:07:27 +00:00
|
|
|
assetUploadMode: replace
|
|
|
|
action: edit
|
2019-09-21 10:42:23 +00:00
|
|
|
assets: 'espanso-*'
|
|
|
|
addChangeLog: false
|
2019-09-21 10:07:27 +00:00
|
|
|
repositoryName: ${{ parameters.github.repositoryName }}
|
|
|
|
isPreRelease: ${{ parameters.github.isPreRelease }}
|