From 992dd5eb1266d67ec863bf31b8e581f4b1f686a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 01:42:30 +0000 Subject: [PATCH 1/6] Initial plan From 5e96b4ca5361bf5fefdbbb8de3307e3fefe33c09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 01:44:49 +0000 Subject: [PATCH 2/6] Add GitHub Action workflow for AUR deployment and release creation Co-authored-by: mklan <5452972+mklan@users.noreply.github.com> --- .github/DEPLOYMENT.md | 104 +++++++++++++++++++++++++ .github/workflows/deploy.yml | 146 +++++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+) create mode 100644 .github/DEPLOYMENT.md create mode 100644 .github/workflows/deploy.yml diff --git a/.github/DEPLOYMENT.md b/.github/DEPLOYMENT.md new file mode 100644 index 0000000..c5c087c --- /dev/null +++ b/.github/DEPLOYMENT.md @@ -0,0 +1,104 @@ +# Deployment Guide + +This repository includes a GitHub Actions workflow for automated deployment to AUR and creating GitHub releases. + +## Workflow: Deploy to AUR and Create Release + +### Location +`.github/workflows/deploy.yml` + +### Purpose +This workflow automates the process of: +1. Bumping the version in the `hyproled` script +2. Creating a Git tag +3. Creating a GitHub release +4. Deploying the update to the AUR (Arch User Repository) + +### How to Use + +1. Go to the **Actions** tab in the GitHub repository +2. Select the **Deploy to AUR and Create Release** workflow +3. Click **Run workflow** +4. Choose the version bump type: + - **patch**: Increment the patch version (0.1.3 → 0.1.4) + - **minor**: Increment the minor version (0.1.3 → 0.2.0) + - **major**: Increment the major version (0.1.3 → 1.0.0) +5. Click **Run workflow** to start the deployment + +### Required Secrets + +For the workflow to function properly, you need to configure the following secret in your GitHub repository: + +#### AUR_SSH_KEY + +This is the SSH private key used to authenticate with the AUR repository. + +**Setup Instructions:** + +1. Generate an SSH key pair (if you don't have one): + ```bash + ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/aur + ``` + +2. Add the public key to your AUR account: + - Log in to https://aur.archlinux.org + - Go to **My Account** → **SSH Public Keys** + - Add the contents of `~/.ssh/aur.pub` + +3. Add the private key as a GitHub secret: + - Go to your repository's **Settings** → **Secrets and variables** → **Actions** + - Click **New repository secret** + - Name: `AUR_SSH_KEY` + - Value: Paste the contents of `~/.ssh/aur` (the private key) + +### What the Workflow Does + +1. **Version Bump**: Updates the version number in the `hyproled` script based on your selection +2. **Git Tag**: Creates and pushes a new Git tag (e.g., `v0.1.4`) +3. **GitHub Release**: Creates a new GitHub release with: + - Release notes + - Installation instructions + - Links to AUR package +4. **AUR Deployment**: + - Clones the AUR repository + - Updates the `PKGBUILD` file (increments `pkgrel`) + - Updates `.SRCINFO` + - Pushes changes to AUR + +### Manual Deployment (Alternative) + +If you prefer to deploy manually: + +1. Update version in `hyproled`: + ```bash + sed -i 's/version: 0.1.3/version: 0.1.4/' hyproled + git commit -am "Bump version to 0.1.4" + git tag -a v0.1.4 -m "Release v0.1.4" + git push && git push --tags + ``` + +2. Create GitHub release through the web interface + +3. Deploy to AUR: + ```bash + git clone ssh://aur@aur.archlinux.org/hyproled-git.git + cd hyproled-git + # Update PKGBUILD + makepkg --printsrcinfo > .SRCINFO + git add PKGBUILD .SRCINFO + git commit -m "Update to version 0.1.4" + git push + ``` + +### Troubleshooting + +- **Workflow fails at AUR deployment**: Make sure the `AUR_SSH_KEY` secret is correctly configured +- **Version not updating**: Check that the version format in `hyproled` follows `version: X.Y.Z` +- **Push fails**: Ensure the GitHub Actions bot has permission to push to the repository (this should be enabled by default) + +### Notes + +- The workflow uses `workflow_dispatch`, meaning it only runs when manually triggered +- The AUR package is `hyproled-git`, which tracks the Git repository +- For `-git` AUR packages, we increment `pkgrel` rather than changing `pkgver` +- The workflow requires `makepkg` to be available for generating `.SRCINFO` diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fe247a5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,146 @@ +name: Deploy to AUR and Create Release + +on: + workflow_dispatch: + inputs: + version_bump: + description: 'Version bump type' + required: true + type: choice + options: + - patch + - minor + - major + default: 'patch' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Get current version + id: get_version + run: | + CURRENT_VERSION=$(grep -oP 'version: \K[0-9]+\.[0-9]+\.[0-9]+' hyproled) + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + echo "Current version: $CURRENT_VERSION" + + - name: Calculate new version + id: calc_version + run: | + VERSION="${{ steps.get_version.outputs.current_version }}" + IFS='.' read -r major minor patch <<< "$VERSION" + + case "${{ github.event.inputs.version_bump }}" in + major) + major=$((major + 1)) + minor=0 + patch=0 + ;; + minor) + minor=$((minor + 1)) + patch=0 + ;; + patch) + patch=$((patch + 1)) + ;; + esac + + NEW_VERSION="${major}.${minor}.${patch}" + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + echo "New version: $NEW_VERSION" + + - name: Update version in hyproled script + run: | + sed -i "s/version: [0-9]\+\.[0-9]\+\.[0-9]\+/version: ${{ steps.calc_version.outputs.new_version }}/" hyproled + git add hyproled + git commit -m "Bump version to ${{ steps.calc_version.outputs.new_version }}" + git push + + - name: Create Git tag + run: | + git tag -a "v${{ steps.calc_version.outputs.new_version }}" -m "Release v${{ steps.calc_version.outputs.new_version }}" + git push origin "v${{ steps.calc_version.outputs.new_version }}" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.calc_version.outputs.new_version }} + name: Release v${{ steps.calc_version.outputs.new_version }} + body: | + ## Release v${{ steps.calc_version.outputs.new_version }} + + ### Changes + This is a ${{ github.event.inputs.version_bump }} version release. + + ### Installation + + #### AUR (Arch Linux) + ```bash + yay -S hyproled-git + ``` + + #### Manual Installation + ```bash + sudo cp hyproled /usr/bin/hyproled + ``` + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy to AUR + if: ${{ secrets.AUR_SSH_KEY != '' }} + env: + AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} + run: | + # Setup SSH for AUR + mkdir -p ~/.ssh + echo "$AUR_SSH_KEY" > ~/.ssh/aur + chmod 600 ~/.ssh/aur + + # Configure SSH to use the key for AUR + cat >> ~/.ssh/config < .SRCINFO + + # Commit and push to AUR + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add PKGBUILD .SRCINFO + git commit -m "Update to version ${{ steps.calc_version.outputs.new_version }}" || echo "No changes to commit" + git push + else + echo "Warning: Could not clone AUR repository. Skipping AUR deployment." + exit 0 + fi From b406529870da5b8ea58097bd47134d7224b634cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 01:45:08 +0000 Subject: [PATCH 3/6] Update README with deployment information Co-authored-by: mklan <5452972+mklan@users.noreply.github.com> --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5565d45..d0d70fd 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,15 @@ function handle { socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done ``` +## Development & Deployment + +For maintainers: This repository includes an automated deployment workflow for releasing new versions. + +See [`.github/DEPLOYMENT.md`](.github/DEPLOYMENT.md) for detailed instructions on: +- Using the GitHub Actions workflow to create releases +- Deploying to AUR (Arch User Repository) +- Setting up required secrets and permissions + ## Backlog - Multiple areas From 69f7aac5c2caa8ac228c3747c4b2940e6666aab0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 01:47:04 +0000 Subject: [PATCH 4/6] Fix workflow issues: secret check, SSH security, and makepkg installation Co-authored-by: mklan <5452972+mklan@users.noreply.github.com> --- .github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fe247a5..612dd20 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -100,21 +100,52 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to AUR - if: ${{ secrets.AUR_SSH_KEY != '' }} + if: secrets.AUR_SSH_KEY != '' env: AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} run: | + # Install required packages for AUR deployment + sudo apt-get update -qq + sudo apt-get install -y pacman-package-manager || { + # If pacman-package-manager is not available, install minimal makepkg dependencies + echo "Installing makepkg dependencies..." + # Create a minimal makepkg wrapper + sudo mkdir -p /usr/local/bin + cat << 'MAKEPKG_SCRIPT' | sudo tee /usr/local/bin/makepkg > /dev/null + #!/bin/bash + # Minimal makepkg --printsrcinfo implementation for CI + if [[ "$1" == "--printsrcinfo" ]]; then + source PKGBUILD + echo "pkgbase = ${pkgbase:-$pkgname}" + echo " pkgdesc = $pkgdesc" + echo " pkgver = $pkgver" + echo " pkgrel = $pkgrel" + echo " url = $url" + echo " arch = ${arch[@]}" + [[ -n "$license" ]] && echo " license = ${license[@]}" + [[ -n "$depends" ]] && for dep in "${depends[@]}"; do echo " depends = $dep"; done + [[ -n "$makedepends" ]] && for dep in "${makedepends[@]}"; do echo " makedepends = $dep"; done + [[ -n "$source" ]] && for src in "${source[@]}"; do echo " source = $src"; done + echo "" + echo "pkgname = ${pkgname}" + fi + MAKEPKG_SCRIPT + sudo chmod +x /usr/local/bin/makepkg + } + # Setup SSH for AUR mkdir -p ~/.ssh echo "$AUR_SSH_KEY" > ~/.ssh/aur chmod 600 ~/.ssh/aur + # Add AUR host key to known_hosts for security + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null + # Configure SSH to use the key for AUR cat >> ~/.ssh/config < Date: Sat, 31 Jan 2026 01:49:08 +0000 Subject: [PATCH 5/6] Improve workflow robustness and update documentation examples Co-authored-by: mklan <5452972+mklan@users.noreply.github.com> --- .github/DEPLOYMENT.md | 19 ++++++++++--------- .github/workflows/deploy.yml | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/DEPLOYMENT.md b/.github/DEPLOYMENT.md index c5c087c..49819fd 100644 --- a/.github/DEPLOYMENT.md +++ b/.github/DEPLOYMENT.md @@ -20,9 +20,9 @@ This workflow automates the process of: 2. Select the **Deploy to AUR and Create Release** workflow 3. Click **Run workflow** 4. Choose the version bump type: - - **patch**: Increment the patch version (0.1.3 → 0.1.4) - - **minor**: Increment the minor version (0.1.3 → 0.2.0) - - **major**: Increment the major version (0.1.3 → 1.0.0) + - **patch**: Increment the patch version (e.g., X.Y.Z → X.Y.Z+1) + - **minor**: Increment the minor version (e.g., X.Y.Z → X.Y+1.0) + - **major**: Increment the major version (e.g., X.Y.Z → X+1.0.0) 5. Click **Run workflow** to start the deployment ### Required Secrets @@ -54,7 +54,7 @@ This is the SSH private key used to authenticate with the AUR repository. ### What the Workflow Does 1. **Version Bump**: Updates the version number in the `hyproled` script based on your selection -2. **Git Tag**: Creates and pushes a new Git tag (e.g., `v0.1.4`) +2. **Git Tag**: Creates and pushes a new Git tag (e.g., `vX.Y.Z`) 3. **GitHub Release**: Creates a new GitHub release with: - Release notes - Installation instructions @@ -71,9 +71,10 @@ If you prefer to deploy manually: 1. Update version in `hyproled`: ```bash - sed -i 's/version: 0.1.3/version: 0.1.4/' hyproled - git commit -am "Bump version to 0.1.4" - git tag -a v0.1.4 -m "Release v0.1.4" + # Example: update the version line in the script + sed -i 's/version: X.Y.Z/version: X.Y.ZNEW/' hyproled + git commit -am "Bump version to X.Y.ZNEW" + git tag -a vX.Y.ZNEW -m "Release vX.Y.ZNEW" git push && git push --tags ``` @@ -83,10 +84,10 @@ If you prefer to deploy manually: ```bash git clone ssh://aur@aur.archlinux.org/hyproled-git.git cd hyproled-git - # Update PKGBUILD + # Update PKGBUILD (increment pkgrel) makepkg --printsrcinfo > .SRCINFO git add PKGBUILD .SRCINFO - git commit -m "Update to version 0.1.4" + git commit -m "Update to version X.Y.ZNEW" git push ``` diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 612dd20..8f506b1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -100,20 +100,17 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to AUR - if: secrets.AUR_SSH_KEY != '' + if: secrets.AUR_SSH_KEY env: AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} run: | - # Install required packages for AUR deployment - sudo apt-get update -qq - sudo apt-get install -y pacman-package-manager || { - # If pacman-package-manager is not available, install minimal makepkg dependencies - echo "Installing makepkg dependencies..." - # Create a minimal makepkg wrapper - sudo mkdir -p /usr/local/bin - cat << 'MAKEPKG_SCRIPT' | sudo tee /usr/local/bin/makepkg > /dev/null + # Install minimal makepkg wrapper for .SRCINFO generation + echo "Installing makepkg wrapper..." + sudo mkdir -p /usr/local/bin + cat << 'MAKEPKG_SCRIPT' | sudo tee /usr/local/bin/makepkg > /dev/null #!/bin/bash # Minimal makepkg --printsrcinfo implementation for CI + # Note: This sources PKGBUILD which is necessary but should only be used with trusted PKGBUILDs if [[ "$1" == "--printsrcinfo" ]]; then source PKGBUILD echo "pkgbase = ${pkgbase:-$pkgname}" @@ -121,8 +118,8 @@ jobs: echo " pkgver = $pkgver" echo " pkgrel = $pkgrel" echo " url = $url" - echo " arch = ${arch[@]}" - [[ -n "$license" ]] && echo " license = ${license[@]}" + [[ -n "$arch" ]] && for a in "${arch[@]}"; do echo " arch = $a"; done + [[ -n "$license" ]] && for l in "${license[@]}"; do echo " license = $l"; done [[ -n "$depends" ]] && for dep in "${depends[@]}"; do echo " depends = $dep"; done [[ -n "$makedepends" ]] && for dep in "${makedepends[@]}"; do echo " makedepends = $dep"; done [[ -n "$source" ]] && for src in "${source[@]}"; do echo " source = $src"; done @@ -130,12 +127,11 @@ jobs: echo "pkgname = ${pkgname}" fi MAKEPKG_SCRIPT - sudo chmod +x /usr/local/bin/makepkg - } + sudo chmod +x /usr/local/bin/makepkg # Setup SSH for AUR mkdir -p ~/.ssh - echo "$AUR_SSH_KEY" > ~/.ssh/aur + printf '%s\n' "$AUR_SSH_KEY" > ~/.ssh/aur chmod 600 ~/.ssh/aur # Add AUR host key to known_hosts for security From 5ba702658df2b296590b1874de8c24bf1afdf2f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 01:50:08 +0000 Subject: [PATCH 6/6] Add explicit permissions to workflow for security compliance Co-authored-by: mklan <5452972+mklan@users.noreply.github.com> --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8f506b1..126b2a2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,9 @@ on: jobs: deploy: runs-on: ubuntu-latest - + permissions: + contents: write # Required for creating tags, committing, and creating releases + steps: - name: Checkout repository uses: actions/checkout@v4