-
Notifications
You must be signed in to change notification settings - Fork 20
/
azure-pipelines.yml
172 lines (166 loc) · 7.26 KB
/
azure-pipelines.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
trigger:
- none
parameters:
- name: Revision
type: string
default: 50.0.0-rc07
- name: SkipTests
type: string
default: 'false'
variables:
# overrides pom.xml; must be unique if BuildGoal is set to deploy.
- name: Revision
value: ${{ parameters.Revision }}
# if BuildGoal = 'deploy', the uberjars will be published on the maven repository. 'package' does not deploy
# to maven repository, so Revision can be kept for several runs when debugging the installers.
- name: BuildGoal
value: deploy
# ReleaseRepoCredentials contains github users and tokens
- group: ReleaseRepoCredentials
- template: src/main/azure-pipelines/variables-releaseRepoCredentials.yml
- name: MavenCacheFolder
value: $(Pipeline.Workspace)/.m2/repository
- name: MavenOpts
value: -Dmaven.repo.local=$(MavenCacheFolder) -Drevision=$(Revision)
jobs:
# build owlcms uberjar, zip and installer
- template: src/main/azure-pipelines/job-buildUberJar.yml
parameters:
jobName: BuildOwlcmsUberJar
moduleName: owlcms
artifactName: OwlcmsZip
skipTests: ${{ parameters.skipTests }}
- template: src/main/azure-pipelines/job-createInstaller.yml
parameters:
jobName: CreateOwlcmsInstaller
dependsOn: BuildOwlcmsUberJar
moduleName: owlcms
artifactName: OwlcmsSetup
# - template: src/main/azure-pipelines/job-herokuRelease.yml
# parameters:
# jobName: ReleaseOwlcmsHeroku
# dependsOn: BuildOwlcmsUberJar
# moduleName: owlcms
# build publicresults uberjar, zip and installer
- template: src/main/azure-pipelines/job-buildUberJar.yml
parameters:
jobName: BuildPublicResultsUberJar
moduleName: publicresults
artifactName: PublicResultsZip
- template: src/main/azure-pipelines/job-createInstaller.yml
parameters:
jobName: CreatePublicResultsInstaller
dependsOn: BuildPublicResultsUberJar
moduleName: publicresults
artifactName: PublicResultsSetup
# release the installers to github repositories
- job: ReleaseInstallers
dependsOn:
- CreateOwlcmsInstaller
- CreatePublicResultsInstaller
pool:
vmImage: ubuntu-latest
steps:
- download: current
artifact: OwlcmsZip
- download: current
artifact: OwlcmsSetup
- download: current
artifact: PublicResultsZip
- download: current
artifact: PublicResultsSetup
- template: src/main/azure-pipelines/steps-prepare-maven.yml
- task: Maven@3.205.1
displayName: Build and Push Docker Images
inputs:
mavenPomFile: owlcms-docker/pom.xml
mavenOptions: -Xmx3072m $(MavenOpts)
javaHomeOption: JDKVersion
jdkVersionOption: '1.11'
jdkArchitectureOption: x64
publishJUnitResults: false
goals: deploy $(MavenOpts)
env:
DOCKER_REG: $(DOCKER_REG)
DOCKER_USER: $(DOCKER_USER)
DOCKER_TOKEN: $(DOCKER_TOKEN)
DOCKER_TAG: $(DOCKER_TAG)
- task: Maven@3.205.1
displayName: Pre-process Release Notes
inputs:
mavenPomFile: pom.xml
mavenOptions: -Xmx3072m $(MavenOpts)
javaHomeOption: JDKVersion
jdkVersionOption: '1.11'
jdkArchitectureOption: x64
publishJUnitResults: false
goals: package $(MavenOpts) --non-recursive -Dmaven.test.skip=true
env:
# used by maven for substitutions in release notes and URLs
REPO_OWNER: $(RELEASE_USER)
H_REPO_NAME: owlcms-heroku$(RELEASE_SUFFIX)
P_REPO_NAME: publicresults-heroku$(RELEASE_SUFFIX)
O_REPO_NAME: owlcms4$(RELEASE_SUFFIX)
- script: |
# tag origin
# library group ReleaseRepoCredentials contains github users and tokens
git config user.email "$(Build.RequestedForEmail)"
git config user.name "$(Build.RequestedFor)"
git checkout $(Build.SourceBranchName)
# no need to do [skip ci] because we have trigger: none
git add -A && git commit -m "$(Revision)" --allow-empty
git tag $(Revision) -f -a -m "$(Revision)"
git push https://$(repoToken)@github.com/$(repoUser)/owlcms4.git $(Revision) --force
displayName: tag origin
- script: |
# publish docs and pom.xml back to origin only for stable releases
git push https://$(repoToken)@github.com/$(repoUser)/owlcms4.git $(Build.SourceBranchName) --force
condition: or(eq(variables['Build.SourceBranchName'], 'main49'),eq(variables['Build.SourceBranchName'], 'main50'))
displayName: sync dev doc
- script: |
# publish sources and docs to prerelease repo
# library group ReleaseRepoCredentials contains github users and tokens
git push https://$(releaseToken)@github.com/$(releaseUser)/owlcms4$(RELEASE_SUFFIX).git $(Build.SourceBranchName):master --force
condition: or(eq(variables['Build.SourceBranchName'], 'dev49'), eq(variables['Build.SourceBranchName'], 'dev50'))
displayName: sync prerelease repo
- script: |
# publish sources and docs to release repo
# library group ReleaseRepoCredentials contains github users and tokens
git push https://$(releaseToken)@github.com/$(releaseUser)/owlcms4.git $(Build.SourceBranchName):master --force
condition: or(eq(variables['Build.SourceBranchName'], 'main49'),eq(variables['Build.SourceBranchName'], 'main50'))
displayName: sync release repo
# all releases are marked as "isPreRelease: false" else we cannot have a generic link to the latest prerelease.
# the repo and name determines the maturity status.
- task: GitHubRelease@0
displayName: Release on Github
inputs:
${{ if eq(variables['Build.SourceBranchName'], 'dev49') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'main49') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'dev50') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'main50') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
action: "create" # Options: create, edit, delete
target: master # all our releases are on the master branch of the release repos.
tagSource: "manual"
title: $(Revision)
tag: $(Revision)
releaseNotesSource: "file"
releaseNotesFile: $(Build.SourcesDirectory)/ReleaseNotes.md # Optional
assets: |
$(Pipeline.Workspace)/OwlcmsZip/*
$(Pipeline.Workspace)/PublicResultsZip/*
$(Pipeline.Workspace)/OwlcmsSetup/*
$(Pipeline.Workspace)/PublicResultsSetup/*
assetUploadMode: "delete" # Optional. Options: delete, replace
addChangeLog: false # Optional