Skip to content

ci: add AUR automation to release workflow#11

Merged
FelipeMorandini merged 2 commits intomainfrom
chore/aur-automation
Mar 18, 2026
Merged

ci: add AUR automation to release workflow#11
FelipeMorandini merged 2 commits intomainfrom
chore/aur-automation

Conversation

@FelipeMorandini
Copy link
Copy Markdown
Owner

Summary

  • Add update-aur job to release.yml that automatically updates the jwt-term-bin AUR package on each release
  • The job downloads release assets, computes SHA256 checksums, updates PKGBUILD and .SRCINFO, and pushes to AUR via SSH
  • Bump PKGBUILD version from 1.0.1 to 1.1.0
  • Update ROADMAP to mark AUR submission and automation as complete
  • Initial PKGBUILD already pushed to AUR (jwt-term-bin is live)

Test plan

  • Verify YAML syntax is valid
  • Verify update-aur job runs after release job
  • Verify SSH configuration uses AUR_SSH_KEY secret correctly
  • Verify .SRCINFO generation uses correct tab-indented format
  • CI passes (fmt, clippy, test, audit, deny)

Add update-aur job to release.yml that automatically updates the
jwt-term-bin AUR package on each release. The job downloads release
assets, computes SHA256 checksums, updates the PKGBUILD, generates
.SRCINFO, and pushes to AUR via SSH.

Also bumps PKGBUILD version from 1.0.1 to 1.1.0 and updates ROADMAP
to reflect AUR submission and automation are complete.
@FelipeMorandini FelipeMorandini requested a review from Copilot March 18, 2026 19:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automated AUR package updates to the release workflow so jwt-term-bin stays in sync with GitHub Releases, alongside updating packaging metadata and roadmap status.

Changes:

  • Add an update-aur job to .github/workflows/release.yml that downloads release assets, computes SHA256 sums, updates PKGBUILD/.SRCINFO, and pushes to AUR via SSH.
  • Bump packaging/aur/PKGBUILD version to 1.1.0.
  • Update ROADMAP.md to mark AUR automation as complete and reorganize remaining distribution work.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/release.yml Introduces the new AUR automation job within the release pipeline.
packaging/aur/PKGBUILD Updates pkgver to align with the new release version.
ROADMAP.md Marks AUR work as done and updates distribution status tracking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment on lines +224 to +230
echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
cat >> ~/.ssh/config << 'EOF'
Host aur.archlinux.org
IdentityFile ~/.ssh/aur
User aur
StrictHostKeyChecking accept-new
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in de5cde0 — now using ssh-keyscan -t ed25519 aur.archlinux.org to pin the host key and StrictHostKeyChecking yes.

Comment thread .github/workflows/release.yml Outdated
- name: Configure SSH for AUR
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in de5cde0 — switched to printf '%s' and added chmod 700 ~/.ssh.

Comment on lines +237 to +247
VERSION="${GITHUB_REF_NAME#v}"
TAG="${GITHUB_REF_NAME}"
BASE="https://github.com/felipemorandini/jwt-term/releases/download/${TAG}"

curl -sL "${BASE}/jwt-term-x86_64-unknown-linux-musl.tar.gz" -o x86_64.tar.gz
curl -sL "${BASE}/jwt-term-aarch64-unknown-linux-musl.tar.gz" -o aarch64.tar.gz
curl -sL "https://raw.githubusercontent.com/felipemorandini/jwt-term/${TAG}/LICENSE" -o LICENSE

SHA_X86_64=$(sha256sum x86_64.tar.gz | cut -d' ' -f1)
SHA_AARCH64=$(sha256sum aarch64.tar.gz | cut -d' ' -f1)
SHA_LICENSE=$(sha256sum LICENSE | cut -d' ' -f1)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in de5cde0 — now using set -euo pipefail and curl -fSL --retry 3 so the job fails immediately on HTTP errors.

Comment on lines +272 to +297
# Generate .SRCINFO (makepkg is not available on Ubuntu)
# .SRCINFO uses tab indentation for fields under pkgbase/pkgname
TAB=$'\t'
URL="https://github.com/felipemorandini/jwt-term"
{
echo "pkgbase = jwt-term-bin"
echo "${TAB}pkgdesc = A blazing-fast, secure, and offline-first CLI for inspecting, validating, and manipulating JWTs"
echo "${TAB}pkgver = ${VERSION}"
echo "${TAB}pkgrel = 1"
echo "${TAB}url = ${URL}"
echo "${TAB}arch = x86_64"
echo "${TAB}arch = aarch64"
echo "${TAB}license = MIT"
echo "${TAB}provides = jwt-term"
echo "${TAB}conflicts = jwt-term"
echo "${TAB}source_x86_64 = ${URL}/releases/download/v${VERSION}/jwt-term-x86_64-unknown-linux-musl.tar.gz"
echo "${TAB}source_x86_64 = ${URL}/raw/v${VERSION}/LICENSE"
echo "${TAB}sha256sums_x86_64 = ${SHA_X86_64}"
echo "${TAB}sha256sums_x86_64 = ${SHA_LICENSE}"
echo "${TAB}source_aarch64 = ${URL}/releases/download/v${VERSION}/jwt-term-aarch64-unknown-linux-musl.tar.gz"
echo "${TAB}source_aarch64 = ${URL}/raw/v${VERSION}/LICENSE"
echo "${TAB}sha256sums_aarch64 = ${SHA_AARCH64}"
echo "${TAB}sha256sums_aarch64 = ${SHA_LICENSE}"
echo ""
echo "pkgname = jwt-term-bin"
} > .SRCINFO
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Acknowledged — this is a known trade-off. makepkg --printsrcinfo requires an Arch Linux environment (not available on Ubuntu runners). Adding a Docker container step would add significant time and complexity. The .SRCINFO is generated from the same variables used to update the PKGBUILD, so they stay in sync for all fields that change between releases (version, checksums, sources). If dependencies or pkgdesc change in the future, both the hardcoded .SRCINFO generation and the PKGBUILD template would need updating together — this is acceptable for a -bin package with no build dependencies.

- Pin AUR host key via ssh-keyscan instead of accept-new (MITM prevention)
- Use printf instead of echo for SSH key to preserve multi-line content
- Use curl -fSL --retry 3 to fail on HTTP errors instead of silently
  hashing error pages
- Set chmod 700 on ~/.ssh directory
@FelipeMorandini FelipeMorandini merged commit 5b247c1 into main Mar 18, 2026
8 checks passed
@FelipeMorandini FelipeMorandini deleted the chore/aur-automation branch March 18, 2026 19:35
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.

2 participants