mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
The v13.18 release run: every wekan and wekan-gantt-gpl snap uploaded,
then sat in the Snap Store's "Status: processing" for hours. snapcraft
polls that with no limit, so GitHub cancelled the jobs at timeout-minutes
(2 h native, 6 h Launchpad). snap-upload-retry.sh now gives one upload
30 minutes (SNAP_UPLOAD_PROCESSING_BUDGET). A revision the store accepted
is left for the store to release to the channels sent with it, with a
warning, instead of uploading it again; an upload cut off before the
store accepted it is retried.
Bun android-arm64 died on a Termux mirror mid-sync ("File has unexpected
size ... Mirror sync in progress?") and Bun freebsd-x64 on an unreachable
FreeBSD package mirror. Termux installs (Bun, Android bundles) and the
i386 libraries of single-file now go through releases/apt-install.sh,
which learned Termux's prefix and lack of sudo. Every BSD VM prepare
retries its package install 5 times and says why when it gives up.
Thanks to xet7 !
247 lines
11 KiB
YAML
247 lines
11 KiB
YAML
name: BSD bundles
|
|
|
|
# WeKan Node.js bundles for the BSDs (docs/Platforms/FOSS/OS/BSD.md): the
|
|
# release's amd64 bundle, with this BSD's Node.js (wekan/node-patches) and
|
|
# FerretDB (wekan/FerretDB), its native modules compiled inside a VM of that
|
|
# BSD, started there with its own start-wekan.sh, and attached to the release.
|
|
#
|
|
# A target whose Node.js is not published anywhere yet is SKIPPED, not failed:
|
|
# the same rule as every other bundle (releases/resolve-node-source.sh). So
|
|
# OpenBSD and NetBSD start building by themselves the day node-patches
|
|
# publishes their Node.js.
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Existing WeKan release tag (empty = latest published release)'
|
|
type: string
|
|
required: false
|
|
publish:
|
|
description: 'Attach tested BSD bundles and checksums to that release'
|
|
type: boolean
|
|
default: true
|
|
only:
|
|
description: 'JSON target list, e.g. ["freebsd-x64"] (empty = all)'
|
|
type: string
|
|
default: ''
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
type: string
|
|
required: true
|
|
publish:
|
|
type: boolean
|
|
default: true
|
|
only:
|
|
type: string
|
|
default: ''
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: wekan-bsd-${{ inputs.tag || github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
NODE_VERSION: '26'
|
|
|
|
jobs:
|
|
plan:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
outputs:
|
|
tag: ${{ steps.plan.outputs.tag }}
|
|
matrix: ${{ steps.plan.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- id: plan
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ inputs.tag }}
|
|
ONLY: ${{ inputs.only }}
|
|
run: |
|
|
set -euo pipefail
|
|
tag="${TAG:-$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName)}"
|
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
matrix="$(python3 -c '
|
|
import json, os
|
|
targets = json.load(open("releases/bsd/targets.json"))
|
|
only = json.loads(os.environ.get("ONLY") or "[]")
|
|
if only:
|
|
targets = [t for t in targets if t["target"] in only]
|
|
print(json.dumps({"include": targets}))')"
|
|
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
|
echo "Release $tag; targets: $matrix"
|
|
|
|
build:
|
|
needs: plan
|
|
name: BSD ${{ matrix.target }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 180
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
|
env:
|
|
TAG: ${{ needs.plan.outputs.tag }}
|
|
TARGET: ${{ matrix.target }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# Node.js first: no Node.js for this BSD anywhere means no bundle this
|
|
# release, which is a skip, not a failure.
|
|
- name: Where this BSD's Node.js comes from
|
|
id: node
|
|
run: |
|
|
set -euo pipefail
|
|
out="$(bash releases/resolve-node-source.sh "$TARGET" "$NODE_VERSION")" || rc=$?
|
|
if [ "${rc:-0}" = 3 ] || ! printf '%s\n' "$out" | grep -q '^node_found=true'; then
|
|
echo "::notice::$TARGET is not built this release: wekan/node-patches has no node-$TARGET yet."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|sha256)=' >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out"
|
|
|
|
- name: Fetch and verify the release bundle, Node.js, npm and FerretDB
|
|
if: steps.node.outputs.skip != 'true'
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
NODE_URL: ${{ steps.node.outputs.node_url }}
|
|
NODE_SHA256: ${{ steps.node.outputs.node_sha256 }}
|
|
NODE_FULL: ${{ steps.node.outputs.node_full }}
|
|
FERRETDB_ARCH: ${{ matrix.ferretdb_arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
version="${TAG#v}"
|
|
gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern "wekan-${version}-amd64.zip" --pattern "wekan-${version}-amd64.zip.sha256sum"
|
|
sha256sum -c "wekan-${version}-amd64.zip.sha256sum"
|
|
unzip -q "wekan-${version}-amd64.zip"
|
|
mkdir -p bsd-tools/bin bsd-tools/npm
|
|
bash releases/fetch.sh -o bsd-tools/bin/node "$NODE_URL"
|
|
[ -z "$NODE_SHA256" ] || echo "$NODE_SHA256 bsd-tools/bin/node" | sha256sum -c -
|
|
# npm is JavaScript: the one in nodejs.org's Linux tarball of the same
|
|
# version runs on any Node.js 26.
|
|
bash releases/fetch.sh -o npm.tar.xz "https://nodejs.org/dist/${NODE_FULL}/node-${NODE_FULL}-linux-x64.tar.xz"
|
|
tar -xJf npm.tar.xz --strip-components=4 -C bsd-tools/npm "node-${NODE_FULL}-linux-x64/lib/node_modules/npm"
|
|
rm -f npm.tar.xz
|
|
# The prebuilt SQLite-only ferretdb-sqlite-<bsd>-<arch> from the newest
|
|
# wekan/FerretDB release that has it (the full ferretdb-<bsd>-<arch> of
|
|
# the newest release until one does), verified against its .sha256sum;
|
|
# releases/ferretdb-asset.sh says in the log which one it took.
|
|
ferret_meta="$(bash releases/ferretdb-asset.sh "$FERRETDB_ARCH" -o bundle/ferretdb)" \
|
|
|| { echo "::error::FerretDB for ${FERRETDB_ARCH} could not be put in the bundle; the lines above say why."; exit 1; }
|
|
eval "$ferret_meta"
|
|
# The inherited amd64 Linux MongoDB Database Tools are the wrong OS
|
|
# here: replaced by this BSD's, or removed when there are none.
|
|
rc=0; bash releases/fetch-mongo-tools.sh bundle "$FERRETDB_ARCH" || rc=$?
|
|
[ "$rc" != 2 ] || { echo "::error::A MongoDB Database Tools download did not match its checksum."; exit 1; }
|
|
[ "$rc" = 0 ] || echo "::warning::No MongoDB Database Tools for ${FERRETDB_ARCH}; the bundle ships without them."
|
|
file bsd-tools/bin/node bundle/ferretdb
|
|
|
|
- name: Build and start in FreeBSD
|
|
if: steps.node.outputs.skip != 'true' && matrix.os == 'freebsd'
|
|
uses: vmactions/freebsd-vm@811efaaac0668df8bfb8308c3ec997b5ab50037b
|
|
with:
|
|
release: ${{ matrix.release }}
|
|
arch: ${{ matrix.vm_arch }}
|
|
sync: rsync
|
|
copyback: true
|
|
prepare: |
|
|
# A package mirror that is briefly unreachable ("No route to host",
|
|
# v13.18) is waited out instead of failing the build.
|
|
for i in 1 2 3 4 5; do
|
|
pkg install -y bash python3 gmake pkgconf curl && break
|
|
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
|
echo "Package install failed (attempt $i/5), retrying."
|
|
sleep $((i * 30))
|
|
done
|
|
run: bash releases/bsd/build-bundle.sh freebsd ${{ matrix.arch }}
|
|
|
|
- name: Build and start in OpenBSD
|
|
if: steps.node.outputs.skip != 'true' && matrix.os == 'openbsd'
|
|
uses: vmactions/openbsd-vm@f1ca8bc8ecc5b6ef7218e5b914836e067e1546d3 # v1.4.9
|
|
with:
|
|
release: ${{ matrix.release }}
|
|
arch: ${{ matrix.vm_arch }}
|
|
sync: rsync
|
|
copyback: true
|
|
prepare: |
|
|
# A package mirror that is briefly unreachable ("No route to host",
|
|
# v13.18) is waited out instead of failing the build.
|
|
for i in 1 2 3 4 5; do
|
|
pkg_add bash python%3 gmake curl && break
|
|
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
|
echo "Package install failed (attempt $i/5), retrying."
|
|
sleep $((i * 30))
|
|
done
|
|
# V8 writes and runs machine code: OpenBSD allows that only from a
|
|
# filesystem mounted wxallowed (/usr/local is, by default). The
|
|
# bundle is started here, from the workspace, so that is mounted so.
|
|
run: |
|
|
mount -u -o wxallowed "$(df -P . | awk 'NR==2 {print $6}')" || true
|
|
bash releases/bsd/build-bundle.sh openbsd ${{ matrix.arch }}
|
|
|
|
- name: Build and start in NetBSD
|
|
if: steps.node.outputs.skip != 'true' && matrix.os == 'netbsd'
|
|
uses: vmactions/netbsd-vm@5957cf330aef2e6ddc63c604364c99ce2e02b91d # v1.5.3
|
|
with:
|
|
release: ${{ matrix.release }}
|
|
sync: rsync
|
|
copyback: true
|
|
prepare: |
|
|
# A package mirror that is briefly unreachable ("No route to host",
|
|
# v13.18) is waited out instead of failing the build.
|
|
for i in 1 2 3 4 5; do
|
|
{ command -v pkgin >/dev/null || /usr/sbin/pkg_add pkgin; } &&
|
|
pkgin -y install bash python313 gmake curl gcc14 && break
|
|
[ "$i" = 5 ] && { echo "::error::Installing the VM's packages failed 5 times: the package mirror is down, not WeKan. Re-run this job."; exit 1; }
|
|
echo "Package install failed (attempt $i/5), retrying."
|
|
sleep $((i * 30))
|
|
done
|
|
# Node 26's headers need C++20, which NetBSD 10's own GCC lacks: the
|
|
# native modules are compiled with pkgsrc's GCC 14, as Node.js itself
|
|
# is (wekan/node-patches dist/netbsd).
|
|
run: |
|
|
CC=/usr/pkg/gcc14/bin/gcc CXX=/usr/pkg/gcc14/bin/g++ \
|
|
bash releases/bsd/build-bundle.sh netbsd ${{ matrix.arch }}
|
|
|
|
- name: Zip, checksum and attach
|
|
if: steps.node.outputs.skip != 'true'
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
PUBLISH: ${{ inputs.publish }}
|
|
MATRIX_OS: ${{ matrix.os }}
|
|
run: |
|
|
set -euo pipefail
|
|
version="${TAG#v}"
|
|
zip="wekan-${version}-${TARGET}.zip"
|
|
python3 releases/check-telemetry.py --bundle bundle
|
|
zip -qr "$zip" bundle
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node bundle/ferretdb bundle/start-wekan.sh; do
|
|
grep -q " $want$" zip-listing.txt || { echo "::error::$zip has no $want."; exit 1; }
|
|
done
|
|
if [ "${MATRIX_OS}" = freebsd ]; then
|
|
grep -q " bundle/rc.d/wekan$" zip-listing.txt || { echo "::error::$zip has no bundle/rc.d/wekan (#2662)."; exit 1; }
|
|
fi
|
|
sha256sum "$zip" > "$zip.sha256sum"
|
|
cat "$zip.sha256sum"
|
|
if [ "$PUBLISH" = true ]; then
|
|
bash releases/github-release-upload.sh "$GITHUB_REPOSITORY" "$TAG" "$zip" "$zip.sha256sum"
|
|
fi
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.node.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-${{ matrix.target }}
|
|
path: wekan-*-${{ matrix.target }}.zip*
|
|
retention-days: 3
|
|
compression-level: 0
|