Skip to content

Commit 5245052

Browse files
authored
Merge pull request #594 from nihalxkumar/main
Add Arch Linux packaging instructions and CI Pipeline
2 parents e653d26 + 55640f5 commit 5245052

File tree

2 files changed

+140
-1
lines changed

2 files changed

+140
-1
lines changed

.github/workflows/aur-publish.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Update AUR Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
paths:
8+
- 'pubspec.yaml'
9+
10+
jobs:
11+
aur-publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Get version from pubspec
18+
id: get_version
19+
run: |
20+
VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}' | cut -d'+' -f1)
21+
echo "version=$VERSION" >> $GITHUB_OUTPUT
22+
23+
- name: Get checksums
24+
id: get_checksums
25+
run: |
26+
# Download the x86_64 .deb
27+
wget https://github.com/foss42/apidash/releases/download/v${{ steps.get_version.outputs.version }}/apidash-linux-amd64.deb
28+
29+
# Download the arm64 .deb
30+
wget https://github.com/foss42/apidash/releases/download/v${{ steps.get_version.outputs.version }}/apidash-linux-arm64.deb
31+
32+
# Download the LICENSE
33+
wget https://raw.githubusercontent.com/foss42/apidash/main/LICENSE
34+
35+
# Generate SHA512 checksums
36+
DEB_X86_64_CHECKSUM=$(sha512sum apidash-linux-amd64.deb | awk '{print $1}')
37+
DEB_ARM64_CHECKSUM=$(sha512sum apidash-linux-arm64.deb | awk '{print $1}')
38+
LICENSE_CHECKSUM=$(sha512sum LICENSE | awk '{print $1}')
39+
40+
echo "deb_x86_64_checksum=$DEB_X86_64_CHECKSUM" >> $GITHUB_OUTPUT
41+
echo "deb_arm64_checksum=$DEB_ARM64_CHECKSUM" >> $GITHUB_OUTPUT
42+
echo "license_checksum=$LICENSE_CHECKSUM" >> $GITHUB_OUTPUT
43+
44+
- name: Publish AUR package
45+
uses: KSXGitHub/[email protected]
46+
with:
47+
pkgname: apidash-bin
48+
pkgbuild: |
49+
# Maintainer: Angelo Geulin <angelogeulin123 at gmail dot com>
50+
51+
pkgname=apidash-bin
52+
pkgver=${{ steps.get_version.outputs.version }}
53+
pkgrel=1
54+
pkgdesc="Beautiful open-source cross-platform API Client"
55+
arch=('x86_64' 'aarch64')
56+
url="https://apidash.dev"
57+
license=('Apache-2.0')
58+
depends=()
59+
options=('!emptydirs' '!strip')
60+
source=("LICENSE::https://raw.githubusercontent.com/foss42/apidash/main/LICENSE")
61+
source_x86_64=("apidash-linux-amd64.deb::https://github.com/foss42/apidash/releases/download/v${{ steps.get_version.outputs.version }}/apidash-linux-amd64.deb")
62+
source_aarch64=("apidash-linux-arm64.deb::https://github.com/foss42/apidash/releases/download/v${{ steps.get_version.outputs.version }}/apidash-linux-arm64.deb")
63+
sha512sums=('${{ steps.get_checksums.outputs.license_checksum }}')
64+
sha512sums_x86_64=('${{ steps.get_checksums.outputs.deb_x86_64_checksum }}')
65+
sha512sums_aarch64=('${{ steps.get_checksums.outputs.deb_arm64_checksum }}')
66+
67+
package() {
68+
if [ "$CARCH" = "x86_64" ]; then
69+
_debfile="$srcdir/apidash-linux-amd64.deb"
70+
elif [ "$CARCH" = "aarch64" ]; then
71+
_debfile="$srcdir/apidash-linux-arm64.deb"
72+
fi
73+
ar -x "${_debfile}" data.tar.zst
74+
bsdtar -xf data.tar.zst -C "$pkgdir/"
75+
76+
# Fix permissions of directories
77+
find "$pkgdir/" -type d -exec chmod 755 {} \;
78+
79+
# Create a symlink inside /usr/bin
80+
mkdir -p "${pkgdir}/usr/bin"
81+
ln -s /usr/share/apidash/apidash "$pkgdir/usr/bin/apidash"
82+
83+
install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
84+
}
85+
commit_username: ${{ secrets.AUR_USERNAME }}
86+
commit_email: ${{ secrets.AUR_EMAIL }}
87+
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
88+
commit_message: "Update to version ${{ steps.get_version.outputs.version }}"

doc/dev_guide/packaging.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,58 @@
2323

2424
## Arch Linux (PKGBUILD)
2525

26-
TODO Instructions
26+
Steps to update and release the Arch Linux package
27+
28+
1. Install required packages:
29+
30+
```bash
31+
sudo pacman -S base-devel
32+
```
33+
34+
2. Clone the ApiDash AUR repository:
35+
36+
```bash
37+
git clone https://aur.archlinux.org/apidash-bin.git
38+
cd apidash-bin
39+
```
40+
41+
3. Get the recent `.deb` release from the [releases page](https://github.com/foss42/apidash/releases/)
42+
43+
4. Generate new checksums:
44+
45+
```bash
46+
sha512sum apidash-linux-amd64.deb LICENSE
47+
```
48+
49+
5. Update the `PKGBUILD` file:
50+
51+
- Change `pkgver` to the new version
52+
- Reset `pkgrel` to 1
53+
- Update `sha512sums` with the new checksums
54+
55+
6. Build the package
56+
57+
```bash
58+
# Clean build files (if they exist from previous builds)
59+
# rm -rf pkg/ src/
60+
61+
# Build and install the package
62+
makepkg -si
63+
```
64+
65+
7. Update .SRCINFO:
66+
67+
```bash
68+
makepkg --printsrcinfo > .SRCINFO
69+
```
70+
71+
8. Commit and push the changes:
72+
73+
```bash
74+
git add PKGBUILD .SRCINFO
75+
git commit -m "Update to v[NEW_VERSION]"
76+
git push
77+
```
2778

2879
## FlatHub (Flatpak)
2980

0 commit comments

Comments
 (0)