44 - cron : ' 0 3,15 * * *'
55 workflow_dispatch :
66
7- env :
8- TOOL_NAME : " Python"
9- defaults :
10- run :
11- shell : pwsh
12-
137jobs :
14- find_new_versions :
15- if : github.repository_owner == 'actions'
16- name : Find new versions
17- runs-on : ubuntu-latest
18- outputs :
19- versions_output : ${{ steps.Get_new_versions.outputs.TOOL_VERSIONS }}
20- steps :
21- - uses : actions/checkout@v3
22- with :
23- submodules : true
24-
25- - id : Get_new_versions
26- name : Get new versions
27- run : ./helpers/get-new-tool-versions/get-new-tool-versions.ps1 -ToolName ${{ env.TOOL_NAME }}
28-
29- check_new_versions :
30- name : Check new versions
31- runs-on : ubuntu-latest
32- needs : find_new_versions
33- env :
34- TOOL_VERSIONS : ${{needs.find_new_versions.outputs.versions_output}}
35- steps :
36- - uses : actions/checkout@v3
37- with :
38- submodules : true
39-
40- - name : Check Versions
41- if : env.TOOL_VERSIONS == ''
42- run : |
43- Write-Host "No new versions were found"
44- Import-Module "./helpers/github/github-api.psm1"
45- $gitHubApi = Get-GitHubApi -RepositoryFullName "$env:GITHUB_REPOSITORY" `
46- -AccessToken "${{ secrets.PERSONAL_TOKEN }}"
47- $gitHubApi.CancelWorkflow("$env:GITHUB_RUN_ID")
48- Start-Sleep -Seconds 60
49- - name : Send Slack notification
50- run : |
51- $pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
52- $message = "The following versions of '${{ env.TOOL_NAME }}' are available to upload: ${{ env.TOOL_VERSIONS }}\nLink to the pipeline: $pipelineUrl"
53- ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
54- -ToolName "${{ env.TOOL_NAME }}" `
55- -ImageUrl "https://avatars.githubusercontent.com/u/1525981?s=200&v=4" `
56- -Text "$message"
57-
58- trigger_builds :
59- name : Trigger builds
60- runs-on : ubuntu-latest
61- needs : [find_new_versions, check_new_versions]
62- env :
63- TOOL_VERSIONS : ${{needs.find_new_versions.outputs.versions_output}}
64- environment : Get Available Tools Versions - Publishing Approval
65- steps :
66- - uses : actions/checkout@v3
67- with :
68- submodules : true
69-
70- - name : Trigger "Build python packages" workflow
71- run :
72- ./helpers/github/run-ci-builds.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" `
73- -AccessToken "${{ secrets.PERSONAL_TOKEN }}" `
74- -WorkflowFileName "python-builder.yml" `
75- -WorkflowDispatchRef "main" `
76- -ToolVersions "${{ env.TOOL_VERSIONS }}" `
77- -PublishReleases "true"
78-
79- check_build :
80- name : Check build for failures
81- runs-on : ubuntu-latest
82- needs : [find_new_versions, check_new_versions, trigger_builds]
83- if : failure()
84- steps :
85- - uses : actions/checkout@v3
86- with :
87- submodules : true
88-
89- - name : Send Slack notification if build fails
90- run : |
91- $pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
92- $message = "The build of the '${{ env.TOOL_NAME }}' detection pipeline failed :progress-error:\nLink to the pipeline: $pipelineUrl"
93- ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
94- -ToolName "${{ env.TOOL_NAME }}" `
95- -Text "$message" `
96- -ImageUrl "https://avatars.githubusercontent.com/u/1525981?s=200&v=4"
8+ get-new-python-versions :
9+ uses : actions/versions-package-tools/.github/workflows/get-new-tool-versions.yml@main
10+ with :
11+ tool-name : " Python"
12+ image-url : " https://avatars.githubusercontent.com/u/1525981?s=200&v=4"
13+ secrets : inherit
0 commit comments