Skip to content

chocolatey-beam/au-packages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

144 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chocolatey AU Packages

update-au-packages validate-powershell-scripts Update status

This repository contains Chocolatey packages managed with the AU (Automatic Updater) framework.

Packages

Automated Updates

A GitHub Actions workflow runs weekly to automatically check for new package versions and publish updates to chocolatey.org.

Local Development

Prerequisites

  • PowerShell 7+
  • AU Module: Install-Module AU -Scope CurrentUser
  • gh CLI for GitHub API access

Testing a Package

To test a package update locally:

cd rebar3
$au_Force = $true
.\update.ps1

This will:

  • Detect the latest version from GitHub
  • Download required files
  • Update package files
  • Pack the package
  • NOT push (unless $au_Push = $true)

Testing All Packages

To check all packages for updates:

$au_WhatIf = $false
$au_Push = $false
.\Update-Packages.ps1

Creating a New Package

  1. Create a directory for your package (e.g., mypackage/)
  2. Create mypackage.nuspec with package metadata
  3. Create tools/ directory with install/uninstall scripts
  4. Create update.ps1 with AU functions:
    • au_GetLatest - Detect latest version
    • au_SearchReplace - Define file updates
    • au_BeforeUpdate - Download files (optional)

See the rebar3 package for a complete example.

AU Framework

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

Key Functions

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
}

GitHub Actions

Validation Workflow

Runs on every push and pull request:

  • Validates PowerShell scripts with PSScriptAnalyzer
  • Ensures code quality and consistent formatting

Update Workflow

Runs weekly (Sunday 5:30 AM UTC):

  • Checks all packages for updates
  • Downloads new versions
  • Pushes to chocolatey.org automatically

Environment Variables

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 key
  • GITHUB_TOKEN - Automatically provided

Validation

Run PSScriptAnalyzer on all scripts:

.\Invoke-Validation.ps1

All scripts must pass validation before committing.

About

Chocolatey Auto-Update Packages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5