Files
grok-bot-bin/.gitea/workflows/build.yml
T
s1d3sw1ped_bot e12f2bf6ef
Build Arch package / build (push) Successful in 27s
ci: Install node in Arch container for checkout
actions/checkout@v4 needs node; the archlinux:base-devel container only
had git installed first, so checkout failed with exit 127 (Actions run
1171). Install git, nodejs-lts-jod, npm, sudo, and jq before checkout.

#1
2026-09-02 01:27:11 +00:00

49 lines
1.9 KiB
YAML

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 nodejs-lts-jod npm sudo jq
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")"