mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 07:06:54 +00:00
Enhance image genration template for Linux and Windows variants (#6519)
This commit is contained in:
@@ -4,16 +4,46 @@
|
|||||||
# - https://github.community/t5/GitHub-Actions/GitHub-Actions-Manual-Trigger-Approvals/td-p/31504
|
# - https://github.community/t5/GitHub-Actions/GitHub-Actions-Manual-Trigger-Approvals/td-p/31504
|
||||||
# - https://github.community/t5/GitHub-Actions/Protecting-github-workflows/td-p/30290
|
# - https://github.community/t5/GitHub-Actions/Protecting-github-workflows/td-p/30290
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- name: job_id
|
||||||
|
type: string
|
||||||
|
default: 'generate_image'
|
||||||
|
|
||||||
|
- name: image_type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: image_readme_name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: agent_pool
|
||||||
|
type: object
|
||||||
|
default:
|
||||||
|
name: 'ci-agent-pool'
|
||||||
|
|
||||||
|
- name: variable_group_name
|
||||||
|
type: string
|
||||||
|
default: 'Image Generation Variables'
|
||||||
|
|
||||||
|
- name: create_release
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
|
- name: repository_ref
|
||||||
|
type: string
|
||||||
|
default: 'self'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job:
|
- job: ${{ parameters.job_id }}
|
||||||
displayName: Image Generation (${{ parameters.image_type }})
|
displayName: Image Generation (${{ parameters.image_type }})
|
||||||
timeoutInMinutes: 600
|
timeoutInMinutes: 600
|
||||||
cancelTimeoutInMinutes: 30
|
cancelTimeoutInMinutes: 30
|
||||||
pool: ci-agent-pool
|
pool: ${{ parameters.agent_pool }}
|
||||||
variables:
|
variables:
|
||||||
- group: Image Generation Variables
|
- group: ${{ parameters.variable_group_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- checkout: ${{ parameters.repository_ref }}
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Download custom repository'
|
displayName: 'Download custom repository'
|
||||||
condition: and(ne(variables['CUSTOM_REPOSITORY_URL'], ''), ne(variables['CUSTOM_REPOSITORY_BRANCH'], ''))
|
condition: and(ne(variables['CUSTOM_REPOSITORY_URL'], ''), ne(variables['CUSTOM_REPOSITORY_BRANCH'], ''))
|
||||||
@@ -76,17 +106,18 @@ jobs:
|
|||||||
-PrefixToPathTrim "$(TemplateDirectoryPath)" `
|
-PrefixToPathTrim "$(TemplateDirectoryPath)" `
|
||||||
-PrintTopNLongest 25
|
-PrintTopNLongest 25
|
||||||
|
|
||||||
- task: PowerShell@2
|
- ${{ if eq(parameters.create_release, true) }}:
|
||||||
displayName: 'Create release for VM deployment'
|
- task: PowerShell@2
|
||||||
inputs:
|
displayName: 'Create release for VM deployment'
|
||||||
targetType: filePath
|
inputs:
|
||||||
filePath: ./images.CI/linux-and-win/create-release.ps1
|
targetType: filePath
|
||||||
arguments: -BuildId $(Build.BuildId) `
|
filePath: ./images.CI/linux-and-win/create-release.ps1
|
||||||
-Organization $(RELEASE_TARGET_ORGANIZATION) `
|
arguments: -BuildId $(Build.BuildId) `
|
||||||
-DefinitionId $(RELEASE_TARGET_DEFINITION_ID) `
|
-Organization $(RELEASE_TARGET_ORGANIZATION) `
|
||||||
-Project $(RELEASE_TARGET_PROJECT) `
|
-DefinitionId $(RELEASE_TARGET_DEFINITION_ID) `
|
||||||
-ImageName ${{ parameters.image_type }} `
|
-Project $(RELEASE_TARGET_PROJECT) `
|
||||||
-AccessToken $(RELEASE_TARGET_TOKEN)
|
-ImageName ${{ parameters.image_type }} `
|
||||||
|
-AccessToken $(RELEASE_TARGET_TOKEN)
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Clean up resources'
|
displayName: 'Clean up resources'
|
||||||
|
|||||||
Reference in New Issue
Block a user