Skip to content

Commit 8515bf4

Browse files
committed
Publish AUR package
1 parent a6c4930 commit 8515bf4

File tree

5 files changed

+113
-4
lines changed

5 files changed

+113
-4
lines changed

.github/workflows/ci-linux.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ jobs:
145145
for file in $(find ./artifacts -type f -name "GitHubDesktop-linux-*"); do
146146
new_name=$(echo "$file" | sed -E "s/GitHubDesktop-linux-(.*)-[0-9]+\\.[0-9]+\\.[0-9]+\\.(.*)/GitHubDesktopPlus-${{ env.RELEASE_TAG }}-linux-\\1.\\2/")
147147
new_name=$(echo $new_name | sed -E "s/linux-amd64/linux-x86_64/")
148+
new_name=$(echo $new_name | sed -E "s/linux-aarch64/linux-arm64/")
148149
mv --verbose "$file" "$new_name"
149150
done
150151
@@ -160,3 +161,45 @@ jobs:
160161
fail_on_unmatched_files: true
161162
env:
162163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164+
165+
- name: Prepare PKGBUILD
166+
run: |
167+
AUR_DIR=./aur
168+
PKGBUILD_FILE=$AUR_DIR/PKGBUILD
169+
echo "AUR_DIR=$AUR_DIR" >> $GITHUB_ENV
170+
echo "PKGBUILD_FILE=$PKGBUILD_FILE" >> $GITHUB_ENV
171+
if [[ ! -f "$PKGBUILD_FILE" ]]; then
172+
echo "$PKGBUILD_FILE does not exist. Contents of current directory:"
173+
ls -la
174+
exit 1
175+
fi
176+
version_without_v=$(echo "${{ env.RELEASE_TAG_WITHOUT_PREFIX }}" | sed -E "s/v(.*)/\\1/")
177+
sed -i "s/\[\[VERSION_WITHOUT_V\]\]/$version_without_v/" $PKGBUILD_FILE
178+
desktop_file_sha256=$(sha256sum $AUR_DIR/github-desktop-plus.desktop | awk '{ print $1 }')
179+
sed -i "s/\[\[DESKTOP_FILE_SHA256\]\]/$desktop_file_sha256/" $PKGBUILD_FILE
180+
x86_64_sha256=$(sha256sum artifacts/**/*-x86_64.deb | awk '{ print $1 }')
181+
sed -i "s/\[\[X86_64_SHA256\]\]/$x86_64_sha256/" $PKGBUILD_FILE
182+
aarch64_sha256=$(sha256sum artifacts/**/*-arm64.deb | awk '{ print $1 }')
183+
sed -i "s/\[\[AARCH64_SHA256\]\]/$aarch64_sha256/" $PKGBUILD_FILE
184+
armv7h_sha256=$(sha256sum artifacts/**/*-armhf.deb | awk '{ print $1 }')
185+
sed -i "s/\[\[ARMV7H_SHA256\]\]/$armv7h_sha256/" $PKGBUILD_FILE
186+
187+
- name: Upload PKGBUILD
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: PKGBUILD
191+
path: ${{ env.PKGBUILD_FILE }}
192+
retention-days: 5
193+
if-no-files-found: error
194+
195+
- name: Publish AUR package
196+
uses: KSXGitHub/github-actions-deploy-aur@v4.1.0
197+
with:
198+
pkgname: github-desktop-plus-bin
199+
pkgbuild: ${{ env.PKGBUILD_FILE }}
200+
commit_username: ${{ secrets.AUR_USERNAME }}
201+
commit_email: ${{ secrets.AUR_EMAIL }}
202+
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
203+
commit_message:
204+
'Update AUR package to version ${{ env.RELEASE_TAG_WITHOUT_PREFIX }}'
205+
ssh_keyscan_types: rsa,ecdsa,ed25519

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,18 @@ jobs:
197197
run: |
198198
# GitHubDesktopSetup-<arch>.<ext> -> GitHubDesktopPlus-<release_tag>-windows-<arch>.<ext>
199199
for file in $(find ./artifacts -type f -name "GitHubDesktopSetup-*"); do
200-
mv --verbose "$file" $(echo "$file" | sed -E "s/GitHubDesktopSetup-(.*)\\.(.*)/GitHubDesktopPlus-${{ env.RELEASE_TAG }}-windows-\\1.\\2/")
200+
new_name=$(echo "$file" | sed -E "s/GitHubDesktopSetup-(.*)\\.(.*)/GitHubDesktopPlus-${{ env.RELEASE_TAG }}-windows-\\1.\\2/")
201+
mv --verbose "$file" "$new_name"
201202
done
202203
203204
# GitHub Desktop-<arch>.zip -> GitHubDesktopPlus-<release_tag>-macOS-<arch>.zip
204-
for file in $(find ./artifacts -type f -name "GitHub Desktop-*.zip"); do
205-
mv --verbose "$file" $(echo "$file" | sed -E "s/GitHub Desktop-(.*)\\.zip/GitHubDesktopPlus-${{ env.RELEASE_TAG }}-macOS-\\1.zip/")
205+
find ./artifacts -type f -name "GitHub Desktop-*.zip" -print0 | while IFS= read -r -d '' file; do
206+
new_name=$(echo "$file" | sed -E "s/GitHub Desktop-(.*)\\.zip/GitHubDesktopPlus-${{ env.RELEASE_TAG }}-macOS-\\1.zip/")
207+
mv --verbose "$file" "$new_name"
206208
done
207209
208210
- name: Upload assets to release
209-
run: gh release upload $RELEASE_TAG ./artifacts/* --clobber
211+
run: |
212+
gh release upload ${{ env.RELEASE_TAG }} artifacts/**/*.exe artifacts/**/*.msi artifacts/**/*.zip --clobber
210213
env:
211214
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

