Skip to content

ci: add AUR publishing workflow for fcitx5 and ibus packages#23

Open
thienandangthanh wants to merge 4 commits into
marixdev:masterfrom
thienandangthanh:ci/add-aur-publishing
Open

ci: add AUR publishing workflow for fcitx5 and ibus packages#23
thienandangthanh wants to merge 4 commits into
marixdev:masterfrom
thienandangthanh:ci/add-aur-publishing

Conversation

@thienandangthanh
Copy link
Copy Markdown

@thienandangthanh thienandangthanh commented Apr 2, 2026

Mô tả

PR này thêm tính năng tự động phát hành (publish) các gói cài đặt cho Arch Linux lên AUR (Arch User Repository) và cập nhật tài liệu hướng dẫn cài đặt tương ứng.
Chi tiết các thay đổi:

  • CI/CD: Thêm workflow GitHub Actions để tự động cập nhật và đẩy các gói fcitx5-vnkey-binibus-vnkey-bin lên AUR mỗi khi có release mới (kích hoạt khi có tag v*).
  • AUR Packages: Tạo các file template PKGBUILD chuẩn cho cả hai biến thể Fcitx5 và IBus.
  • Tài liệu: Cập nhật README.md, thay đổi hướng dẫn cài đặt thủ công bằng pacman -U sang sử dụng các AUR helper phổ biến (paru / yay), giúp đơn giản hóa quá trình cài đặt cho người dùng Arch Linux.

⚠️ Lưu ý quan trọng về GitHub Actions:
Để workflow hoạt động như mong đợi, cần phải thêm 3 Repository secrets sau tại trang Settings -> Secrets and variables -> Actions -> New repository secret:

  • AUR_USERNAME
  • AUR_EMAIL
  • AUR_SSH_PRIVATE_KEY

Loại thay đổi

  • Bug fix
  • Tính năng mới
  • Refactor / cải thiện code
  • Tài liệu
  • CI workflow

Nền tảng ảnh hưởng

  • Engine (ảnh hưởng tất cả)
  • Windows
  • macOS
  • Linux (Fcitx5)
  • Linux (IBus)

Kiểm tra

Issue liên quan

Nguồn tham khảo

Summary by CodeRabbit

  • Chores

    • Added Arch Linux AUR packages for fcitx5-vnkey-bin and ibus-vnkey-bin to simplify installation on Arch-based systems.
    • Added automated AUR publishing to the release workflow to publish package updates on versioned releases.
  • Documentation

    • Updated installation instructions to recommend installing the new AUR packages via common AUR helpers (e.g., paru/yay).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79e68ad4-4831-4029-af0a-868087fc436b

📥 Commits

Reviewing files that changed from the base of the PR and between 57b49ad and 21ba801.

📒 Files selected for processing (1)
  • .github/workflows/build.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/build.yml

📝 Walkthrough

Walkthrough

Added two Arch Linux AUR PKGBUILD templates and a GitHub Actions aur-publish job that, on version tags, fetches release artifacts/checksums, injects version and checksum into PKGBUILDs, and deploys the updated PKGBUILDs to the AUR. README install instructions were updated to use AUR helpers.

Changes

Cohort / File(s) Summary
AUR PKGBUILD templates
.github/aur/fcitx5-vnkey-bin/PKGBUILD, .github/aur/ibus-vnkey-bin/PKGBUILD
Added PKGBUILD templates declaring package metadata (pkgname, pkgver placeholder, pkgrel, pkgdesc, arch, url, license, depends, source, sha256sums) and a package() function that copies staged files into $pkgdir and removes Arch metadata files. Placeholders intended to be replaced by CI.
Release automation workflow
.github/workflows/build.yml
Added aur-publish job triggered for tag refs starting with v; runs a matrix for both packages, derives PKGVER from the tag, fetches SHA256SUMS.txt from the GitHub release to extract artifact checksums, substitutes PLACEHOLDER_VER/PLACEHOLDER_SHA256 in PKGBUILD templates, and deploys via KSXGitHub/github-actions-deploy-aur@v4.1.1 using AUR SSH credentials.
Documentation
README.md
Updated Arch Linux installation instructions to use AUR helpers (paru/yay) and reference the new fcitx5-vnkey-bin and ibus-vnkey-bin packages.

Sequence Diagram(s)

sequenceDiagram
  participant Maintainer
  participant GitHub as GitHub (Release & Actions)
  participant Action as aur-publish Job
  participant AUR

  Maintainer->>GitHub: push tag vX.Y.Z (create release + artifacts)
  GitHub->>Action: trigger aur-publish job (matrix: fcitx5-vnkey-bin, ibus-vnkey-bin)
  Action->>GitHub: fetch SHA256SUMS.txt for release
  Action->>Action: extract checksum for each artifact
  Action->>Action: copy `.github/aur/<pkg>/PKGBUILD` into working PKGBUILD
  Action->>Action: replace PLACEHOLDER_VER and PLACEHOLDER_SHA256
  Action->>AUR: deploy updated PKGBUILD via SSH (commit)
  AUR-->>Action: acknowledge commit
  Action-->>GitHub: job complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇
