espanso/ci/deploy.yml

36 lines
1.3 KiB
YAML
Raw Normal View History

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:
- 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:07:27 +00:00
- task: GitHubRelease@0
displayName: Create GitHub release
inputs:
gitHubConnection: ${{ parameters.github.gitHubConnection }}
tagSource: manual
title: '$(vers)'
tag: '$(vers)'
2019-09-21 10:07:27 +00:00
assetUploadMode: replace
action: edit
assets: 'espanso-*'
addChangeLog: false
2019-09-21 10:07:27 +00:00
repositoryName: ${{ parameters.github.repositoryName }}
isPreRelease: ${{ parameters.github.isPreRelease }}
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))