PowerShell/.github/workflows/daily.yml
Aditya Patwardhan 7df0c1b0cc Fix yaml
2021-09-02 11:28:15 -07:00

63 lines
2 KiB
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: PowerShell Daily
on:
workflow_dispatch:
schedule:
# At 13:00 UTC every day.
- cron: '0 13 * * *'
defaults:
run:
shell: pwsh
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
jobs:
update-dotnet-preview:
name: Update .NET preview
timeout-minutes: 15
runs-on: windows-latest
if: github.repository == 'PowerShell/PowerShell'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Sync tags
run: |
git fetch --prune --unshallow --tags
- name: Execute Update .NET script
run: |
$currentVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
Write-Verbose "OLD_VERSION=$currentVersion" -Verbose
"OLD_VERSION=$currentVersion" | Out-File $env:GITHUB_ENV -Append
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging -UseInternalFeed
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
Write-Verbose "NEW_VERSION=$newVersion" -Verbose
"NEW_VERSION=$newVersion" | Out-File $env:GITHUB_ENV -Append
if ($currentVersion -ne $newVersion) {
Write-Verbose "CREATE_PR=true" -Verbose
"CREATE_PR=true" | Out-File $env:GITHUB_ENV -Append
}
- name: Microsoft Teams Notifier
uses: skitionek/notify-microsoft-teams@master
if: failure()
with:
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
overwrite: "{title: `Failure in updating .NET build. Look at ${workflow_link}`}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
if: env.CREATE_PR == 'true'
with:
commit-message: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`"
title: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`"
base: master
branch: dotnet_update