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
+
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 }}"
0 commit comments