Skip to content

Commit f8ccc79

Browse files
Merge pull request anomalyco#207 from different-ai/chore/aur-automation
chore: add AUR automation scaffolding
2 parents 3e3f2da + 0f80e8c commit f8ccc79

6 files changed

Lines changed: 222 additions & 0 deletions

File tree

‎.github/workflows/release-macos-aarch64.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,47 @@ jobs:
363363
includeUpdaterJson: true
364364
updaterJsonPreferNsis: true
365365
releaseAssetNamePattern: openwork-desktop-[platform]-[arch][ext]
366+
367+
aur-pr:
368+
name: Open AUR update PR
369+
needs: publish-tauri
370+
runs-on: ubuntu-latest
371+
372+
permissions:
373+
contents: write
374+
pull-requests: write
375+
376+
steps:
377+
- name: Set release metadata
378+
shell: bash
379+
env:
380+
INPUT_TAG: ${{ github.event.inputs.tag }}
381+
run: |
382+
set -euo pipefail
383+
384+
TAG_INPUT="${INPUT_TAG:-}"
385+
if [ -n "$TAG_INPUT" ]; then
386+
if [[ "$TAG_INPUT" == v* ]]; then
387+
TAG="$TAG_INPUT"
388+
else
389+
TAG="v$TAG_INPUT"
390+
fi
391+
else
392+
TAG="${GITHUB_REF_NAME}"
393+
fi
394+
395+
# Guard against multiline env var injection
396+
TAG="${TAG//$'\n'/}"
397+
TAG="${TAG//$'\r'/}"
398+
399+
echo "RELEASE_TAG=$TAG" >> "$GITHUB_ENV"
400+
401+
- name: Checkout
402+
uses: actions/checkout@v4
403+
with:
404+
ref: ${{ env.RELEASE_TAG }}
405+
406+
- name: Open AUR update PR
407+
env:
408+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
409+
run: scripts/aur/open-pr.sh "$RELEASE_TAG"

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ pnpm build:ui
144144
pnpm test:e2e
145145
```
146146

147+
## Troubleshooting
148+
149+
### Linux / Wayland (Hyprland)
150+
If OpenWork crashes on launch with WebKitGTK errors like `Failed to create GBM buffer`, disable dmabuf or compositing before launch. Try one of the following environment flags.
151+
152+
```bash
153+
WEBKIT_DISABLE_DMABUF_RENDERER=1 openwork
154+
```
155+
156+
```bash
157+
WEBKIT_DISABLE_COMPOSITING_MODE=1 openwork
158+
```
159+
147160
## Security Notes
148161

149162
- OpenWork hides model reasoning and sensitive tool metadata by default.

‎packaging/aur/.SRCINFO‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pkgbase = openwork
2+
pkgdesc = An Open source alternative to Claude Cowork
3+
pkgver = 0.3.5
4+
pkgrel = 1
5+
url = https://github.com/different-ai/openwork
6+
arch = x86_64
7+
license = MIT
8+
depends = gtk3
9+
depends = glib2
10+
depends = libayatana-appindicator
11+
depends = libsoup3
12+
depends = webkit2gtk-4.1
13+
depends = openssl
14+
depends = dbus
15+
depends = librsvg
16+
source = openwork-desktop-linux-amd64.deb::https://github.com/different-ai/openwork/releases/download/v0.3.5/openwork-desktop-linux-amd64.deb
17+
sha256sums = 01b7f2fe78d870143b7b370e1b569cea218bfaa0549c4af32ab495a5ee3d349f
18+
19+
pkgname = openwork

‎packaging/aur/PKGBUILD‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pkgname=openwork
2+
pkgver=0.3.5
3+
pkgrel=1
4+
pkgdesc="An Open source alternative to Claude Cowork"
5+
arch=('x86_64')
6+
url="https://github.com/different-ai/openwork"
7+
license=('MIT')
8+
depends=(
9+
'gtk3'
10+
'glib2'
11+
'libayatana-appindicator'
12+
'libsoup3'
13+
'webkit2gtk-4.1'
14+
'openssl'
15+
'dbus'
16+
'librsvg'
17+
)
18+
source=("openwork-desktop-linux-amd64.deb::https://github.com/different-ai/openwork/releases/download/v${pkgver}/openwork-desktop-linux-amd64.deb")
19+
sha256sums=('01b7f2fe78d870143b7b370e1b569cea218bfaa0549c4af32ab495a5ee3d349f')
20+
21+
package() {
22+
bsdtar -xf "${srcdir}/openwork-desktop-linux-amd64.deb" -C "${pkgdir}"
23+
}

‎scripts/aur/open-pr.sh‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
5+
6+
TAG="${1:-${RELEASE_TAG:-}}"
7+
if [ -z "$TAG" ]; then
8+
echo "Missing release tag (arg or RELEASE_TAG)." >&2
9+
exit 1
10+
fi
11+
12+
if [[ "$TAG" != v* ]]; then
13+
TAG="v${TAG}"
14+
fi
15+
16+
VERSION="${TAG#v}"
17+
"${ROOT_DIR}/scripts/aur/update-aur.sh" "$TAG"
18+
19+
cd "$ROOT_DIR"
20+
21+
if ! git status --porcelain -- packaging/aur/PKGBUILD packaging/aur/.SRCINFO | grep -q .; then
22+
echo "AUR packaging already up to date."
23+
exit 0
24+
fi
25+
26+
BRANCH="chore/aur-${VERSION}"
27+
git switch -c "$BRANCH" 2>/dev/null || git switch "$BRANCH"
28+
29+
git add packaging/aur/PKGBUILD packaging/aur/.SRCINFO
30+
git -c user.name="OpenWork Release Bot" \
31+
-c user.email="[email protected]" \
32+
commit -m "chore(aur): update PKGBUILD for ${VERSION}"
33+
34+
git push --set-upstream origin "$BRANCH"
35+
36+
if gh pr list --head "$BRANCH" --state open --json number --jq 'length > 0' | grep -q true; then
37+
echo "PR already open for ${BRANCH}."
38+
exit 0
39+
fi
40+
41+
gh pr create --title "chore(aur): update PKGBUILD for ${VERSION}" --base dev --body "$(cat <<'EOF'
42+
## Summary
43+
- Update AUR PKGBUILD and .SRCINFO for the ${VERSION} release
44+
- Refresh sha256 for the Linux .deb release asset
45+
EOF
46+
)"

‎scripts/aur/update-aur.sh‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
5+
PKG_DIR="${ROOT_DIR}/packaging/aur"
6+
PKGBUILD="${PKG_DIR}/PKGBUILD"
7+
SRCINFO="${PKG_DIR}/.SRCINFO"
8+
9+
TAG="${1:-${RELEASE_TAG:-}}"
10+
if [ -z "$TAG" ]; then
11+
echo "Missing release tag (arg or RELEASE_TAG)." >&2
12+
exit 1
13+
fi
14+
15+
if [[ "$TAG" != v* ]]; then
16+
TAG="v${TAG}"
17+
fi
18+
19+
VERSION="${TAG#v}"
20+
ASSET_NAME="${AUR_ASSET_NAME:-openwork-desktop-linux-amd64.deb}"
21+
ASSET_URL="https://github.com/different-ai/openwork/releases/download/${TAG}/${ASSET_NAME}"
22+
23+
TMP_DIR=$(mktemp -d)
24+
trap 'rm -rf "$TMP_DIR"' EXIT
25+
26+
curl -fsSL -o "${TMP_DIR}/${ASSET_NAME}" "$ASSET_URL"
27+
28+
SHA256=$(python - "${TMP_DIR}/${ASSET_NAME}" <<'PY'
29+
import hashlib
30+
import sys
31+
32+
path = sys.argv[1]
33+
hasher = hashlib.sha256()
34+
with open(path, "rb") as handle:
35+
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
36+
hasher.update(chunk)
37+
print(hasher.hexdigest())
38+
PY
39+
)
40+
41+
python - "$PKGBUILD" "$VERSION" "$SHA256" <<'PY'
42+
import pathlib
43+
import re
44+
import sys
45+
46+
path = pathlib.Path(sys.argv[1])
47+
version = sys.argv[2]
48+
sha = sys.argv[3]
49+
50+
text = path.read_text()
51+
text = re.sub(r"^pkgver=.*$", f"pkgver={version}", text, flags=re.M)
52+
text = re.sub(r"^sha256sums=.*$", f"sha256sums=('{sha}')", text, flags=re.M)
53+
path.write_text(text)
54+
PY
55+
56+
python - "$SRCINFO" "$VERSION" "$SHA256" "$ASSET_URL" "$ASSET_NAME" <<'PY'
57+
import pathlib
58+
import re
59+
import sys
60+
61+
path = pathlib.Path(sys.argv[1])
62+
version = sys.argv[2]
63+
sha = sys.argv[3]
64+
url = sys.argv[4]
65+
asset = sys.argv[5]
66+
67+
text = path.read_text()
68+
text = re.sub(r"^\s*pkgver = .*", f" pkgver = {version}", text, flags=re.M)
69+
text = re.sub(
70+
r"^\s*source = .*",
71+
f" source = {asset}::{url}",
72+
text,
73+
flags=re.M,
74+
)
75+
text = re.sub(r"^\s*sha256sums = .*", f" sha256sums = {sha}", text, flags=re.M)
76+
path.write_text(text)
77+
PY

0 commit comments

Comments
 (0)