PPA Publishing Setup
This document explains how to set up and use the GitHub Actions workflow for publishing mise to Ubuntu PPAs (Personal Package Archives).
Prerequisites
- Launchpad Account: You need a Launchpad account with PPA access
- GPG Key: A GPG key for signing packages
- GitHub Repository Secrets: Required secrets configured in GitHub
Setting up Launchpad and PPA
- Create a Launchpad account at https://launchpad.net
- Create a new PPA for your project (e.g.,
ppa:jdxcode/mise
) - Generate and upload your GPG public key to Launchpad
GPG Key Setup
Generate a GPG key if you don't have one:
gpg --gen-key
Export your private key:
gpg --armor --export-secret-keys YOUR_EMAIL > private-key.asc
Export your public key and upload it to Launchpad:
gpg --armor --export YOUR_EMAIL > public-key.asc
GitHub Repository Configuration
Required Secrets
Configure the following secrets in your GitHub repository settings:
MISE_GPG_KEY
: Your GPG private key (entire content of private-key.asc)- This follows the same pattern as other mise workflows
Repository Variables
Configure these variables in your GitHub repository settings:
PPA_MAINTAINER_NAME
: Your name (e.g., "John Doe")PPA_MAINTAINER_EMAIL
: Your email address (must match GPG key)PPA_NAME
: Your PPA identifier (e.g., "ppa:jdxcode/mise")
Environment Protection
The workflow uses a ppa-publishing
environment for additional security. Configure this in your repository settings under Environments.
How the Workflow Works
The workflow follows the Rust PPA packaging guide and:
- Triggers: Runs on new GitHub releases or manual workflow dispatch
- Versioning: Uses
scripts/get-version.sh
to get the current version (same as other workflows) - Submodules: Includes the
aqua-registry
submodule in the source package - Vendoring: Uses
cargo vendor
to bundle all dependencies - Debian Packaging: Creates proper Debian source packages with:
debian/control
- Package metadatadebian/rules
- Build instructionsdebian/changelog
- Version historydebian/copyright
- License information
- Multi-distribution: Builds packages for multiple Ubuntu versions (jammy, noble)
- Signing: Signs packages with your GPG key using the same pattern as other workflows
- Upload: Uploads source packages to your PPA using
dput
Usage
Automatic Release Publishing
The workflow automatically triggers when you create a new GitHub release:
- Create a new release on GitHub
- The workflow will automatically package and upload to your PPA
- Monitor the Actions tab for progress
Manual Publishing
You can manually trigger the workflow via GitHub Actions:
- Go to the Actions tab in your repository
- Select "Publish to PPA" workflow
- Click "Run workflow"
- Specify the target distributions (optional)
- Optionally enable the "serious" profile for optimized builds with LTO
Supported Ubuntu Distributions
By default, the workflow targets:
- Ubuntu 22.04 LTS (jammy)
- Ubuntu 24.04 LTS (noble)
You can customize this by modifying the distributions
input when manually running the workflow.
Package Installation
Once published, users can install your package:
sudo add-apt-repository ppa:jdxcode/mise
sudo apt update
sudo apt install mise
Troubleshooting
Common Issues
GPG Signing Failures:
- Ensure your GPG private key is correctly stored in the
MISE_GPG_KEY
secret - The workflow uses the same GPG setup as other mise workflows
- Ensure your GPG private key is correctly stored in the
Build Failures:
- Verify all Rust dependencies can be vendored
- Check that the project builds successfully with
cargo build --release
Upload Failures:
- Confirm your PPA name is correct in variables
- Ensure your GPG public key is uploaded to Launchpad
Debugging
The workflow creates artifacts containing the generated source packages. Download these to inspect the generated Debian files if issues occur.
Security Considerations
- Store GPG private keys securely in GitHub Secrets
- Use environment protection rules for the
ppa-publishing
environment - Regularly rotate GPG keys and update secrets accordingly
- Monitor PPA uploads for unauthorized changes
Customization
To customize the packaging:
- Modify the
debian/control
generation in the workflow for different dependencies - Adjust the
debian/rules
section for custom build steps - Update the package description and metadata
- Add additional files like systemd services or configuration files
The workflow is designed to be generic enough for most Rust CLI tools but can be adapted for specific needs.