This repository contains Chocolatey packages managed with the AU (Automatic Updater) framework.
- rebar3 - Erlang build tool
A GitHub Actions workflow runs weekly to automatically check for new package versions and publish updates to chocolatey.org.
To test a package update locally:
cd rebar3
$au_Force = $true
.\update.ps1This will:
- Detect the latest version from GitHub
- Download required files
- Update package files
- Pack the package
- NOT push (unless
$au_Push = $true)
To check all packages for updates:
$au_WhatIf = $false
$au_Push = $false
.\Update-Packages.ps1- Create a directory for your package (e.g.,
mypackage/) - Create
mypackage.nuspecwith package metadata - Create
tools/directory with install/uninstall scripts - Create
update.ps1with AU functions:au_GetLatest- Detect latest versionau_SearchReplace- Define file updatesau_BeforeUpdate- Download files (optional)
See the rebar3 package for a complete example.
The AU framework automates:
- Version detection from upstream sources
- File downloads and checksum calculation
- Package file updates via regex
- Packing and pushing to chocolatey.org
- Retry logic for transient failures
au_GetLatest - Returns hashtable with version info:
function global:au_GetLatest {
return @{
Version = $version
URL64 = $downloadUrl
}
}au_SearchReplace - Defines regex replacements:
function global:au_SearchReplace {
@{
".\tools\install.ps1" = @{
"(version\s*=\s*)('.*')" = "`$1'$($Latest.Version)'"
}
}
}au_BeforeUpdate - Pre-update actions:
function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -NoSuffix
}Runs on every push and pull request:
- Validates PowerShell scripts with PSScriptAnalyzer
- Ensures code quality and consistent formatting
Runs weekly (Sunday 5:30 AM UTC):
- Checks all packages for updates
- Downloads new versions
- Pushes to chocolatey.org automatically
For local testing, create update_vars.ps1 (not tracked in git):
$Env:au_Push = 'false'
$Env:api_key = 'your-chocolatey-api-key'
$Env:github_api_key = 'your-github-token'For GitHub Actions, set secrets:
CHOCOLATEY_API_KEY- Your Chocolatey API keyGITHUB_TOKEN- Automatically provided
Run PSScriptAnalyzer on all scripts:
.\Invoke-Validation.ps1All scripts must pass validation before committing.