Skip to content

Commit

Permalink
eng, integrate GitHub Release to devop pipeline (#2553)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft committed Feb 7, 2024
1 parent 4db424d commit 121ef26
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 270 deletions.
77 changes: 0 additions & 77 deletions .github/workflows/pre-release-typespec.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/pre-release.yml

This file was deleted.

5 changes: 3 additions & 2 deletions eng/pipelines/post-publish-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ pool:

variables:
- group: Release Secrets for GitHub
- name: NodeVersion
value: '18.x'

resources:
repositories:
Expand All @@ -23,6 +21,9 @@ jobs:

timeoutInMinutes: 60

variables:
- template: /eng/pipelines/variables/globals.yml

steps:
- checkout: self
fetchDepth: 1
Expand Down
119 changes: 72 additions & 47 deletions eng/pipelines/publish-autorest-java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,76 @@ pool:
name: "azsdk-pool-mms-ubuntu-2004-general"
vmImage: "MMSUbuntu20.04"

variables:
- group: Release Secrets for GitHub

jobs:
- job: Build

timeoutInMinutes: 30

variables:
- template: /eng/pipelines/variables/globals.yml

steps:
- task: NodeTool@0
displayName: 'Install Node.js $(NodeVersion)'
inputs:
versionSpec: '$(NodeVersion)'

- template: /eng/pipelines/steps/cache-maven-repository.yml
parameters:
JobType: 'Publish Autorest'

- task: Maven@3
displayName: 'Build JAR'
inputs:
mavenPomFile: pom.xml
goals: 'clean install'
options: '$(DefaultOptions) -P local -T 1C'
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false

- task: Npm@1
displayName: 'Install Dependencies for AutoRest Java'
inputs:
command: install

- task: Npm@1
displayName: 'Pack AutoRest Java'
inputs:
command: custom
customCommand: pack

- script: |
npm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
ls *.tgz | npm publish -0 --access public
npm config delete //registry.npmjs.org/:_authToken
displayName: 'Publish AutoRest Java to NPM'
- template: /eng/pipelines/steps/cleanup-maven-local-cache.yml
- job: Build

timeoutInMinutes: 30

variables:
- template: /eng/pipelines/variables/globals.yml

steps:
- task: NodeTool@0
displayName: 'Install Node.js $(NodeVersion)'
inputs:
versionSpec: '$(NodeVersion)'

- template: /eng/pipelines/steps/cache-maven-repository.yml
parameters:
JobType: 'Publish Autorest'

- task: Maven@3
displayName: 'Build JAR'
inputs:
mavenPomFile: pom.xml
goals: 'clean install'
options: '$(DefaultOptions) -P local -T 1C'
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false

- task: Npm@1
displayName: 'Install Dependencies for AutoRest Java'
inputs:
command: install

- task: Npm@1
displayName: 'Pack AutoRest Java'
inputs:
command: custom
customCommand: pack

- task: PowerShell@2
displayName: 'Get Package Version'
inputs:
targetType: 'inline'
script: |
$PACKAGE_VERSION = node -p -e "require('./package.json').version"
Write-Host("##vso[task.setvariable variable=PackageVersion]$PACKAGE_VERSION")
- task: PowerShell@2
displayName: 'Create GitHub Releases'
inputs:
filePath: eng/scripts/Create-Release.ps1
arguments: >
-releaseSha '$(Build.SourceVersion)'
-tagName 'v$(PackageVersion)'
-title 'AutoRest Java v$(PackageVersion)'
-releaseNotes '- Bug fix'
pwsh: true
timeoutInMinutes: 5
env:
GH_TOKEN: $(azuresdk-github-pat)

- script: |
npm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
ls *.tgz | npm publish -0 --access public
npm config delete //registry.npmjs.org/:_authToken
displayName: 'Publish AutoRest Java to NPM'
- template: /eng/pipelines/steps/cleanup-maven-local-cache.yml
Loading

0 comments on commit 121ef26

Please sign in to comment.