Temporary Arch/CachyOS packaging until upstream ships a native package. Pulls Cursor's amd64 deb by commit from the linux-x64 update feed. Includes update script and Gitea Actions for bump + makepkg release.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
name: Build Arch package
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: archlinux:base-devel
|
||||
steps:
|
||||
- name: Prepare build user
|
||||
run: |
|
||||
pacman -Syu --noconfirm git
|
||||
useradd -m builder
|
||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
|
||||
chmod 440 /etc/sudoers.d/builder
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build package
|
||||
run: |
|
||||
chown -R builder:builder .
|
||||
sudo -u builder makepkg -sf --noconfirm
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: grok-bot-bin
|
||||
path: '*.pkg.tar.zst'
|
||||
if-no-files-found: error
|
||||
- name: Attach package to Gitea release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
ver="${tag#v}"
|
||||
pkg=$(ls -1 *.pkg.tar.zst | head -1)
|
||||
api="${GITHUB_API_URL:-https://git.s1d3sw1ped.com/api/v1}/repos/${GITHUB_REPOSITORY}/releases"
|
||||
# create release if missing
|
||||
curl -fsS -X POST -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${tag}\",\"name\":\"${tag}\",\"body\":\"grok-bot-bin ${ver} (official .deb repackaged)\"}" \
|
||||
"$api" || true
|
||||
rid=$(curl -fsS -H "Authorization: token ${GITEA_TOKEN}" "$api/tags/${tag}" | jq -r .id)
|
||||
curl -fsS -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$pkg" \
|
||||
"${GITHUB_SERVER_URL:-https://git.s1d3sw1ped.com}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${rid}/assets?name=$(basename "$pkg")"
|
||||
Reference in New Issue
Block a user