mirror of
https://github.com/actions/python-versions.git
synced 2025-04-06 23:39:38 +00:00
Move release and PR creation to the GitHub Actions
This commit is contained in:
@ -116,3 +116,17 @@ stages:
|
||||
Architecture: x86
|
||||
jobs:
|
||||
- template: /azure-pipelines/templates/test-job.yml
|
||||
|
||||
- stage: Publish_Release
|
||||
dependsOn: [Test_Python_MacOS, Test_Python_Ubuntu_1604, Test_Python_Ubuntu_1804, Test_Python_Ubuntu_2004, Test_Python_x64_Windows, Test_Python_x86_Windows]
|
||||
jobs:
|
||||
- deployment: Publish_Release
|
||||
pool:
|
||||
name: Azure Pipelines
|
||||
vmImage: ubuntu-18.04
|
||||
environment: 'Get Available Tools Versions - Publishing Approval'
|
||||
strategy:
|
||||
runOnce:
|
||||
deploy:
|
||||
steps:
|
||||
- template: /azure-pipelines/templates/publish-release-steps.yml
|
||||
|
46
azure-pipelines/templates/publish-release-steps.yml
Normal file
46
azure-pipelines/templates/publish-release-steps.yml
Normal file
@ -0,0 +1,46 @@
|
||||
steps:
|
||||
- download: none
|
||||
|
||||
- checkout: self
|
||||
submodules: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'current'
|
||||
path: $(Build.BinariesDirectory)
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Create release Python $(VERSION)'
|
||||
inputs:
|
||||
TargetType: inline
|
||||
script: |
|
||||
$tagName = "$(VERSION)-$(Build.BuildId)"
|
||||
$releaseBody = "Python $(VERSION)"
|
||||
./helpers/github/create-release.ps1 -RepositoryFullName "$(Build.Repository.Name)" `
|
||||
-AccessToken "$(GITHUB_TOKEN)" `
|
||||
-ToolVersion "$(VERSION)" `
|
||||
-TagName "$tagName" `
|
||||
-ReleaseBody "$releaseBody" `
|
||||
-EventType "$(EVENT_TYPE)"
|
||||
- task: GitHubRelease@1
|
||||
displayName: 'Upload release assets'
|
||||
inputs:
|
||||
gitHubConnection: 'Github Connection'
|
||||
action: edit
|
||||
tag: '$(VERSION)-$(Build.BuildId)'
|
||||
title: '$(VERSION)'
|
||||
releaseNotesSource: inline
|
||||
releaseNotesInline: '$(RELEASE_NOTES_CONTENT)'
|
||||
assets: '$(Build.BinariesDirectory)/*/*'
|
||||
assetUploadMode: replace
|
||||
addChangeLog: false
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Trigger "Create Pull Request" workflow'
|
||||
inputs:
|
||||
TargetType: inline
|
||||
script: |
|
||||
Import-Module (Join-Path (Get-Location).Path "github-api.psm1")
|
||||
$gitHubApi = Get-GitHubApi -RepositoryFullName "$(Build.Repository.Name)" -AccessToken "$(GITHUB_TOKEN)"
|
||||
$gitHubApi.CreateWorkflowDispatch("$(WORKFLOW_FILE_NAME)", "$(WORKFLOW_DISPATCH_REF)", "$(INPUTS)")
|
||||
workingDirectory: '$(Build.SourcesDirectory)/helpers/github'
|
Reference in New Issue
Block a user