mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-11 12:06:44 +00:00
Adding pypy notifications and optimizing workflow and parsers (#42)
This commit is contained in:
86
.github/workflows/get-tools-new-versions.yml
vendored
86
.github/workflows/get-tools-new-versions.yml
vendored
@@ -9,74 +9,56 @@ defaults:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
find-new-xamarin-versions:
|
||||
name: Searching for new Xamarin versions
|
||||
find-new-tool-versions:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tool:
|
||||
- name: 'Xamarin'
|
||||
image: 'https://avatars.githubusercontent.com/u/790012?s=200&v=4'
|
||||
- name: 'Python'
|
||||
image: 'https://avatars.githubusercontent.com/u/1525981?s=200&v=4'
|
||||
- name: 'PyPy'
|
||||
image: 'https://avatars.githubusercontent.com/u/318667?s=200&v=4'
|
||||
name: 'Searching for new versions of ${{ matrix.tool.name }}'
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
versions-output: ${{ steps.get-new-xamarin-versions.outputs.versions-output }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: get-new-xamarin-versions
|
||||
name: Get new Xamarin versions
|
||||
run: echo "::set-output name=versions-output::$(./get-new-tool-versions/verify-new-tool-version-added-to-image.ps1 -ToolName Xamarin)"
|
||||
|
||||
check-new-xamarin-versions:
|
||||
name: Verifying new Xamarin versions exist
|
||||
runs-on: ubuntu-latest
|
||||
needs: find-new-xamarin-versions
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check Versions
|
||||
if: needs.find-new-xamarin-versions.outputs.versions-output == ''
|
||||
- id: get-new-tool-versions
|
||||
name: Get new tool versions
|
||||
run: echo "::set-output name=versions-output::$(./get-new-tool-versions/verify-new-tool-version-added-to-image.ps1 -ToolName ${{ matrix.tool.name }})"
|
||||
- name: Check versions
|
||||
if: steps.get-new-tool-versions.outputs.versions-output == ''
|
||||
run: Write-Host "No new versions found"
|
||||
- uses: ./.github/actions/send-slack-notification
|
||||
if: needs.find-new-xamarin-versions.outputs.versions-output != ''
|
||||
name: Send Slack notification
|
||||
if: steps.get-new-tool-versions.outputs.versions-output != ''
|
||||
with:
|
||||
url: ${{ secrets.SLACK_CHANNEL_URL }}
|
||||
tool-name: 'Xamarin'
|
||||
tool-version: ${{ needs.find-new-xamarin-versions.outputs.versions-output }}
|
||||
image-url: 'https://avatars.githubusercontent.com/u/790012?s=200&v=4'
|
||||
add-to-toolset-flag: '-AddToToolsetFlag'
|
||||
|
||||
find-new-python-versions:
|
||||
name: Searching for new Python versions
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
versions-output: ${{ steps.get-new-python-versions.outputs.versions-output }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: get-new-python-versions
|
||||
name: Get new Python versions
|
||||
run: echo "::set-output name=versions-output::$(./get-new-tool-versions/verify-new-tool-version-added-to-image.ps1 -ToolName Python)"
|
||||
|
||||
check-new-python-versions:
|
||||
name: Verifying new Python versions exist
|
||||
runs-on: ubuntu-latest
|
||||
needs: find-new-python-versions
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check Versions
|
||||
if: needs.find-new-python-versions.outputs.versions-output == ''
|
||||
run: Write-Host "No new versions found"
|
||||
- uses: ./.github/actions/send-slack-notification
|
||||
if: needs.find-new-python-versions.outputs.versions-output != ''
|
||||
with:
|
||||
url: ${{ secrets.SLACK_CHANNEL_URL }}
|
||||
tool-name: 'Python'
|
||||
tool-version: ${{ needs.find-new-python-versions.outputs.versions-output }}
|
||||
image-url: 'https://www.python.org/static/community_logos/python-powered-h-100x130.png'
|
||||
tool-name: '${{ matrix.tool.name }}'
|
||||
tool-version: ${{ steps.get-new-tool-versions.outputs.versions-output }}
|
||||
image-url: '${{ matrix.tool.image }}'
|
||||
add-to-toolset-flag: '-AddToToolsetFlag'
|
||||
|
||||
check_build:
|
||||
name: Check build for failures
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-new-xamarin-versions, check-new-python-versions]
|
||||
needs: [find-new-tool-versions]
|
||||
if: failure()
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: get-failed-jobs
|
||||
name: Get failed jobs
|
||||
run: |
|
||||
$jobs_url = "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/jobs"
|
||||
$failedJobs = (Invoke-RestMethod -Uri $jobs_url).jobs |
|
||||
Where-Object conclusion -eq "failure" |
|
||||
ForEach-Object {"\n\t" + $_.name.split(" ")[-1] + ": $($_.html_url)"}
|
||||
echo "::set-output name=failed-jobs::$failedJobs"
|
||||
- uses: ./.github/actions/send-slack-notification
|
||||
name: Send Slack notification about failure
|
||||
with:
|
||||
url: ${{ secrets.SLACK_CHANNEL_URL }}
|
||||
tool-name: 'Python or Xamarin'
|
||||
tool-name: 'Tool name'
|
||||
pipeline-url: '$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID'
|
||||
text: "The build of the Xamarin or Python detection pipeline has failed stages:"
|
||||
text: "Missing toolset tool versions checker pipeline has failed jobs:/n/t${{ steps.get-failed-jobs.outputs.failed-jobs }}"
|
||||
Reference in New Issue
Block a user