build / build (push) Failing after 1m56s
bawnet repos are forward facing: a bit of code we made and use, available. References to the private ops/features tracker and ops/psn-docker README become plain words, a named operator quote is gone, the bugs link points at this repo's own issues. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
79 lines
3.9 KiB
YAML
79 lines
3.9 KiB
YAML
name: build
|
|
|
|
# Builds the Nextcloud app archive on the psn runner, following the same shape
|
|
# as the rest of the fleet: run directly on the runner, clone by hand with credentials
|
|
# from /etc/psn-ci.env, and shell out to docker. No marketplace actions and no
|
|
# `container:` key -- neither is available here.
|
|
#
|
|
# The toolchain comes from psn-base + deb.bawnet.io, notably composer: upstream's
|
|
# `make composer` falls back to piping getcomposer.org/installer into php when
|
|
# composer is absent, and this node does not run pipe-to-shell installers.
|
|
#
|
|
# `npm ci` fetching from the public registry is the one non-sovereign hop.
|
|
# package-lock.json pins every dependency with an integrity hash.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: psn
|
|
steps:
|
|
- name: build app archive
|
|
run: |
|
|
set -e
|
|
. /etc/psn-ci.env
|
|
# cleanup in a trap: under `set -e` a failed build exits before a
|
|
# trailing rm and leaks the checkout into /tmp (tmpfs = RAM). The
|
|
# container writes node_modules/vendor as root, so hand the tree back
|
|
# to the runner's uid first or the rm fails; both || true so cleanup
|
|
# can never change the step's verdict.
|
|
WORK=$(mktemp -d)
|
|
trap 'docker run --rm -v "$WORK":/w code.bawnet.io/ops/psn-base:latest chown -R "$(id -u):$(id -g)" /w >/dev/null 2>&1 || true; rm -rf "$WORK" || true' EXIT INT TERM
|
|
OUT=/var/tmp/psn-artifacts/integration_gotosocial
|
|
git clone -q "https://$CI_USER:$CI_TOKEN@code.bawnet.io/bawnet/integration_gotosocial" "$WORK"
|
|
VERSION=$(sed -n 's:.*<version>\(.*\)</version>.*:\1:p' "$WORK/appinfo/info.xml" | head -1)
|
|
echo "building integration_gotosocial $VERSION from $(cd "$WORK" && git rev-parse --short HEAD)"
|
|
mkdir -p "$OUT"
|
|
|
|
# 1.1.0 (the fixed-instance build): Pinnacle is NO LONGER bundled -- it ships
|
|
# inside the node GoToSocial image (served at <instance>/pinnacle/).
|
|
# This job packages the NC app only.
|
|
|
|
docker run --rm -v "$WORK":/src -v "$OUT":/out -w /src \
|
|
code.bawnet.io/ops/psn-base:latest \
|
|
bash -euo pipefail -c "
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get update -qq
|
|
apt-get install -y -qq --no-install-recommends \
|
|
nodejs npm php-cli php-xml php-mbstring php-zip \
|
|
composer git make rsync sudo ca-certificates >/dev/null
|
|
node --version; npm --version
|
|
command -v composer >/dev/null || {
|
|
echo 'FATAL: composer absent - makefile would pipe an installer to php'; exit 1; }
|
|
|
|
composer install --prefer-dist --no-interaction --no-progress -q
|
|
npm ci --no-audit --no-fund
|
|
npm run build
|
|
|
|
# every PHP file must parse before we package it
|
|
find lib -name '*.php' -exec php -l {} \; | grep -v 'No syntax errors' && exit 1
|
|
|
|
# widget IDs are global in Nextcloud: they must not collide with
|
|
# integration_mastodon, and the JS registrations must match the PHP
|
|
php_ids=\$(grep -ho \"return 'gotosocial_[a-z_]*'\" lib/Dashboard/*.php | sed \"s/return '//;s/'//\" | sort)
|
|
js_ids=\$(grep -ho \"OCA.Dashboard.register('[^']*'\" src/dashboard.js src/dashboardHome.js | sed \"s/.*register('//;s/'//\" | sort)
|
|
[ \"\$php_ids\" = \"\$js_ids\" ] || { echo \"FATAL: widget ID mismatch\"; echo \"php: \$php_ids\"; echo \"js: \$js_ids\"; exit 1; }
|
|
grep -rq \"return 'mastodon_\" lib/Dashboard/ && { echo 'FATAL: upstream widget ID would collide'; exit 1; }
|
|
|
|
make appstore version=$VERSION
|
|
cp /tmp/build/integration_gotosocial-$VERSION.tar.gz /out/
|
|
cd /out && sha256sum integration_gotosocial-$VERSION.tar.gz \
|
|
| tee integration_gotosocial-$VERSION.tar.gz.sha256
|
|
"
|
|
|
|
echo "artifact:"; ls -lh "$OUT"
|