mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
chore: add AUR automation scaffolding
This commit is contained in:
45
.github/workflows/release-macos-aarch64.yml
vendored
45
.github/workflows/release-macos-aarch64.yml
vendored
@@ -363,3 +363,48 @@ jobs:
|
||||
includeUpdaterJson: true
|
||||
updaterJsonPreferNsis: true
|
||||
releaseAssetNamePattern: openwork-desktop-[platform]-[arch][ext]
|
||||
|
||||
aur-pr:
|
||||
name: Open AUR update PR
|
||||
needs: publish-tauri
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ vars.AUR_PR_AUTOMATION_ENABLED == 'true' }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Set release metadata
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_TAG: ${{ github.event.inputs.tag }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
TAG_INPUT="${INPUT_TAG:-}"
|
||||
if [ -n "$TAG_INPUT" ]; then
|
||||
if [[ "$TAG_INPUT" == v* ]]; then
|
||||
TAG="$TAG_INPUT"
|
||||
else
|
||||
TAG="v$TAG_INPUT"
|
||||
fi
|
||||
else
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
fi
|
||||
|
||||
# Guard against multiline env var injection
|
||||
TAG="${TAG//$'\n'/}"
|
||||
TAG="${TAG//$'\r'/}"
|
||||
|
||||
echo "RELEASE_TAG=$TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ env.RELEASE_TAG }}
|
||||
|
||||
- name: Open AUR update PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: scripts/aur/open-pr.sh "$RELEASE_TAG"
|
||||
|
||||
13
README.md
13
README.md
@@ -140,6 +140,19 @@ pnpm build:ui
|
||||
pnpm test:e2e
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Linux / Wayland (Hyprland)
|
||||
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.
|
||||
|
||||
```bash
|
||||
WEBKIT_DISABLE_DMABUF_RENDERER=1 openwork
|
||||
```
|
||||
|
||||
```bash
|
||||
WEBKIT_DISABLE_COMPOSITING_MODE=1 openwork
|
||||
```
|
||||
|
||||
## Security Notes
|
||||
|
||||
- OpenWork hides model reasoning and sensitive tool metadata by default.
|
||||
|
||||
19
packaging/aur/.SRCINFO
Normal file
19
packaging/aur/.SRCINFO
Normal file
@@ -0,0 +1,19 @@
|
||||
pkgbase = openwork
|
||||
pkgdesc = OpenWork desktop app (binary release)
|
||||
pkgver = 0.3.4
|
||||
pkgrel = 1
|
||||
url = https://github.com/different-ai/openwork
|
||||
arch = x86_64
|
||||
license = MIT
|
||||
depends = gtk3
|
||||
depends = glib2
|
||||
depends = libayatana-appindicator
|
||||
depends = libsoup3
|
||||
depends = webkit2gtk-4.1
|
||||
depends = openssl
|
||||
depends = dbus
|
||||
depends = librsvg
|
||||
source = openwork-desktop-linux-amd64.deb::https://github.com/different-ai/openwork/releases/download/v0.3.4/openwork-desktop-linux-amd64.deb
|
||||
sha256sums = 16d1d02d508beacd0582be61a14b94cfdb6c0dca3c26ed83b0b2ffa2c619a07a
|
||||
|
||||
pkgname = openwork
|
||||
23
packaging/aur/PKGBUILD
Normal file
23
packaging/aur/PKGBUILD
Normal file
@@ -0,0 +1,23 @@
|
||||
pkgname=openwork
|
||||
pkgver=0.3.4
|
||||
pkgrel=1
|
||||
pkgdesc="OpenWork desktop app (binary release)"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/different-ai/openwork"
|
||||
license=('MIT')
|
||||
depends=(
|
||||
'gtk3'
|
||||
'glib2'
|
||||
'libayatana-appindicator'
|
||||
'libsoup3'
|
||||
'webkit2gtk-4.1'
|
||||
'openssl'
|
||||
'dbus'
|
||||
'librsvg'
|
||||
)
|
||||
source=("openwork-desktop-linux-amd64.deb::https://github.com/different-ai/openwork/releases/download/v${pkgver}/openwork-desktop-linux-amd64.deb")
|
||||
sha256sums=('16d1d02d508beacd0582be61a14b94cfdb6c0dca3c26ed83b0b2ffa2c619a07a')
|
||||
|
||||
package() {
|
||||
bsdtar -xf "${srcdir}/openwork-desktop-linux-amd64.deb" -C "${pkgdir}"
|
||||
}
|
||||
46
scripts/aur/open-pr.sh
Executable file
46
scripts/aur/open-pr.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
|
||||
TAG="${1:-${RELEASE_TAG:-}}"
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Missing release tag (arg or RELEASE_TAG)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$TAG" != v* ]]; then
|
||||
TAG="v${TAG}"
|
||||
fi
|
||||
|
||||
VERSION="${TAG#v}"
|
||||
"${ROOT_DIR}/scripts/aur/update-aur.sh" "$TAG"
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if ! git status --porcelain -- packaging/aur/PKGBUILD packaging/aur/.SRCINFO | grep -q .; then
|
||||
echo "AUR packaging already up to date."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
BRANCH="chore/aur-${VERSION}"
|
||||
git switch -c "$BRANCH" 2>/dev/null || git switch "$BRANCH"
|
||||
|
||||
git add packaging/aur/PKGBUILD packaging/aur/.SRCINFO
|
||||
git -c user.name="OpenWork Release Bot" \
|
||||
-c user.email="release-bot@users.noreply.github.com" \
|
||||
commit -m "chore(aur): update PKGBUILD for ${VERSION}"
|
||||
|
||||
git push --set-upstream origin "$BRANCH"
|
||||
|
||||
if gh pr list --head "$BRANCH" --state open --json number --jq 'length > 0' | grep -q true; then
|
||||
echo "PR already open for ${BRANCH}."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
gh pr create --title "chore(aur): update PKGBUILD for ${VERSION}" --base dev --body "$(cat <<'EOF'
|
||||
## Summary
|
||||
- Update AUR PKGBUILD and .SRCINFO for the ${VERSION} release
|
||||
- Refresh sha256 for the Linux .deb release asset
|
||||
EOF
|
||||
)"
|
||||
77
scripts/aur/update-aur.sh
Executable file
77
scripts/aur/update-aur.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
PKG_DIR="${ROOT_DIR}/packaging/aur"
|
||||
PKGBUILD="${PKG_DIR}/PKGBUILD"
|
||||
SRCINFO="${PKG_DIR}/.SRCINFO"
|
||||
|
||||
TAG="${1:-${RELEASE_TAG:-}}"
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Missing release tag (arg or RELEASE_TAG)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$TAG" != v* ]]; then
|
||||
TAG="v${TAG}"
|
||||
fi
|
||||
|
||||
VERSION="${TAG#v}"
|
||||
ASSET_NAME="${AUR_ASSET_NAME:-openwork-desktop-linux-amd64.deb}"
|
||||
ASSET_URL="https://github.com/different-ai/openwork/releases/download/${TAG}/${ASSET_NAME}"
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
trap 'rm -rf "$TMP_DIR"' EXIT
|
||||
|
||||
curl -fsSL -o "${TMP_DIR}/${ASSET_NAME}" "$ASSET_URL"
|
||||
|
||||
SHA256=$(python - "${TMP_DIR}/${ASSET_NAME}" <<'PY'
|
||||
import hashlib
|
||||
import sys
|
||||
|
||||
path = sys.argv[1]
|
||||
hasher = hashlib.sha256()
|
||||
with open(path, "rb") as handle:
|
||||
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
|
||||
hasher.update(chunk)
|
||||
print(hasher.hexdigest())
|
||||
PY
|
||||
)
|
||||
|
||||
python - "$PKGBUILD" "$VERSION" "$SHA256" <<'PY'
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
path = pathlib.Path(sys.argv[1])
|
||||
version = sys.argv[2]
|
||||
sha = sys.argv[3]
|
||||
|
||||
text = path.read_text()
|
||||
text = re.sub(r"^pkgver=.*$", f"pkgver={version}", text, flags=re.M)
|
||||
text = re.sub(r"^sha256sums=.*$", f"sha256sums=('{sha}')", text, flags=re.M)
|
||||
path.write_text(text)
|
||||
PY
|
||||
|
||||
python - "$SRCINFO" "$VERSION" "$SHA256" "$ASSET_URL" "$ASSET_NAME" <<'PY'
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
path = pathlib.Path(sys.argv[1])
|
||||
version = sys.argv[2]
|
||||
sha = sys.argv[3]
|
||||
url = sys.argv[4]
|
||||
asset = sys.argv[5]
|
||||
|
||||
text = path.read_text()
|
||||
text = re.sub(r"^\s*pkgver = .*", f" pkgver = {version}", text, flags=re.M)
|
||||
text = re.sub(
|
||||
r"^\s*source = .*",
|
||||
f" source = {asset}::{url}",
|
||||
text,
|
||||
flags=re.M,
|
||||
)
|
||||
text = re.sub(r"^\s*sha256sums = .*", f" sha256sums = {sha}", text, flags=re.M)
|
||||
path.write_text(text)
|
||||
PY
|
||||
Reference in New Issue
Block a user