espanso/ci/deploy.yml
2019-09-21 13:46:00 +02:00

35 lines
1.2 KiB
YAML

parameters:
github:
isPreRelease: false
repositoryName: '$(Build.Repository.Name)'
gitHubConnection: "MyGithubConnection"
dependsOn: []
displayName: "Release to github"
steps:
- script: |
VER=$(cat Cargo.toml| grep version -m 1 | awk -F '"' '{ print $2 }')
echo '##vso[task.setvariable variable=vers]'v$VER
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
- task: GitHubRelease@0
displayName: Create GitHub release
inputs:
gitHubConnection: ${{ parameters.github.gitHubConnection }}
tagSource: manual
title: '$(vers)'
tag: '$(vers)'
assetUploadMode: replace
action: edit
assets: 'espanso-*'
addChangeLog: false
repositoryName: ${{ parameters.github.repositoryName }}
isPreRelease: ${{ parameters.github.isPreRelease }}