Skip to content
name: Update And Publish Chocolatey Package
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * *"
push:
jobs:
check-update:
name: Check update
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
token: ${{ secrets.UPDATER }}
- name: Install au
shell: pwsh
run: Install-Module au -Force
- name: Check for new update
shell: pwsh
run: |
cd .\flow-launcher\
.\update.ps1
- name: Publish & commit new update
env:
API_KEY: ${{ secrets.PUBLISH }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
git diff --exit-code
if ($LastExitCode -eq 1)
{
cd .\flow-launcher\
dir
pwd
echo "`nNew update exists"
ls
cat flow-launcher.1.18.0.nupkg
# echo "`nPublishing new update to Chocolatey"
# $response = Push-Package
echo "TODO CHECKING FAILED RESPONSES"
$response
$LastExitCode
$?
echo "TODO DONE"
# echo "`nCommiting to Git"
# git config --global user.email "[email protected]"
# git config --global user.name "choco_package_updater"
# git add .\flow-launcher.nuspec
# git add .\tools\chocolateyinstall.ps1
# git commit -m 'new chocolatey package update'
# git push
}elseif ($LastExitCode -eq 0)
{
echo "`nNo new updates"
}
- name: Keep cron job alive during inactivity
uses: gautamkrishnar/keepalive-workflow@v1