Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build - ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: false

- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true

- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest' && !matrix.cross
run: |
sudo apt update
sudo apt install -y libglib2.0-dev libpolkit-gobject-1-dev libpolkit-agent-1-dev

- name: Install cross
if: matrix.cross
run: |
cargo install cross --git https://github.com/cross-rs/cross

- name: Build with cargo
if: "!matrix.cross"
run: cargo build --release --target ${{ matrix.target }}

- name: Build with cross
if: matrix.cross
run: cross build --release --target ${{ matrix.target }}

- name: Strip binary
run: |
strip target/${{ matrix.target }}/release/polkit-agent || true

- name: Create tarball
run: |
cd target/${{ matrix.target }}/release
tar czf polly-${{ github.ref_name }}-${{ matrix.target }}.tar.gz polkit-agent
mv polly-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ github.workspace }}/

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: polly-${{ matrix.target }}
path: polly-${{ github.ref_name }}-${{ matrix.target }}.tar.gz

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Prepare release assets
run: |
mkdir release-assets
find artifacts -type f -name '*.tar.gz' -exec cp {} release-assets/ \;
ls -lah release-assets/

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release-assets/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
/target

# AUR build artifacts
*.tar.gz
*.pkg.tar.zst
pkg/
src/

# Editor files
*.swp
*.swo
*~
.vscode/
.idea/

# OS files
.DS_Store
Thumbs.db
127 changes: 127 additions & 0 deletions AUR_INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# AUR Installation Guide

This document provides instructions for installing polly from the Arch User Repository (AUR).

## Available Packages

### polly
The stable release version of polly, tracking tagged releases.

```bash
# Using an AUR helper (e.g., yay, paru)
yay -S polly

# Or manually
git clone https://aur.archlinux.org/polly.git
cd polly
makepkg -si
```

### polly-git
The development version of polly, tracking the latest git commits.

```bash
# Using an AUR helper (e.g., yay, paru)
yay -S polly-git

# Or manually
git clone https://aur.archlinux.org/polly-git.git
cd polly-git
makepkg -si
```

## Manual Installation from PKGBUILD

If you want to build directly from this repository:

```bash
# For stable version
makepkg -p PKGBUILD-polly -si

# For git version
makepkg -p PKGBUILD-polly-git -si
```

## Dependencies

### Runtime Dependencies
- glib2
- polkit

### Build Dependencies
- rust
- cargo
- git (for polly-git)

## Running polly

After installation, you can run polly as your Polkit authentication agent.

### Option 1: Using systemd (recommended)

Enable and start the systemd user service:

```bash
systemctl --user enable --now polly.service
```

To disable autostart:
```bash
systemctl --user disable --now polly.service
```

### Option 2: Manual autostart

Add the following to your compositor's autostart configuration:

```bash
polly &
```

**Hyprland** (`~/.config/hypr/hyprland.conf`):
```
exec-once = polly
```

**Sway** (`~/.config/sway/config`):
```
exec polly
```

**River** (`~/.config/river/init`):
```
polly &
```

## Submitting to AUR

For maintainers wanting to submit these packages to AUR:

1. Create the AUR repository:
```bash
# For stable version
git clone ssh://aur@aur.archlinux.org/polly.git
cd polly
cp /path/to/polkit-agent/PKGBUILD-polly PKGBUILD

# Generate .SRCINFO
makepkg --printsrcinfo > .SRCINFO

# Commit and push
git add PKGBUILD .SRCINFO
git commit -m "Initial commit: polly v0.1.0"
git push
```

2. For polly-git, repeat the above steps with PKGBUILD-polly-git.

## Updating .SRCINFO

When updating the PKGBUILD, always regenerate .SRCINFO:

```bash
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO
git commit -m "Update to version X.Y.Z"
git push
```
135 changes: 135 additions & 0 deletions CHANGES_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Summary of Changes

This document summarizes the changes made to add AUR packaging and release workflow.

## New Files Added

### AUR Packaging Files
1. **PKGBUILD-polly** - PKGBUILD for stable releases
- Downloads source from GitHub release tags
- Builds and installs to `/usr/bin/polly`
- Includes systemd service installation

2. **PKGBUILD-polly-git** - PKGBUILD for git development version
- Clones from git repository
- Tracks latest commits
- Provides/conflicts with 'polly'

3. **polly.install** - Post-install script
- Displays helpful message about enabling the service
- Shows both systemd and manual startup options

4. **generate-srcinfo.sh** - Helper script
- Generates .SRCINFO files for both packages
- Makes AUR submission easier

### Release Automation
5. **.github/workflows/release.yml** - GitHub Actions workflow
- Triggered by version tags (v*)
- Builds for three architectures:
- x86_64-unknown-linux-gnu (standard glibc)
- x86_64-unknown-linux-musl (static musl)
- aarch64-unknown-linux-gnu (ARM64)
- Creates GitHub release with binaries
- Uses cross-compilation for musl and ARM targets

6. **Cross.toml** - Cross-compilation configuration
- Specifies build dependencies for cross targets
- Ensures polkit and glib are available during build

### System Integration
7. **polly.service** - systemd user service
- Enables auto-start with graphical session
- Includes restart on failure
- Part of graphical-session.target

### Documentation
8. **AUR_INSTALL.md** - Installation guide
- Instructions for installing from AUR
- How to enable/use the service
- Guide for AUR maintainers

9. **RELEASE.md** - Release process documentation
- Step-by-step release instructions
- How to update AUR packages
- Testing checklist

10. **PACKAGING.md** - Packaging overview
- Describes all packaging files
- Documents build targets
- Installation methods
- Maintenance procedures

## Modified Files

1. **Readme.md**
- Added installation section
- Links to AUR packages
- Mentions pre-built binaries
- Links to documentation

2. **.gitignore**
- Added AUR build artifacts (*.tar.gz, *.pkg.tar.zst)
- Added build directories (pkg/, src/)
- Added editor files (.vscode/, .idea/, *.swp)
- Added OS files (.DS_Store, Thumbs.db)

## How to Use

### For Users (Installing)

**Arch Linux:**
```bash
yay -S polly # Stable
yay -S polly-git # Development
```

**Other distributions:**
- Download binary from GitHub releases
- Build from source with cargo

### For Maintainers (Releasing)

1. Update version in Cargo.toml and PKGBUILD-polly
2. Commit and push changes
3. Create and push tag: `git tag -a v0.1.0 -m "Release v0.1.0"`
4. GitHub Actions automatically builds and releases
5. Update AUR package with new checksums

### For AUR Maintainers (Submitting)

```bash
# Clone AUR repo
git clone ssh://aur@aur.archlinux.org/polly.git

# Copy PKGBUILD
cp PKGBUILD-polly polly/PKGBUILD

# Generate .SRCINFO
cd polly
makepkg --printsrcinfo > .SRCINFO

# Commit and push
git add PKGBUILD .SRCINFO
git commit -m "Initial upload: polly 0.1.0"
git push
```

## Architecture Support

Official binaries are built for:
- x86_64 (Intel/AMD 64-bit) - glibc and musl variants
- aarch64 (ARM 64-bit)

## Dependencies

**Runtime:**
- glib2
- polkit

**Build:**
- rust
- cargo
- libglib2.0-dev
- libpolkit-gobject-1-dev
- libpolkit-agent-1-dev
Loading