I hopped on tags and chased a tar,
Replaced the placeholders near and far,
Checksums hummed a tidy song,
PKGBUILDs now snug where they belong,
Come hop to AUR — the release is on!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add AUR publishing workflow for fcitx5 and ibus packages' accurately summarizes the main change—adding a GitHub Actions workflow for AUR package publishing. It is clear, specific, and directly related to the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/aur/fcitx5-vnkey-bin/PKGBUILD (1)

10-10: Consider using more specific license identifier.

Same as the ibus variant - the repository uses GPL-3.0-or-later.

💡 Suggested change
-license=('GPL')
+license=('GPL-3.0-or-later')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/aur/fcitx5-vnkey-bin/PKGBUILD at line 10, Update the license
identifier in the PKGBUILD by replacing the generic license value currently set
in the license variable (license=('GPL')) with the more specific SPDX identifier
used by the repo (GPL-3.0-or-later) so the package metadata matches the
project's declared license.
.github/aur/ibus-vnkey-bin/PKGBUILD (1)

10-10: Consider using more specific license identifier.

The repository uses GPL-3.0-or-later. AUR supports SPDX identifiers, so license=('GPL-3.0-or-later') would be more precise.

💡 Suggested change
-license=('GPL')
+license=('GPL-3.0-or-later')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/aur/ibus-vnkey-bin/PKGBUILD at line 10, Change the generic SPDX
license identifier in the PKGBUILD from license=('GPL') to the specific one used
by the repo: license=('GPL-3.0-or-later'); update the license line in the
PKGBUILD so tools and AUR receive the precise SPDX identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/aur/fcitx5-vnkey-bin/PKGBUILD:
- Line 12: The optdepends entry currently lists "fcitx-qt5: To run the fcitx
unikey macro editor" which is incorrect for this package; update or remove the
optdepends: either remove the entire optdepends entry if VnKey has no Qt
configuration UI, or replace "fcitx-qt5" with the Fcitx5 package "fcitx5-qt" and
change the description to reference VnKey (e.g. "fcitx5-qt: optional Qt
integration for VnKey") so the optdepends key and its description accurately
reflect the correct package and project name.

In @.github/workflows/build.yml:
- Around line 561-570: The meta step extracts PKGVER/ARTIFACT_FILE and computes
SHA256 but does not validate it; add a check after computing SHA256 (in the step
with id "meta" using variables PKGVER, ARTIFACT_FILE, SHA256) that verifies
SHA256 is non-empty and matches expected hex length (64 chars for sha256) and if
invalid prints a clear error to stderr, fails the job (exit 1) and does not
write an empty sha256 to GITHUB_OUTPUT; ensure the check occurs immediately
after SHA256 assignment and before the echo "sha256=..." line so the workflow
aborts on missing or malformed checksum.

---

Nitpick comments:
In @.github/aur/fcitx5-vnkey-bin/PKGBUILD:
- Line 10: Update the license identifier in the PKGBUILD by replacing the
generic license value currently set in the license variable (license=('GPL'))
with the more specific SPDX identifier used by the repo (GPL-3.0-or-later) so
the package metadata matches the project's declared license.

In @.github/aur/ibus-vnkey-bin/PKGBUILD:
- Line 10: Change the generic SPDX license identifier in the PKGBUILD from
license=('GPL') to the specific one used by the repo:
license=('GPL-3.0-or-later'); update the license line in the PKGBUILD so tools
and AUR receive the precise SPDX identifier.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 181825a2-3b68-427b-b7f4-980db2c91964

📥 Commits

Reviewing files that changed from the base of the PR and between a812730 and bc985f3.

📒 Files selected for processing (4)
  • .github/aur/fcitx5-vnkey-bin/PKGBUILD
  • .github/aur/ibus-vnkey-bin/PKGBUILD
  • .github/workflows/build.yml
  • README.md

Comment thread .github/aur/fcitx5-vnkey-bin/PKGBUILD Outdated
Comment thread .github/workflows/build.yml
Add automated AUR publishing via GitHub Actions on release tags:
- Create PKGBUILD templates for fcitx5-vnkey-bin and ibus-vnkey-bin
- Add aur-publish job that extracts version and SHA256 from releases
- Use github-actions-deploy-aur to push updates to AUR repositories
- Support both fcitx5 and ibus variants via matrix strategy
This enables automatic AUR package updates whenever a new release is tagged.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/build.yml (1)

561-574: ⚠️ Potential issue | 🟠 Major

Harden checksum extraction to exact-match and 64-hex validation.

Current logic only checks non-empty output. It can still pass malformed values or unintended matches, then publish a broken sha256sums into AUR.

🔧 Proposed fix
       - name: Extract pkgver and SHA256 from release
         id: meta
         run: |
           PKGVER="${GITHUB_REF_NAME#v}"
           ARTIFACT_FILE="${{ matrix.artifact_prefix }}-v${PKGVER}-1-x86_64.pkg.tar.zst"
           SHA256=$(curl -fsSL \
             "https://github.com/marixdev/vnkey/releases/download/v${PKGVER}/SHA256SUMS.txt" \
-            | grep "${ARTIFACT_FILE}" | awk '{print $1}')
-          if [ -z "$SHA256" ]; then
-            echo "::error::Failed to extract SHA256 for ${ARTIFACT_FILE}"
+            | awk -v file="${ARTIFACT_FILE}" '$2 == file { print $1; exit }')
+          if ! [[ "$SHA256" =~ ^[A-Fa-f0-9]{64}$ ]]; then
+            echo "::error::Invalid SHA256 extracted for ${ARTIFACT_FILE}: '${SHA256}'" >&2
             exit 1
           fi
           echo "pkgver=$PKGVER" >> "$GITHUB_OUTPUT"
           echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build.yml around lines 561 - 574, The SHA256 extraction
