Package Updater #5463
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Updater | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
inputs: | |
packages: | |
description: "What is the packages (optionally version) you wish to force update on?" | |
required: false | |
schedule: | |
- cron: "30 1-19/6 * * *" | |
jobs: | |
updater: | |
runs-on: windows-2019 | |
env: | |
au_version: master | |
au_push: true | |
github_user_repo: ${{ github.repository }} | |
github_api_key: ${{ secrets.GIST_API_KEY }} | |
gist_id: 747b3ede98c9404e5cb6a399595e7ad1 | |
nupkg_cache_path: C:\nupkg_cache | |
mail_user: ${{ secrets.MAIL_USER }} | |
mail_pass: ${{ secrets.MAIL_PASSWORD }} | |
mail_server: smtp.gmail.com | |
mail_port: 587 | |
mail_enablessl: true | |
api_key: ${{ secrets.CHOCO_API_KEY }} | |
nuget_artifacts: ${{ github.runner.temp }}/artifacts | |
VT_APIKEY: ${{ secrets.VT_APIKEY }} | |
steps: | |
- name: Configure git client | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Chocolatey" | |
git config --global core.safecrlf false | |
- name: Install Dependencies | |
run: | | |
Set-Service wuauserv -StartupType Manual | |
choco install wormies-au-helpers vt-cli -y | |
Install-Module Pester -RequiredVersion 4.10.1 -Scope CurrentUser -Force -SkipPublisherCheck | |
git clone -q https://github.com/chocolatey-community/chocolatey-au.git $Env:TEMP/au | |
. "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version | |
shell: powershell | |
- name: System information | |
run: | | |
Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version | |
$PSVersionTable | |
git --version | |
choco --version | |
"Build info" | |
' {0,-20} {1}' -f 'SCHEDULED BUILD:', ("${{ github.event_name }}" -eq 'schedule') | |
' {0,-20} {1}' -f 'FORCED BUILD:' , ("${{ github.event_name }}" -eq 'workflow_dispatch') | |
shell: powershell | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Run package updater | |
env: | |
FORCED_PACKAGES: ${{ github.event.inputs.packages }} | |
run: | | |
. ./scripts/EventLogs.ps1 | |
Clear-EventLogs | |
rm "$env:ChocolateyInstall\logs\*.log" | |
./update_all.ps1 -ForcedPackages $env:FORCED_PACKAGES | |
Get-EventLogs * | ? Source -eq 'Schannel' | fl * | out-file eventlogs.txt | |
shell: powershell | |
- name: Create diff file | |
run: | | |
git add automatic extension manual templates | |
git diff --cached > unsaved_changes.patch | |
- name: Create au temporary directory | |
run: | | |
if (Test-Path $Env:TEMP\chocolatey\au) { 7z a -mx9 au_temp.7z $Env:TEMP\chocolatey\au\* } | |
shell: powershell | |
- name: Upload artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: | | |
unsaved_changes.patch | |
au_temp.7z | |
update_info.xml | |
Update-AUPackages.md | |
eventlogs.txt | |
**/*.nupkg | |
retention-days: 5 |