Skip to content

Commit 1d6ae10

Browse files
use MicroBuild to publish to maven
1 parent d9b5fdd commit 1d6ae10

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: $(Date:yyyyMMdd).$(Rev:r)
2+
resources:
3+
repositories:
4+
- repository: MicroBuildTemplate
5+
type: git
6+
name: 1ESPipelineTemplates/MicroBuildTemplate
7+
ref: refs/tags/release
8+
trigger: none
9+
extends:
10+
template: azure-pipelines/1ES.Official.Publish.yml@MicroBuildTemplate
11+
parameters:
12+
pool:
13+
os: linux
14+
name: 1ES_JavaTooling_Pool
15+
image: 1ES_JavaTooling_Ubuntu-2004
16+
sdl:
17+
sourceAnalysisPool:
18+
name: 1ES_JavaTooling_Pool
19+
image: 1ES_JavaTooling_Windows_2022
20+
os: windows
21+
stages:
22+
- stage: PublishToMaven
23+
jobs:
24+
- job: PublishToMaven
25+
steps:
26+
- task: DownloadBuildArtifacts@1
27+
displayName: 'Download Jar Artifacts'
28+
inputs:
29+
buildType: specific
30+
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
31+
pipeline: 16486
32+
downloadType: specific
33+
extractTars: false
34+
itemPattern: 'm2/**'
35+
- script: |
36+
echo "import public key"
37+
echo $GPG_PUBLIC_B64 | base64 -d | gpg --import
38+
39+
echo "import secret key"
40+
echo $GPG_SECRET_B64 | base64 -d | gpg --batch --passphrase $GPGPASS --import
41+
displayName: 'import GPG keys'
42+
env:
43+
GPG_PUBLIC_B64: $(GPG_PUBLIC_B64)
44+
GPG_SECRET_B64: $(GPG_SECRET_B64)
45+
GPGPASS: $(GPGPASS)
46+
- task: NodeTool@0
47+
displayName: 'Use Node 20.x'
48+
inputs:
49+
versionSpec: 20.x
50+
- script: |
51+
cd $(System.ArtifactsDirectory)/m2
52+
pluginJarFile=$(basename -- java-debug-parent/*.pom)
53+
54+
# remove .* from end
55+
noExt=${pluginJarFile%.*}
56+
57+
# remove *- from start
58+
export releaseVersion=${noExt##*-}
59+
echo $releaseVersion
60+
61+
export artifactFolder=$(pwd .)
62+
wget https://raw.githubusercontent.com/microsoft/java-debug/master/scripts/publishMaven.js
63+
64+
export GPG_TTY=$(tty)
65+
node publishMaven.js -task gpg
66+
displayName: 'sign artifacts'
67+
env:
68+
GPG_PUBLIC_B64: $(GPG_PUBLIC_B64)
69+
GPG_SECRET_B64: $(GPG_SECRET_B64)
70+
GPGPASS: $(GPGPASS)
71+
NEXUS_OSSRHPASS: $(NEXUS_OSSRHPASS)
72+
NEXUS_OSSRHUSER: $(NEXUS_OSSRHUSER)
73+
NEXUS_STAGINGPROFILEID: $(NEXUS_STAGINGPROFILEID)
74+
- template: MicroBuild.Publish.yml@MicroBuildTemplate
75+
parameters:
76+
intent: 'PackageDistribution'
77+
contentType: 'Maven'
78+
contentSource: 'Folder'
79+
folderLocation: '$(System.ArtifactsDirectory)/m2/java-debug-parent'
80+
waitForReleaseCompletion: true
81+
82+
approvers: '[email protected]'
83+
- template: MicroBuild.Publish.yml@MicroBuildTemplate
84+
parameters:
85+
intent: 'PackageDistribution'
86+
contentType: 'Maven'
87+
contentSource: 'Folder'
88+
folderLocation: '$(System.ArtifactsDirectory)/m2/com.microsoft.java.debug.core'
89+
waitForReleaseCompletion: true
90+
91+
approvers: '[email protected]'
92+
- template: MicroBuild.Publish.yml@MicroBuildTemplate
93+
parameters:
94+
intent: 'PackageDistribution'
95+
contentType: 'Maven'
96+
contentSource: 'Folder'
97+
folderLocation: '$(System.ArtifactsDirectory)/m2/com.microsoft.java.debug.plugin'
98+
waitForReleaseCompletion: true
99+
100+
approvers: '[email protected]'

0 commit comments

Comments
 (0)