Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/GHWorkflowHelper/GHWorkflowHelper.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

function Set-GWVariable {
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$Value
)

Write-Verbose "Setting CI variable $Name to $Value" -Verbose

if ($env:GITHUB_ENV) {
"$Name=$Value" | Out-File $env:GITHUB_ENV -Append
}
}

function Get-GWTempPath {
$temp = [System.IO.Path]::GetTempPath()
if ($env:RUNNER_TEMP) {
$temp = $env:RUNNER_TEMP
}

Write-Verbose "Get CI Temp path: $temp" -Verbose
return $temp
}
35 changes: 27 additions & 8 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ jobs:
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
Write-Verbose "OLD_VERSION=$currentVersion" -Verbose
"OLD_VERSION=$currentVersion" | Out-File $env:GITHUB_ENV -Append
Set-GWVariable -Name OLD_VERSION -Value $currentVersion

./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
Set-GWVariable -Name NEW_VERSION -Value $newVersion

if ($currentVersion -ne $newVersion) {
Write-Verbose "CREATE_PR=true" -Verbose
"CREATE_PR=true" | Out-File $env:GITHUB_ENV -Append
Set-GWVariable -Name CREATE_PR -Value 'true'
}
- name: Microsoft Teams Notifier
uses: skitionek/notify-microsoft-teams@master
Expand All @@ -58,5 +56,26 @@ jobs:
title: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`"
base: master
branch: dotnet_update


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
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cprtpn
with:
commit-message: "Update to the latest license and the cgmanifest with missing or updated components"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: "Update to the latest license and the cgmanifest with missing or updated components"
reviewers: travisez13
base: master
draft: false
branch: update-cgmanifest
43 changes: 18 additions & 25 deletions .github/workflows/update-cgmanifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
name: Update cgmanifest
on:
workflow_dispatch:
schedule:
# At 13:00 UTC every day.
- cron: '0 13 * * *'
pull_request:
branches:
- master

defaults:
run:
Expand All @@ -15,6 +15,8 @@ defaults:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
CGMANIFEST_PATH: ''
NUGET_PACKAGES: ${{ github.workspace }}\.nuget\packages

jobs:
update-cgmanifest:
Expand All @@ -25,6 +27,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache DotNet
uses: actions/cache@v2
with:
path: |
~\AppData\Local\Microsoft\dotnet
${{ github.workspace }}\.nuget\packages
key: ${{ runner.os }}-${{ hashFiles('**\DotnetRuntimeMetadata.json') }}-${{ hashFiles('**\nuget.config') }}
- name: Sync tags
run: |
git fetch --prune --unshallow --tags
Expand All @@ -35,30 +44,14 @@ jobs:
run: |
Import-Module ./build.psm1
Start-PSBootStrap
- name: Update Notices file
run: |
Invoke-WebRequest -Uri https://aka.ms/pwsh-daily-tpn -OutFile ./ThirdPartyNotices.txt
- name: Execute script to update cgmanifest
- name: Verify cgmanifest is up to date
run: |
Import-Module ./build.psm1
Find-Dotnet
./tools/findMissingNotices.ps1
- 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 cgmanifest. Look at ${workflow_link}`}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
- name: Upload cgmanifest
uses: actions/upload-artifact@v2
if: always() && env.CGMANIFEST_PATH != ''
with:
commit-message: "Update to the latest license and the cgmanifest with missing or updated components"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: "Update to the latest license and the cgmanifest with missing or updated components"
reviewers: travisez13
base: master
draft: false
branch: update-cgmanifest
name: cgmanifest
path: ${{ env.CGMANIFEST_PATH }}
Loading