@@ -10,6 +10,9 @@ parameters:
1010 - name : BaseBranch
1111 displayName : Base Branch
1212 default : features/2.0
13+ - name : GenerationBranch
14+ displayName : Generation branch
15+ default : v2/generation
1316 - name : SkipForceRefresh
1417 displayName : Skip Force Refresh
1518 default : false
@@ -34,6 +37,7 @@ parameters:
3437variables :
3538 Branch : " WeeklyPreviewRefresh"
3639 BaseBranch : ${{ parameters.BaseBranch }}
40+ GenerationBranch : ${{ parameters.GenerationBranch }}
3741 BuildAgent : ${{ parameters.BuildAgent }}
3842 SkipForceRefresh : ${{ parameters.SkipForceRefresh }}
3943
@@ -116,3 +120,40 @@ jobs:
116120 TargetBranch : $(WeeklyBranch)
117121 Title : " [v2] Weekly OpenApiDocs Refresh"
118122 Body : " This pull request was automatically created by Azure Pipelines. **Important** Check for unexpected deletions or changes in this PR."
123+ # Push SDK artifacts to generation branch.
124+ - task : PowerShell@2
125+ name : " ComputeGenerationBranch"
126+ displayName : " Compute weekly generation branch name"
127+ inputs :
128+ targetType : inline
129+ script : |
130+ $branch = "{0}/{1}" -f "WeeklyGeneration", (Get-Date -Format yyyyMMddHHmm)
131+ Write-Host "##vso[task.setvariable variable=WeeklyGenerationBranch;isOutput=true]$branch"
132+ - task : Bash@3
133+ displayName : " Create weekly generation branch"
134+ inputs :
135+ targetType : inline
136+ script : |
137+ git status
138+ git branch $(ComputeGenerationBranch.WeeklyGenerationBranch)
139+ git checkout $(ComputeGenerationBranch.WeeklyGenerationBranch)
140+ git status
141+ - task : Bash@3
142+ displayName : Commit Generated SDK artifacts
143+ enabled : true
144+ env :
145+ GITHUB_TOKEN : $(GITHUB_TOKEN)
146+ inputs :
147+ targetType : inline
148+ script : |
149+ git add .
150+ git commit -m 'Adds generated module artifacts'
151+ git push "https://$(GITHUB_TOKEN)@github.com/microsoftgraph/msgraph-sdk-powershell.git"
152+ git status
153+ - ${{ if eq(parameters.CreatePullRequest, true) }} :
154+ - template : common-templates/create-pr.yml
155+ parameters :
156+ BaseBranch : $(GenerationBranch)
157+ TargetBranch : $(ComputeGenerationBranch.WeeklyGenerationBranch)
158+ Title : " [v2] Weekly Generated Module Artifacts"
159+ Body : " This pull request was automatically created by Azure Pipelines. **Important** Check for unexpected deletions or changes in this PR."
0 commit comments