-
Notifications
You must be signed in to change notification settings - Fork 15
Add AUR (Arch Linux User Repository) packaging and auto-publish workflow #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mekwall
wants to merge
1
commit into
gildas:dev
Choose a base branch
from
mekwall:feature/aur-packaging
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+134
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Publish to AUR | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| aur-publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Get version | ||
| id: version | ||
| run: | | ||
| # Strip leading 'v' from tag (e.g. v0.18.0 -> 0.18.0) | ||
| VERSION="${GITHUB_REF_NAME#v}" | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install archlinux packaging tools | ||
| run: | | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -qq -y pacman-package-manager 2>/dev/null || true | ||
|
|
||
| - name: Generate PKGBUILD | ||
| env: | ||
| VERSION: ${{ steps.version.outputs.version }} | ||
| run: | | ||
| set -eo pipefail | ||
|
|
||
| # Copy template and pin version | ||
| cp packaging/aur/PKGBUILD PKGBUILD | ||
| sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD | ||
| sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD | ||
|
|
||
| # Download sources and compute checksums. | ||
| # PKGBUILD variables ($url, $pkgver) resolve naturally here. | ||
| if command -v updpkgsums &>/dev/null; then | ||
| updpkgsums | ||
| else | ||
| # Manual fallback: compute checksums directly | ||
| AMD64_SHA=$(curl -sL --fail \ | ||
| "https://github.com/gildas/bitbucket-cli/releases/download/v$VERSION/bitbucket-cli_${VERSION}_linux_amd64.tar.gz" \ | ||
| | sha256sum | cut -d' ' -f1) | ||
| ARM64_SHA=$(curl -sL --fail \ | ||
| "https://github.com/gildas/bitbucket-cli/releases/download/v$VERSION/bitbucket-cli_${VERSION}_linux_arm64.tar.gz" \ | ||
| | sha256sum | cut -d' ' -f1) | ||
| LICENSE_SHA=$(curl -sL --fail \ | ||
| "https://github.com/gildas/bitbucket-cli/raw/v$VERSION/LICENSE" \ | ||
| | sha256sum | cut -d' ' -f1) | ||
|
|
||
| sed -i "/^sha256sums_x86_64=(/,/)/c\sha256sums_x86_64=(\"$AMD64_SHA\" \"$LICENSE_SHA\")" PKGBUILD | ||
| sed -i "/^sha256sums_aarch64=(/,/)/c\sha256sums_aarch64=(\"$ARM64_SHA\" \"$LICENSE_SHA\")" PKGBUILD | ||
| fi | ||
|
|
||
| - name: Publish to AUR | ||
| uses: KSXGitHub/github-actions-deploy-aur@da03e160361ce01bf087e790b6ffd196d7dccff7 # v4.1.3 | ||
| with: | ||
| pkgname: bitbucket-cli-bin | ||
| pkgbuild: ./PKGBUILD | ||
| commit_username: ${{ secrets.AUR_USERNAME }} | ||
| commit_email: ${{ secrets.AUR_EMAIL }} | ||
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
| ssh_keyscan_types: rsa,ecdsa,ed25519 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| pkgbase = bitbucket-cli-bin | ||
| pkgdesc = The missing command line interface for Bitbucket | ||
| pkgver = 0.18.0 | ||
| pkgrel = 1 | ||
| url = https://github.com/gildas/bitbucket-cli | ||
| arch = x86_64 | ||
| arch = aarch64 | ||
| license = MIT | ||
| optdepends = gnome-keyring: Secret Service backend for credential storage | ||
| provides = bitbucket-cli=0.18.0 | ||
| provides = bb=0.18.0 | ||
| conflicts = bitbucket-cli | ||
| conflicts = bitbucket-cli-git | ||
| options = !strip | ||
| options = !debug | ||
| source_x86_64 = https://github.com/gildas/bitbucket-cli/releases/download/v0.18.0/bitbucket-cli_0.18.0_linux_amd64.tar.gz | ||
| source_x86_64 = LICENSE::https://github.com/gildas/bitbucket-cli/raw/v0.18.0/LICENSE | ||
| sha256sums_x86_64 = b2f8759dde04ed1555d21c183d98f43dc0c500550f1878ab023e9e6ab5d5beeb | ||
| sha256sums_x86_64 = 476c049bd9aac064131760d13a1dfdebcb20d0e00d3536df08f3c2672755d5eb | ||
| source_aarch64 = https://github.com/gildas/bitbucket-cli/releases/download/v0.18.0/bitbucket-cli_0.18.0_linux_arm64.tar.gz | ||
| source_aarch64 = LICENSE::https://github.com/gildas/bitbucket-cli/raw/v0.18.0/LICENSE | ||
| sha256sums_aarch64 = 467ed7ece88210e22f699811522c0d6b30e89a5c578c51a73add291862ddf2c8 | ||
| sha256sums_aarch64 = 476c049bd9aac064131760d13a1dfdebcb20d0e00d3536df08f3c2672755d5eb | ||
|
|
||
| pkgname = bitbucket-cli-bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Maintainer: Gildas Cherruel <gildas@breizh.org> | ||
| pkgname=bitbucket-cli-bin | ||
| pkgver=0.18.0 | ||
| pkgrel=1 | ||
| pkgdesc="The missing command line interface for Bitbucket" | ||
| url="https://github.com/gildas/bitbucket-cli" | ||
| license=("MIT") | ||
| arch=("x86_64" "aarch64") | ||
| provides=("bitbucket-cli=$pkgver" "bb=$pkgver") | ||
| conflicts=("bitbucket-cli" "bitbucket-cli-git") | ||
| options=("!strip" "!debug") | ||
| optdepends=("gnome-keyring: Secret Service backend for credential storage") | ||
| source_x86_64=("$url/releases/download/v$pkgver/bitbucket-cli_${pkgver}_linux_amd64.tar.gz" | ||
| "LICENSE::$url/raw/v$pkgver/LICENSE") | ||
| source_aarch64=("$url/releases/download/v$pkgver/bitbucket-cli_${pkgver}_linux_arm64.tar.gz" | ||
| "LICENSE::$url/raw/v$pkgver/LICENSE") | ||
| sha256sums_x86_64=("b2f8759dde04ed1555d21c183d98f43dc0c500550f1878ab023e9e6ab5d5beeb" | ||
| "476c049bd9aac064131760d13a1dfdebcb20d0e00d3536df08f3c2672755d5eb") | ||
| sha256sums_aarch64=("467ed7ece88210e22f699811522c0d6b30e89a5c578c51a73add291862ddf2c8" | ||
| "476c049bd9aac064131760d13a1dfdebcb20d0e00d3536df08f3c2672755d5eb") | ||
|
|
||
| package() { | ||
| install -Dm755 bb "$pkgdir/usr/bin/bb" | ||
|
|
||
| # License | ||
| install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | ||
|
|
||
| # Shell completions | ||
| "$pkgdir/usr/bin/bb" completion bash > bb-completion.bash | ||
| "$pkgdir/usr/bin/bb" completion zsh > _bb | ||
| "$pkgdir/usr/bin/bb" completion fish > bb.fish | ||
|
|
||
| install -Dm644 bb-completion.bash "$pkgdir/usr/share/bash-completion/completions/bb" | ||
| install -Dm644 _bb "$pkgdir/usr/share/zsh/site-functions/_bb" | ||
| install -Dm644 bb.fish "$pkgdir/usr/share/fish/vendor_completions.d/bb.fish" | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.