-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
82 lines (76 loc) · 2.88 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
trigger:
branches:
include:
- master
tags:
include:
- v*
resources:
pipelines:
- pipeline: saker_build_ide_eclipse
project: 'saker.build.ide.eclipse'
source: 'sakerbuild.saker.build.ide.eclipse'
trigger:
branches:
- master
- refs/tags/v*
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
set -e
TAGVER=$(echo $BUILD_SOURCEBRANCHNAME | sed -r 's/v(.*)/\1/' | cut -d . -f 1,2,3)
sed -i -s "s/111.222.334.qualifier/$TAGVER.qualifier/g" META-INF/MANIFEST.MF
echo "New version: $(cat META-INF/MANIFEST.MF | grep 'Bundle-Version:')"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
displayName: 'Replace Bundle-Version'
- script: |
set -e
echo "##vso[task.setvariable variable=BUILD_VERSION_NUMBER]$(cat META-INF/MANIFEST.MF | grep Bundle-Version: | sed -r 's/Bundle-Version: (.*)\.qualifier/\1/')"
displayName: 'Set BUILD_VERSION_NUMBER'
- script: |
set -e
TAGVER=$(echo $BUILD_SOURCEBRANCHNAME | sed -r 's/v(.*)/\1/' | cut -d . -f 1,2,3)
if [ $(BUILD_VERSION_NUMBER) != "$TAGVER" ]; then
echo "Bundle-Version: $(BUILD_VERSION_NUMBER) doesn't match tag version: $TAGVER"
exit 1
fi
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
displayName: 'Check version number - tag consistency '
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: 'saker.build.ide.eclipse'
pipeline: 22
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
artifactName: 'saker.build.ide.eclipse'
path: 'lib/saker.build.ide.eclipse/'
- script: |
set -e
curl https://archive.eclipse.org/technology/epp/downloads/release/2020-03/R/eclipse-rcp-2020-03-R-linux-gtk-x86_64.tar.gz -o eclipse.tar.gz
tar -xzf "eclipse.tar.gz"
displayName: 'Download Eclipse'
- script: |
set -e
eclipse/eclipse -vm $(JAVA_HOME_8_X64)/bin -nosplash -application org.eclipse.ant.core.antRunner -data .. -verbose -buildfile build.xml -DbuildTempFolder=build/temp -DbuildDirectory=build -Dbuild.result.folder=build/res -Dplugin.destination=build/plugin -DbuildVersionNumber=$BUILD_VERSION_NUMBER build.update.jar
displayName: 'Build update JAR'
- script: |
set -e
mkdir gh-release
cp build/plugin/saker.java.ide.eclipse.jar gh-release/
cp build/plugin/saker.java.ide.eclipse.ver gh-release/
cp update-site/features/feature.xml gh-release/
displayName: 'Setup GitHub Release'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
inputs:
pathtoPublish: gh-release/
artifactName: saker.java.ide.eclipse
- task: GithubRelease@0
displayName: 'Create GitHub Release'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
gitHubConnection: saker.java.ide.eclipse-ci-release-push
repositoryName: sakerbuild/saker.java.ide.eclipse
assets: gh-release/*