Check updates #1050
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: Check updates | |
on: | |
push: | |
branches: ["main"] | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: Check for updates | |
runs-on: windows-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false | |
DOTNET_MULTILEVEL_LOOKUP: 0 | |
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true | |
TERM: xterm | |
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
Configuration: Release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: "flcdrg/au-dotnet" | |
path: "autoupdate" | |
persist-credentials: false | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.200 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.nuget/packages | |
key: ${{ runner.os }}-dotnet-${{ hashFiles('autoupdate/AutoUpdate/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-dotnet- | |
- name: Restore | |
run: dotnet restore | |
working-directory: autoupdate | |
- name: Build | |
run: dotnet build --no-restore | |
working-directory: autoupdate | |
- name: Test | |
run: dotnet test | |
working-directory: autoupdate | |
- uses: actions/checkout@v4 | |
with: | |
repository: "flcdrg/chocolatey-au" | |
path: "chocolatey-au" | |
ref: "simplify" | |
persist-credentials: false | |
- name: Install | |
run: | | |
$module_name = 'Chocolatey-AU' | |
$module_dst = "$Env:ProgramFiles\PowerShell\Modules\$module_name" | |
New-Item -ItemType Directory "$module_dst" -ErrorAction Ignore | Out-Null | |
Copy-Item -Recurse -Force ./src/* $module_dst -Verbose | |
Get-InstalledModule | Select-Object Name, Version, InstalledLocation | |
choco install vt-cli chocolatey-community-validation.extension -y | |
shell: pwsh | |
working-directory: chocolatey-au | |
- uses: actions/checkout@v4 | |
with: | |
path: "packages" | |
- name: Configure Git | |
run: | | |
git config --global user.email ($context.repository_owner + '[email protected]') | |
git config --global user.name $context.repository_owner | |
git config --global core.safecrlf false | |
working-directory: packages | |
- name: Run update check | |
run: | | |
dotnet run | |
working-directory: autoupdate/AutoUpdate | |
env: | |
PACKAGES_REPO: "${{ github.workspace }}\\packages" | |
github_api_key: ${{ secrets.GH_TOKEN }} # GitHub API Key | |
api_key: ${{ secrets.CHOCO_TOKEN }} # Chocolatey API Key | |
VT_APIKEY: ${{ secrets.VT_APIKEY }} # VirusTotal API Key | |
GIST_ID: ${{ secrets.GIST_ID }} # Gist ID | |
- name: Status | |
run: | | |
git status | |
git push | |
git push -q --tags | |
git log --max-count 2 --pretty=medium | |
Get-ChildItem -Recurse *.nupkg | Select-Object -ExpandProperty FullName | |
working-directory: packages |