2020-05-22 03:47:54 +02:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# Licensed under the MIT license.
|
|
|
|
|
|
|
|
name: PowerShell Daily
|
|
|
|
on:
|
2021-02-05 20:33:35 +01:00
|
|
|
workflow_dispatch:
|
2020-05-22 03:47:54 +02:00
|
|
|
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
|
2020-05-22 18:54:29 +02:00
|
|
|
if: github.repository == 'PowerShell/PowerShell'
|
2020-05-22 03:47:54 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Sync tags
|
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow --tags
|
|
|
|
- name: Execute Update .NET script
|
|
|
|
run: |
|
2021-11-03 17:52:13 +01:00
|
|
|
Import-Module ./.github/workflows/GHWorkflowHelper
|
2020-05-22 03:47:54 +02:00
|
|
|
$currentVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
2021-10-30 01:29:40 +02:00
|
|
|
Set-GWVariable -Name OLD_VERSION -Value $currentVersion
|
2020-05-22 03:47:54 +02:00
|
|
|
|
2021-09-04 00:18:50 +02:00
|
|
|
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging -UseInternalFeed
|
2020-05-22 03:47:54 +02:00
|
|
|
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
2021-10-30 01:29:40 +02:00
|
|
|
Set-GWVariable -Name NEW_VERSION -Value $newVersion
|
2020-05-22 03:47:54 +02:00
|
|
|
|
|
|
|
if ($currentVersion -ne $newVersion) {
|
2021-10-30 01:29:40 +02:00
|
|
|
Set-GWVariable -Name CREATE_PR -Value 'true'
|
2020-05-22 03:47:54 +02:00
|
|
|
}
|
2021-08-24 19:20:49 +02:00
|
|
|
- name: Microsoft Teams Notifier
|
|
|
|
uses: skitionek/notify-microsoft-teams@master
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
|
2021-09-04 00:18:50 +02:00
|
|
|
overwrite: "{title: `Failure in updating .NET build. Look at ${workflow_link}`}"
|
2020-05-22 03:47:54 +02:00
|
|
|
- name: Create Pull Request
|
2021-09-04 00:18:50 +02:00
|
|
|
uses: peter-evans/create-pull-request@v3
|
2020-05-22 03:47:54 +02:00
|
|
|
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
|
2021-10-30 01:29:40 +02:00
|
|
|
update-tpn:
|
|
|
|
name: Update Notices File
|
|
|
|
timeout-minutes: 15
|
|
|
|
runs-on: windows-latest
|
|
|
|
if: github.repository == 'PowerShell/PowerShell'
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Update Notices file
|
|
|
|
run: |
|
|
|
|
Invoke-WebRequest -Uri https://aka.ms/pwsh-daily-tpn -OutFile ./ThirdPartyNotices.txt
|
2021-11-03 17:52:13 +01:00
|
|
|
- name: Capture Git Status
|
|
|
|
run: |
|
|
|
|
git status --short
|
|
|
|
- name: Check if we need to create a PR
|
|
|
|
run: |
|
2021-11-10 22:09:28 +01:00
|
|
|
$ErrorActionPreference = 'continue'
|
2021-11-03 17:52:13 +01:00
|
|
|
git diff --quiet ThirdPartyNotices.txt
|
|
|
|
$exitCode = $LASTEXITCODE
|
|
|
|
Write-Verbose -Message "Exit code: $exitCode" -Verbose
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
2021-11-10 22:09:28 +01:00
|
|
|
Import-Module ./.github/workflows/GHWorkflowHelper
|
2021-11-03 17:52:13 +01:00
|
|
|
Set-GWVariable -Name CREATE_PR -Value 'true'
|
|
|
|
} else {
|
|
|
|
Write-Verbose "No difference found. Not creating a PR." -Verbose
|
|
|
|
}
|
2021-11-10 22:09:28 +01:00
|
|
|
exit 0
|
2021-10-30 01:29:40 +02:00
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
id: cprtpn
|
2021-11-03 17:52:13 +01:00
|
|
|
if: env.CREATE_PR == 'true'
|
2021-10-30 01:29:40 +02:00
|
|
|
with:
|
2021-11-01 18:25:39 +01:00
|
|
|
commit-message: "Update to the latest notice file"
|
2021-10-30 01:29:40 +02:00
|
|
|
committer: GitHub <noreply@github.com>
|
|
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
2021-11-01 18:25:39 +01:00
|
|
|
title: "Update to the latest notice file"
|
2021-10-30 01:29:40 +02:00
|
|
|
reviewers: travisez13
|
|
|
|
base: master
|
|
|
|
draft: false
|
|
|
|
branch: update-cgmanifest
|