aur/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pkg/
2+
src/
3+
4+
*.pkg.tar.zst
5+
*.deb

aur/PKGBUILD

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Maintainer: Pol Rivero < aur AT polrivero DOT com >
2+
# Contributor: Padraic Fanning < fanninpm AT miamioh DOT edu >
3+
# Contributor: Jake <aur@ja-ke.tech>
4+
# Contributor: Ian MacKay <immackay0@gmail.com>
5+
6+
_pkgname='github-desktop-plus'
7+
pkgname="${_pkgname}-bin"
8+
pkgver=[[VERSION_WITHOUT_V]]
9+
pkgrel=1
10+
pkgdesc="Work-in-progress fork of GitHub Desktop with extra features."
11+
arch=('x86_64' 'aarch64' 'armv7h')
12+
url="https://desktop.github.com"
13+
license=('MIT')
14+
depends=(
15+
'curl'
16+
'git'
17+
'libsecret'
18+
'libxss'
19+
'nspr'
20+
'nss'
21+
'org.freedesktop.secrets'
22+
'unzip'
23+
)
24+
optdepends=('hub: CLI interface for GitHub.')
25+
provides=(${_pkgname})
26+
conflicts=(${_pkgname})
27+
source=(${_pkgname}.desktop)
28+
29+
_common_download_url="https://github.com/pol-rivero/github-desktop-plus/releases/download/v${pkgver}/GitHubDesktopPlus-v${pkgver}-linux"
30+
source_x86_64=(${_common_download_url}-x86_64.deb)
31+
source_aarch64=(${_common_download_url}-arm64.deb)
32+
source_armv7h=(${_common_download_url}-armhf.deb)
33+
34+
sha256sums=('[[DESKTOP_FILE_SHA256]]')
35+
sha256sums_x86_64=('[[X86_64_SHA256]]')
36+
sha256sums_aarch64=('[[AARCH64_SHA256]]')
37+
sha256sums_armv7h=('[[ARMV7H_SHA256]]')
38+
package() {
39+
tar xf data.tar.xz -C "${pkgdir}"
40+
install -d "${pkgdir}/opt/${_pkgname}"
41+
mv "${pkgdir}/usr/lib/github-desktop" "${pkgdir}/opt/"
42+
43+
rm "${pkgdir}/usr/share/applications/github-desktop.desktop"
44+
install -Dm644 "${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
45+
46+
ln -sf "/opt/$_pkgname/$_pkgname" "${pkgdir}/usr/bin/$_pkgname"
47+
}

aur/github-desktop-plus.desktop

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Name=GitHub Desktop Plus
3+
Comment=Extend your GitHub workflow beyond your browser with GitHub Desktop
4+
Comment[es]=Trabaja con GitHub desde tu escritorio.
5+
Comment[eu]=GitHub-ekin lan egin zure ordenagailutik.
6+
Exec=/usr/bin/github-desktop %U
7+
Terminal=false
8+
Type=Application
9+
Icon=github-desktop
10+
Categories=Development;
11+
MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth;x-scheme-handler/x-github-desktop-dev-auth;

0 commit comments

Comments
 (0)