Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
heku committed Apr 2, 2023
1 parent 568cb1b commit f7c266b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
trigger:
- '*'
- refs/tags/v*
- refs/tags/v*.*

variables:
versionPrefix: 2.7
isTag: ${{ startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}
isHeku: ${{ eq(variables['Build.RequestedFor'], 'Heku') }}
shouldRelease: ${{ and(eq(variables.isHeku, 'True'), eq(variables.isTag, 'True')) }}
${{ if eq(variables.shouldRelease, 'True') }}:
tagVersion: ${{ replace(variables['Build.SourceBranchName'], 'v', '') }}

# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml
name: $(versionPrefix).$(Rev:r)0
name: ${{ coalesce(variables.tagVersion, '$(versionPrefix).$(Rev:r)') }}

jobs:
- job: build
Expand Down Expand Up @@ -70,11 +75,7 @@ jobs:
# https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml#use-a-variable-group
variables:
- group: variables-group
- name: isHeku
value: $[eq(variables['Build.RequestedFor'], 'Heku')]
- name: isTag
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
condition: and(eq(variables.isHeku, 'True'), eq(variables.isTag, 'True'))
condition: ${{ eq(variables.shouldRelease, 'True') }}
environment: publish-vsix
strategy:
runOnce:
Expand Down

0 comments on commit f7c266b

Please sign in to comment.