step currently trusts any non-empty grep/awk output; update the logic around
variables PKGVER, ARTIFACT_FILE and SHA256 to (1) perform an exact filename
match (so the grep/selection only matches the full ARTIFACT_FILE entry, not
substrings) and (2) validate that the captured SHA256 is a 64-hex string (using
a regex test) before writing pkgver and sha256 to GITHUB_OUTPUT; if the match or
validation fails, emit an error and exit non‑zero to prevent publishing bad
sha256sums.
🧹 Nitpick comments (1)
.github/workflows/build.yml (1)

567-568: Avoid hardcoded repository in release URL.

Use ${{ github.repository }} so this workflow keeps working on forks/renames without edits.

♻️ Proposed tweak
-          SHA256=$(curl -fsSL \
-            "https://github.com/marixdev/vnkey/releases/download/v${PKGVER}/SHA256SUMS.txt" \
+          SHA256=$(curl -fsSL \
+            "https://github.com/${{ github.repository }}/releases/download/v${PKGVER}/SHA256SUMS.txt" \
             | awk -v file="${ARTIFACT_FILE}" '$2 == file { print $1; exit }')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build.yml around lines 567 - 568, The release download URL
is hardcoded to "marixdev/vnkey" which breaks on forks/renames; update the
workflow string that constructs the SHA256SUMS.txt URL (the line referencing
"https://github.com/marixdev/vnkey/releases/download/v${PKGVER}/SHA256SUMS.txt")
to use the GitHub Actions repository variable ${{ github.repository }} instead
of the literal repo name so the workflow will work for forks and renamed repos
while keeping the existing PKGVER and ARTIFACT_FILE variables intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/build.yml:
- Around line 561-574: The SHA256 extraction step currently trusts any non-empty
grep/awk output; update the logic around variables PKGVER, ARTIFACT_FILE and
SHA256 to (1) perform an exact filename match (so the grep/selection only
matches the full ARTIFACT_FILE entry, not substrings) and (2) validate that the
captured SHA256 is a 64-hex string (using a regex test) before writing pkgver
and sha256 to GITHUB_OUTPUT; if the match or validation fails, emit an error and
exit non‑zero to prevent publishing bad sha256sums.

---

Nitpick comments:
In @.github/workflows/build.yml:
- Around line 567-568: The release download URL is hardcoded to "marixdev/vnkey"
which breaks on forks/renames; update the workflow string that constructs the
SHA256SUMS.txt URL (the line referencing
"https://github.com/marixdev/vnkey/releases/download/v${PKGVER}/SHA256SUMS.txt")
to use the GitHub Actions repository variable ${{ github.repository }} instead
of the literal repo name so the workflow will work for forks and renamed repos
while keeping the existing PKGVER and ARTIFACT_FILE variables intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4688403-905c-4876-9fe7-b946b0077ee3

📥 Commits

Reviewing files that changed from the base of the PR and between 84d696e and 70e7169.

📒 Files selected for processing (3)
  • .github/aur/fcitx5-vnkey-bin/PKGBUILD
  • .github/aur/ibus-vnkey-bin/PKGBUILD
  • .github/workflows/build.yml
✅ Files skipped from review due to trivial changes (2)
  • .github/aur/fcitx5-vnkey-bin/PKGBUILD
  • .github/aur/ibus-vnkey-bin/PKGBUILD

Replace manual package installation with paru/yay commands for fcitx5-vnkey-bin and ibus-vnkey-bin packages.
This simplifies the installation process for Arch users by leveraging AUR helpers instead of requiring manual package downloads.
Note: only update for aur-publish job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant