-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-release-github.yml
75 lines (66 loc) · 2.1 KB
/
azure-pipelines-release-github.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
name: $(Build.BuildID)
trigger: none
parameters:
- name: version
displayName: Version
type: string
default: ''
- name: releaseType
displayName: releaseType
type: string
values:
- EarlyAccess
- Release
resources:
- repo: self
pool:
vmImage: ubuntu-latest
stages:
- stage: Release
jobs:
- job: Release
steps:
- checkout: self
persistCredentials: true
fetchTags: true
fetchDepth: 0
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: 'jreleaser-azure-devops-extension'
definition: '${{ parameters.releaseType }}'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
artifactName: 'JReleaserExtension-vsix'
targetPath: '$(System.DefaultWorkingDirectory)'
- ${{ if eq(parameters.releaseType, 'EarlyAccess') }}:
- task: CmdLine@2
displayName: 'Set Early Access Version'
inputs:
script: |
latest_tag=$(git tag -l --sort=-v:refname | grep -v "early-access" | head -n 1)
echo "##vso[task.setvariable variable=earlyaccessVer]$(echo $latest_tag | awk -F. '{$2 = $2 + 1; $3 = 0;} 1' | sed 's/ /./g')-earlyaccess"
- task: JReleaserInstaller@0
inputs:
version: '1.5.1'
- ${{if eq(parameters.releaseType, 'EarlyAccess')}}:
- task: JReleaserInvoker@0
env:
JRELEASER_GITHUB_TOKEN: $(JRELEASER_GITHUB_TOKEN)
JRELEASER_PROJECT_VERSION: $(earlyaccessVer)
JRELEASER_TAG_NAME: 'early-access'
JRELEASER_OVERWRITE: true
inputs:
command: 'release'
- ${{if eq(parameters.releaseType, 'Release')}}:
- task: JReleaserInvoker@0
env:
JRELEASER_GITHUB_TOKEN: $(JRELEASER_GITHUB_TOKEN)
JRELEASER_PROJECT_VERSION: ${{ parameters.version}}
JRELEASER_TAG_NAME: ${{ parameters.version}}
inputs:
command: 'release'