mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
155 lines
5.3 KiB
YAML
155 lines
5.3 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
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
update-dotnet-preview:
|
|
permissions:
|
|
contents: write # for peter-evans/create-pull-request to create branch
|
|
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
|
name: Update .NET preview
|
|
timeout-minutes: 15
|
|
runs-on: windows-latest
|
|
if: github.repository == 'PowerShell/PowerShell'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Sync tags
|
|
run: |
|
|
git fetch --prune --unshallow --tags
|
|
- name: Execute Update .NET script
|
|
run: |
|
|
Import-Module ./.github/workflows/GHWorkflowHelper
|
|
$currentVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
|
Set-GWVariable -Name OLD_VERSION -Value $currentVersion
|
|
|
|
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging
|
|
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
|
Set-GWVariable -Name NEW_VERSION -Value $newVersion
|
|
|
|
if ($currentVersion -ne $newVersion) {
|
|
Set-GWVariable -Name CREATE_PR -Value 'true'
|
|
}
|
|
- name: Microsoft Teams Notifier
|
|
uses: skitionek/notify-microsoft-teams@master
|
|
if: failure()
|
|
with:
|
|
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
|
|
overwrite: "{title: `Failure in .github/daily.yml updating .NET build. Look at ${workflow_link}`}"
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v4
|
|
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
|
|
update-tpn:
|
|
permissions:
|
|
contents: write # for peter-evans/create-pull-request to create branch
|
|
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
|
name: Update Notices File
|
|
timeout-minutes: 15
|
|
runs-on: windows-latest
|
|
if: github.repository == 'PowerShell/PowerShell'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Update Notices file
|
|
run: |
|
|
Invoke-WebRequest -Uri https://aka.ms/pwsh-daily-tpn -OutFile ./ThirdPartyNotices.txt
|
|
- name: Capture Git Status
|
|
run: |
|
|
git status --short
|
|
- name: Check if we need to create a PR
|
|
run: |
|
|
$ErrorActionPreference = 'continue'
|
|
git diff --quiet ThirdPartyNotices.txt
|
|
$exitCode = $LASTEXITCODE
|
|
Write-Verbose -Message "Exit code: $exitCode" -Verbose
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Import-Module ./.github/workflows/GHWorkflowHelper
|
|
Set-GWVariable -Name CREATE_PR -Value 'true'
|
|
} else {
|
|
Write-Verbose "No difference found. Not creating a PR." -Verbose
|
|
}
|
|
exit 0
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v4
|
|
id: cprtpn
|
|
if: env.CREATE_PR == 'true'
|
|
with:
|
|
commit-message: "Update to the latest NOTICES file"
|
|
committer: GitHub <noreply@github.com>
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
title: "Update to the latest NOTICES file"
|
|
reviewers: travisez13
|
|
base: master
|
|
draft: false
|
|
branch: update-cgmanifest
|
|
update-cgmanifest:
|
|
permissions:
|
|
contents: write # for peter-evans/create-pull-request to create branch
|
|
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
|
name: Update cgmanifest
|
|
timeout-minutes: 15
|
|
runs-on: windows-latest
|
|
if: github.repository == 'PowerShell/PowerShell'
|
|
env:
|
|
CGMANIFEST_PATH: ''
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Sync tags
|
|
run: |
|
|
git fetch --prune --unshallow --tags
|
|
- name: Install Ships provider to deal with project.assets.json
|
|
run: |
|
|
Install-Module -Name dotnet.project.assets -force
|
|
- name: Bootstrap
|
|
run: |
|
|
Import-Module ./build.psm1
|
|
Start-PSBootStrap
|
|
- name: Verify cgmanifest is up to date
|
|
run: |
|
|
Import-Module ./build.psm1
|
|
Find-Dotnet
|
|
./tools/findMissingNotices.ps1 -Fix
|
|
- name: Upload cgmanifest
|
|
uses: actions/upload-artifact@v3
|
|
if: always() && env.CGMANIFEST_PATH != ''
|
|
with:
|
|
name: cgmanifest
|
|
path: ${{ env.CGMANIFEST_PATH }}
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v4
|
|
id: cprcgmanifest
|
|
if: env.CGMANIFEST_PATH != ''
|
|
with:
|
|
commit-message: "Update the cgmanifest"
|
|
committer: GitHub <noreply@github.com>
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
title: "Update the cgmanifest"
|
|
reviewers: travisez13
|
|
base: master
|
|
draft: false
|
|
branch: update-cgmanifest
|