mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
5770 lines
313 KiB
YAML
5770 lines
313 KiB
YAML
name: Release All Platforms
|
|
run-name: Release v${{ inputs.new_version }}
|
|
|
|
# Triggered manually via GitHub CLI or the Actions UI.
|
|
# Usage:
|
|
# gh workflow run release-all.yml -f old_version=9.35 -f new_version=9.36
|
|
#
|
|
# Or use the convenience script (bumps versions, commits, pushes, then triggers):
|
|
# ./releases/release-all.sh 9.35 9.36
|
|
#
|
|
# WeKan's default database is MongoDB, which ships server binaries only for amd64
|
|
# and arm64 (+ the win64/mac bundles). On every OTHER architecture that has a
|
|
# Node.js 26 build — ppc64le, s390x, riscv64 — there is no MongoDB, so those
|
|
# bundles ship FerretDB v1 instead: the wekan/FerretDB fork with its embedded
|
|
# pure-Go SQLite backend, which speaks the MongoDB wire protocol. FerretDB is
|
|
# built + released SEPARATELY (wekan/FerretDB, its own build.sh) as individual
|
|
# per-arch binaries; each bundle job downloads ONLY the ferretdb-<arch> binary for
|
|
# the platform it targets and bakes it in, so amd64/arm64 users can opt into it
|
|
# too (WEKAN_DB=ferretdb, `snap set wekan
|
|
# database=ferretdb`, or Docker env). Whichever backend is chosen binds the same
|
|
# MongoDB port, so MONGO_URL is unchanged. ppc64le/s390x/riscv64 are now covered
|
|
# by the Docker image as well (self-contained, FerretDB auto-started). riscv64
|
|
# uses unofficial-builds.nodejs.org for Node 26. (armv7l/32-bit ARM is still not
|
|
# built: there is NO Node.js 26 build for it anywhere, so nothing could run it.)
|
|
#
|
|
# This workflow does EVERYTHING for a release remotely (nothing is built or
|
|
# pushed on the maintainer's machine), running jobs in parallel where possible:
|
|
# - bump: runs releases/version.sh + releases/rebuild-docs.sh on the runner
|
|
# (bumps Node/MongoDB/WeKan versions, rebuilds API docs), then
|
|
# commits and pushes the bump to wekan/wekan main
|
|
# - prepare: tags the bumped main as v<new_version> and extracts release notes
|
|
# - website: updates the wekan/wekan.fi repo (install page + API docs) and pushes
|
|
# - charts: updates and publishes the wekan/charts Helm chart and pushes,
|
|
# only AFTER the `docker` job has published the image (skipped if
|
|
# docker fails)
|
|
# - build-*: builds the amd64 bundle (full Meteor 3 build), then rebuilds native
|
|
# modules for arm64 from that amd64 base. Each bundle job downloads
|
|
# only the ferretdb-<arch> binary it needs from the newest wekan/FerretDB
|
|
# release (FerretDB is built + released separately by its own build.sh —
|
|
# not compiled here) and embeds it
|
|
# - release: writes the newest CHANGELOG-big.md notes to the GitHub Release and
|
|
# checks the core wekan-<version>-{amd64,arm64}.zip bundles are on
|
|
# it. It uploads nothing: EVERY job that builds a release file
|
|
# attaches it itself, as its last step, the moment it is built and
|
|
# checked (releases/github-release-upload.sh, retried and verified).
|
|
# build-amd64 creates the release (releases/ensure-github-release.sh)
|
|
# right before attaching the first file. Those attach steps run on
|
|
# always() + "the build step succeeded", so cancelling a run still
|
|
# leaves every file that had finished building on the release
|
|
# - appimage: AFTER release, calls AppImage.yml to wrap those two core bundles
|
|
# for every AppImage runtime architecture they can serve, smoke-tests
|
|
# the runnable images and attaches them to the same GitHub Release
|
|
# - build-win64 / build-win-arm64 / build-mac-arm64 / build-extra-arches: built
|
|
# AFTER release, each
|
|
# rebuilds the amd64 bundle's native modules for its platform (Windows,
|
|
# macOS arm64, and QEMU-emulated ppc64le/s390x/riscv64) and attaches
|
|
# its .zip to the Release. Windows/macOS strip the Linux FerretDB back
|
|
# out (MongoDB-only). Decoupled from `release` so a slow/flaky build
|
|
# never blocks it
|
|
# - build-sandstorm: built AFTER release, builds the Sandstorm .spk package
|
|
# (same steps as the standalone sandstorm.yml workflow, which still
|
|
# exists for testing the .spk build on its own) and attaches
|
|
# wekan-<version>-sandstorm.spk to the Release. Non-blocking: the
|
|
# Sandstorm build is the experimental/fragile part of CI, so it
|
|
# never fails the release
|
|
# - docker: builds and pushes the multi-arch image (amd64, arm64, ppc64le, s390x,
|
|
# riscv64) to Docker Hub, Quay.io, GHCR - and on GHCR also under the
|
|
# two variant names, wekan-ondra and wekan-gantt-gpl, which are the
|
|
# same image (the variant repos differ only in the snap name)
|
|
# - snap: builds the snap from the default core24 snapcraft.yaml and pushes it
|
|
# to the Snap Store stable + candidate + beta + edge channels, and
|
|
# attaches the .snap files to the GitHub Release. Two jobs: snap-native
|
|
# builds amd64 + arm64 on native runners, snap-launchpad builds
|
|
# ppc64el + s390x + riscv64 with `snapcraft remote-build` on Launchpad,
|
|
# which is the only mechanism that supports core24 on an arch with no
|
|
# native runner. core24 allows stable and candidate (core26 does not).
|
|
# snap-variants publishes the SAME snap under the two older names
|
|
# people still have installed, wekan-ondra and wekan-gantt-gpl, on
|
|
# amd64 + arm64 - so one release publishes all THREE snaps. It needs
|
|
# SNAP_AUTH to carry the ACL for all three names.
|
|
# `snap set wekan database=ferretdb` switches the running backend to
|
|
# FerretDB v1 (snapcraft-core26.yaml is the core26 variant)
|
|
#
|
|
# Required GitHub Secrets:
|
|
# GHCR_AUTH - base64("username:token") for ghcr.io
|
|
# DOCKERHUB_AUTH - base64("username:token") for Docker Hub
|
|
# QUAY_AUTH - base64("username:token") for Quay.io
|
|
# SNAP_AUTH - Snap Store credentials (output of `snapcraft export-login`)
|
|
# LP_CREDENTIALS - base64 of the Launchpad credentials file used by
|
|
# `snapcraft remote-build` (see releases/snap-build.sh notes)
|
|
# SANDSTORM_KEYRING - base64 of ~/.sandstorm-keyring; meteor-spk signs the .spk
|
|
# with the WeKan Sandstorm app's private key from this keyring
|
|
# WEKAN_REPO_TOKEN - Personal Access Token with write access to wekan/wekan.fi
|
|
# and wekan/charts, used by the website + charts jobs to push
|
|
# to those repos (the built-in GITHUB_TOKEN only covers
|
|
# wekan/wekan). See releases/create-github-secrets.sh.
|
|
# Also needs write access to wekan/wekan-ondra,
|
|
# wekan/wekan-gantt-gpl for the snap-variants job below.
|
|
# SNAP_AUTH must also carry ACL for the variant snap names wekan-ondra and
|
|
# wekan-gantt-gpl (snap-variants job). See
|
|
# docs/Platforms/FOSS/Container/Snap/Snap-Ondra-Gantt.md.
|
|
#
|
|
# Reading the logs: every job ends with a "Job result" step that runs whatever
|
|
# happened, so the run summary is a list of OK / FAILED / CANCELLED, one line per
|
|
# job. Inside a job, each check prints either an "OK: ..." line saying what it
|
|
# verified or an ::error:: saying what was expected, what was found, and what to
|
|
# do about it - so "which step failed, and why" is answerable from the log alone.
|
|
# The checks cover what silently produced a broken release before: an empty
|
|
# version bump, missing release notes, a zip without bundle/main.js, an upload
|
|
# that reported success but left no asset, and a Docker manifest missing a CPU.
|
|
#
|
|
# EVERY job that needs a secret checks it in its FIRST step and says, by name,
|
|
# which one is missing - and, where a cheap check exists, whether it actually
|
|
# WORKS: the GitHub token is asked whether it can push to the repo it is for, the
|
|
# three registry credentials are decoded and logged in with, and the base64 ones
|
|
# are decoded. What only the far end can answer - whether the Snap Store accepts
|
|
# SNAP_AUTH, whether Launchpad accepts LP_CREDENTIALS - is answered at the step
|
|
# that uses it, which then names the secret in the log instead of leaving a bare
|
|
# 401 behind. So a missing or broken secret is always ONE named line, near the top.
|
|
#
|
|
# The snap-variants jobs are guarded: if their secrets are not
|
|
# set they log a ::warning:: and skip, so they never break an ordinary release.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
old_version:
|
|
description: 'Previous version number (e.g. 9.35, without v prefix)'
|
|
required: true
|
|
type: string
|
|
new_version:
|
|
description: 'New version number (e.g. 9.36, without v prefix)'
|
|
required: true
|
|
type: string
|
|
|
|
# Read-only by default: each job that writes (git push, a release asset, an
|
|
# image) is granted exactly that below (zizmor excessive-permissions).
|
|
permissions:
|
|
contents: read
|
|
|
|
# Node.js major version that Meteor 3.6-beta.1 bundles. Used for native module
|
|
# rebuilds on every platform — it must match the amd64 build's Node ABI.
|
|
env:
|
|
DO_NOT_TRACK: '1'
|
|
NODE_VERSION: '26'
|
|
# Authenticate the api.github.com calls that embed-verified-node.sh and
|
|
# check-arch-binaries.sh make to resolve the fork's newest v26.x tag. Without a
|
|
# token those are UNauthenticated (60 requests/hour per IP, shared across all
|
|
# runners), which 403-rate-limits intermittently — that is why one native embed
|
|
# (e.g. mac-arm64) could fail the major→tag resolution while another (amd64,
|
|
# which ran first) succeeded. github.token is the standard Actions token; a
|
|
# public-repo read with it gets the 5000/hour authenticated limit.
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
jobs:
|
|
|
|
# ─── 0. Bump versions + rebuild API docs, commit to main ────────────────────
|
|
# Runs releases/version.sh (probes upstream for the newest Node.js/MongoDB,
|
|
# bumps every version reference) and releases/rebuild-docs.sh (regenerates
|
|
# public/api/wekan.yml + wekan.html), then commits and pushes to main so the
|
|
# tag, builds, website and charts jobs all see the bumped sources.
|
|
bump:
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# rewrites version references and rebuilds the docs; minutes, not tens of them.
|
|
timeout-minutes: 30
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
# Shallow: this job reads the tree, commits the version bump on top of it
|
|
# and pushes - none of which needs history.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
|
|
- name: Validate release notes before changing versions
|
|
env:
|
|
RELEASE_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
mkdir -p "$GITHUB_WORKSPACE/.tools/tmp"
|
|
export TMPDIR="$GITHUB_WORKSPACE/.tools/tmp"
|
|
bash releases/release-notes.sh "${RELEASE_VERSION#v}" > /dev/null
|
|
|
|
- name: Check dependency risk indicators before release work
|
|
shell: bash
|
|
run: python3 releases/remote-release.py --audit
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash releases/use-release-npm.sh
|
|
|
|
- name: Install version-bump and docs build dependencies
|
|
run: |
|
|
bash "$GITHUB_WORKSPACE/releases/apt-install.sh" python3 python3-pip curl wget
|
|
|
|
- name: Bump versions and rebuild API docs
|
|
env:
|
|
# Builds fetch dependencies from upstream themselves, so skip the slow
|
|
# pre-download of Node/MongoDB tarballs that the local flow does.
|
|
RELEASE_SKIP_DEP_DOWNLOAD: '1'
|
|
INPUT_OLD_VERSION: ${{ inputs.old_version }}
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
./releases/version.sh "${INPUT_OLD_VERSION}" "${INPUT_NEW_VERSION}"
|
|
./releases/rebuild-docs.sh "${INPUT_NEW_VERSION}"
|
|
|
|
- name: Recheck dependency review after version preparation
|
|
run: python3 releases/remote-release.py --audit
|
|
|
|
- name: Verify every release version reference
|
|
env:
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
node ./releases/verify-release-versions.mjs "${INPUT_NEW_VERSION}"
|
|
|
|
- name: Commit and push version bump
|
|
env:
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
git add --all
|
|
if git diff --cached --quiet; then
|
|
# Not fatal - a re-run of the same release bumps nothing - but it is not
|
|
# the normal case, so it must be visible rather than a line of prose.
|
|
echo "::warning::bump: nothing to commit. Either the versions were already at v${INPUT_NEW_VERSION} (a re-run), or releases/version.sh changed no file - its output above says which."
|
|
else
|
|
git commit -m "Bump versions for v${INPUT_NEW_VERSION}"
|
|
if ! git push origin main; then
|
|
echo "::error::bump: could not push the version bump to main. A branch protection rule, a required review, or a token without write access does this - and the rest of the release would then build the OLD version."
|
|
exit 1
|
|
fi
|
|
echo "OK: bump pushed the version bump to main."
|
|
fi
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark bump"
|
|
echo "$mark bump" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::bump FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 1. Tag the release and extract release notes ───────────────────────────
|
|
prepare:
|
|
permissions:
|
|
contents: write
|
|
needs: bump
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# tags and reads one CHANGELOG section.
|
|
timeout-minutes: 15
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
# No `changelog:` output. The notes are 170 KB and more, which is past the
|
|
# 128 KiB MAX_ARG_STRLEN a single environment variable may hold, so any job
|
|
# consuming them through `env:` fails to start its shell. Jobs read
|
|
# CHANGELOG-big.md from their own checkout instead - see
|
|
# "Check the release notes exist in CHANGELOG-big.md" below.
|
|
steps:
|
|
# Shallow: the only thing history was fetched for was finding out whether
|
|
# the release tag already exists, which the tag step now asks GitHub.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Normalise version from input
|
|
id: version
|
|
env:
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
VERSION="${INPUT_NEW_VERSION}"
|
|
VERSION="${VERSION#v}"
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
# The notes are validated HERE, where a missing CHANGELOG section is still
|
|
# cheap to fix, but they are NOT carried to the release job as a job
|
|
# output. They were, and it broke v10.92: 172,458 characters reached the
|
|
# release step as `env: CHANGELOG:`, and Linux caps a single argv/envp
|
|
# string at MAX_ARG_STRLEN - 128 KiB - so execve refused to start bash at
|
|
# all ("Argument list too long") before a line of the step ran. Each job
|
|
# that needs the notes now extracts them from its own checkout of
|
|
# CHANGELOG-big.md with the same script, straight into a file.
|
|
- name: Check the release notes exist in CHANGELOG-big.md
|
|
env:
|
|
STEP_VERSION_VERSION: ${{ steps.version.outputs.version }}
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION="${STEP_VERSION_VERSION}"
|
|
bash releases/release-notes.sh "$VERSION" > release-notes-body.md
|
|
echo "OK: release notes are $(wc -l < release-notes-body.md) lines / $(wc -c < release-notes-body.md) characters."
|
|
|
|
- name: Create and push tag v${{ steps.version.outputs.version }}
|
|
env:
|
|
STEP_VERSION_VERSION: ${{ steps.version.outputs.version }}
|
|
run: |
|
|
VERSION="${STEP_VERSION_VERSION}"
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
# Asked of GitHub, not of this shallow checkout, which carries no tags:
|
|
# a re-run must find the tag its first run pushed.
|
|
if git ls-remote --exit-code --tags origin "refs/tags/v$VERSION" >/dev/null 2>&1; then
|
|
echo "Tag v$VERSION already exists, leaving it as is."
|
|
else
|
|
git tag -a "v$VERSION" -m "v$VERSION"
|
|
git push origin "v$VERSION"
|
|
fi
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark prepare"
|
|
echo "$mark prepare" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::prepare FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 1b. Update the wekan.fi website repo (parallel) ────────────────────────
|
|
# Publishes version.txt, puts the same WeKan/FerretDB/Meteor/Node/NPM block on
|
|
# the install page, and copies the freshly rebuilt API docs into
|
|
# wekan.fi/api/v<new>, then commits + pushes to wekan/wekan.fi. Runs as soon as
|
|
# `bump` has pushed the bumped sources.
|
|
website:
|
|
needs: bump
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# regenerates and pushes wekan.fi pages.
|
|
timeout-minutes: 20
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
WEKAN_REPO_TOKEN: ${{ secrets.WEKAN_REPO_TOKEN }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${WEKAN_REPO_TOKEN:-}" ] || missing="$missing WEKAN_REPO_TOKEN"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::website: missing repository secret(s):$missing — the website is not updated. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " WEKAN_REPO_TOKEN - a token that can push to wekan/wekan.fi"
|
|
exit 1
|
|
fi
|
|
# Present is not the same as WORKING: an expired, revoked or too-narrow
|
|
# token fails much later, in a checkout or a push, with a message that
|
|
# never names the secret. Ask the API instead - one call, and the log
|
|
# says which secret is wrong and how.
|
|
code=$(curl -sS -o /tmp/repo.json -w '%{http_code}' \
|
|
-H "Authorization: Bearer $WEKAN_REPO_TOKEN" \
|
|
-H "Accept: application/vnd.github+json" \
|
|
"https://api.github.com/repos/wekan/wekan.fi")
|
|
if [ "$code" != "200" ]; then
|
|
echo "::error::website: WEKAN_REPO_TOKEN does not work — GitHub answered HTTP $code for wekan/wekan.fi. Expired, revoked, or without access to that repository."
|
|
exit 1
|
|
fi
|
|
if [ "$(jq -r '.permissions.push // false' /tmp/repo.json)" != "true" ]; then
|
|
echo "::error::website: WEKAN_REPO_TOKEN reaches wekan/wekan.fi but may not PUSH to it. A classic PAT needs the 'repo' scope; a fine-grained PAT needs Contents: Read and write on wekan/wekan.fi."
|
|
exit 1
|
|
fi
|
|
echo "website: WEKAN_REPO_TOKEN works and can push to wekan/wekan.fi."
|
|
|
|
- name: Checkout wekan repo (bumped main, with rebuilt API docs)
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
path: wekan
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 wekan/releases/check-telemetry.py --source wekan
|
|
|
|
- name: Checkout wekan.fi website repo
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: wekan/wekan.fi
|
|
token: ${{ secrets.WEKAN_REPO_TOKEN }}
|
|
path: wekan.fi
|
|
|
|
- name: Update and push website
|
|
env:
|
|
WEBDIR: ${{ github.workspace }}/wekan.fi
|
|
WEKANREPODIR: ${{ github.workspace }}/wekan
|
|
RELEASE_PUSH_WEBSITE: '1'
|
|
INPUT_OLD_VERSION: ${{ inputs.old_version }}
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
cd wekan.fi
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
cd ..
|
|
./wekan/releases/release-website.sh "${INPUT_OLD_VERSION}" "${INPUT_NEW_VERSION}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark website"
|
|
echo "$mark website" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::website FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 1c. Update and publish the Helm chart repo (after docker) ──────────────
|
|
# Bumps the WeKan version in wekan/charts, packages the chart and publishes it
|
|
# to the gh-pages Helm index, then pushes both branches. Runs only AFTER the
|
|
# `docker` job succeeds: the chart points users at the freshly published
|
|
# multi-arch image, so we don't advertise a new chart version until that image
|
|
# is actually on the registries. If `docker` fails, this job is skipped.
|
|
charts:
|
|
needs: docker
|
|
# `always()` so that a CANCELLATION somewhere else in the run cannot skip
|
|
# this job. It is not defensive dressing: in v10.80 the release itself, the
|
|
# image and every bundle were published, and then charts
|
|
# were all skipped the moment `docker` finished - because build-mac-x64 was
|
|
# queued on a retired runner label and had to be cancelled by hand, and a
|
|
# cancelled job cancels the RUN, which skips every job that has not started.
|
|
# A job whose `if` is `always()` still runs while a run is cancelling, so the
|
|
# chart is published for a release that IS on the registries. The guard is
|
|
# then explicit about the only condition that ever mattered: docker SUCCEEDED
|
|
# - the chart points at the image that job pushes, so it must exist first.
|
|
if: ${{ !cancelled() && needs.docker.result == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# packages and pushes one Helm chart.
|
|
timeout-minutes: 20
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
WEKAN_REPO_TOKEN: ${{ secrets.WEKAN_REPO_TOKEN }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${WEKAN_REPO_TOKEN:-}" ] || missing="$missing WEKAN_REPO_TOKEN"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::charts: missing repository secret(s):$missing — the Helm chart is not published. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " WEKAN_REPO_TOKEN - a token that can push to wekan/charts"
|
|
exit 1
|
|
fi
|
|
# Present is not the same as WORKING: an expired, revoked or too-narrow
|
|
# token fails much later, in a checkout or a push, with a message that
|
|
# never names the secret. Ask the API instead - one call, and the log
|
|
# says which secret is wrong and how.
|
|
code=$(curl -sS -o /tmp/repo.json -w '%{http_code}' \
|
|
-H "Authorization: Bearer $WEKAN_REPO_TOKEN" \
|
|
-H "Accept: application/vnd.github+json" \
|
|
"https://api.github.com/repos/wekan/charts")
|
|
if [ "$code" != "200" ]; then
|
|
echo "::error::charts: WEKAN_REPO_TOKEN does not work — GitHub answered HTTP $code for wekan/charts. Expired, revoked, or without access to that repository."
|
|
exit 1
|
|
fi
|
|
if [ "$(jq -r '.permissions.push // false' /tmp/repo.json)" != "true" ]; then
|
|
echo "::error::charts: WEKAN_REPO_TOKEN reaches wekan/charts but may not PUSH to it. A classic PAT needs the 'repo' scope; a fine-grained PAT needs Contents: Read and write on wekan/charts."
|
|
exit 1
|
|
fi
|
|
echo "charts: WEKAN_REPO_TOKEN works and can push to wekan/charts."
|
|
|
|
- name: Checkout wekan repo (for releases/release-charts.sh + version refs)
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
path: wekan
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 wekan/releases/check-telemetry.py --source wekan
|
|
|
|
- name: Checkout wekan/charts repo (main + gh-pages)
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: wekan/charts
|
|
token: ${{ secrets.WEKAN_REPO_TOKEN }}
|
|
fetch-depth: 0
|
|
path: charts
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5.1.0
|
|
|
|
- name: Fetch gh-pages branch (release-charts.sh switches to it)
|
|
run: |
|
|
cd charts
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git fetch origin '+refs/heads/*:refs/remotes/origin/*'
|
|
git branch --track gh-pages origin/gh-pages 2>/dev/null || true
|
|
|
|
- name: Release and publish chart
|
|
env:
|
|
CHARTS_DIR: ${{ github.workspace }}/charts
|
|
INPUT_NEW_VERSION: ${{ inputs.new_version }}
|
|
run: |
|
|
./wekan/releases/release-charts.sh "${INPUT_NEW_VERSION}"
|
|
|
|
# What the index does NOT have, reported every release rather than
|
|
# discovered years later. A chart entry is written once, during the release
|
|
# it belongs to, so a release whose charts job did not run leaves a hole
|
|
# that nothing ever fills - v10.80's, when a cancelled build-mac-x64
|
|
# cancelled the run, is one of many. This is a PLAN ONLY: it reads the
|
|
# releases API, the live index and ghcr, writes nothing, and prints which
|
|
# releases have a chart, which are missing one that could be built, and
|
|
# which are omitted because they have no container image for a chart to
|
|
# point at. Filling them in is `backfill-charts.sh --apply --push`, run by
|
|
# hand: rewriting a published Helm index is not a side effect of a release.
|
|
- name: Report which releases the chart index is missing
|
|
continue-on-error: true
|
|
run: |
|
|
set -o pipefail
|
|
./wekan/releases/backfill-charts.sh | tee -a "$GITHUB_STEP_SUMMARY"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark charts"
|
|
echo "$mark charts" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::charts FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 2. Build amd64 bundle (full Meteor 3 build) ────────────────────────────
|
|
# Meteor 3.6-beta.1 installer supports only Linux x86_64/aarch64, macOS, Windows.
|
|
# The full Meteor build always runs here on x86_64; every other platform then
|
|
# only rebuilds the native npm modules from this bundle.
|
|
build-amd64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare]
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 180
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Cache Meteor installation
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.meteor
|
|
key: meteor-${{ hashFiles('.meteor/release') }}-${{ hashFiles('.meteor/packages') }}
|
|
restore-keys: meteor-
|
|
|
|
- name: Cache npm packages
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.npm
|
|
key: npm-${{ hashFiles('package-lock.json') }}
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
bash "$GITHUB_WORKSPACE/releases/apt-install.sh" libatomic1 build-essential g++ make python3 curl wget zip unzip xz-utils elfutils qemu-user-static
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash releases/use-release-npm.sh
|
|
|
|
- name: Install Meteor
|
|
run: |
|
|
if [ ! -f ~/.meteor/meteor ]; then
|
|
bash "$GITHUB_WORKSPACE/releases/fetch.sh" -o /tmp/install-meteor.sh https://install.meteor.com/
|
|
sh /tmp/install-meteor.sh
|
|
fi
|
|
echo "$HOME/.meteor" >> $GITHUB_PATH
|
|
|
|
- name: Build WeKan bundle
|
|
run: |
|
|
rm -rf .build node_modules .meteor/local
|
|
(meteor update --npm 2>/dev/null || true) && bash releases/npm-retry.sh meteor npm install
|
|
meteor build .build --directory
|
|
|
|
- name: Install server npm modules
|
|
run: |
|
|
node releases/prepare-bundle-npm.mjs .build/bundle
|
|
cd .build/bundle/programs/server
|
|
# BEFORE the first install: Meteor pins programs/server's node-gyp to
|
|
# the one inside the Meteor tool (10.2.0 in 3.5.2), which cannot see
|
|
# Visual Studio 2026 on GitHub's windows-latest image, and every other
|
|
# arch reinstalls programs/server from THIS package.json - so raising
|
|
# the pin here is what lets build-win64 / build-win-arm64 compile
|
|
# argon2 at all (v11.70).
|
|
# On some runner images Meteor leaves this file read-only. Make it
|
|
# writable before the rewrite so a plain EACCES here cannot fail the
|
|
# whole release build (v11.71 build-amd64).
|
|
chmod u+w "$GITHUB_WORKSPACE/.build/bundle/programs/server/package.json"
|
|
node "$GITHUB_WORKSPACE/releases/bump-bundle-node-gyp.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle"
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install
|
|
# node-gyp's tree is 83 of the 120 packages that install leaves behind,
|
|
# and this bundle compiles nothing at run time. Every other arch's
|
|
# bundle is derived from this one, so pruning here prunes them all -
|
|
# they each prune again after their own rebuild anyway.
|
|
node "$GITHUB_WORKSPACE/releases/prune-build-only-modules.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle"
|
|
# And raise the npm packages Meteor's own packages bundle - the ones
|
|
# no package.json here can reach. This is the pass that matters: the
|
|
# meteor/ tree travels to every other arch untouched.
|
|
node "$GITHUB_WORKSPACE/releases/bump-bundle-npm-deps.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle"
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
#
|
|
# NOT --trim-prebuilds, deliberately. Every other bundle WeKan ships
|
|
# is THIS bundle repacked (releases/repack-bundle-for-arch.sh), so
|
|
# dropping the native prebuilds for other platforms here would drop
|
|
# them for architectures that have not been built yet. Each final
|
|
# per-platform job passes --trim-prebuilds with its own target.
|
|
node "$GITHUB_WORKSPACE/releases/bundle-trim.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle" --transport sockjs --drop-legacy-client
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$GITHUB_WORKSPACE/releases/prune-unreachable-npm.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle"
|
|
# sharp (attachment thumbnails) for this platform, and every native
|
|
# addon's header checked against it. Every other bundle starts from
|
|
# this one and runs the same script for its own platform and CPU.
|
|
node "$GITHUB_WORKSPACE/releases/platform-native-packages.mjs" \
|
|
"$GITHUB_WORKSPACE/.build/bundle" linux x64
|
|
|
|
- name: Does the bundle actually start?
|
|
# THE CHECK THAT WAS MISSING. v10.96 shipped a bundle whose boot.js died
|
|
# on a source map that had been deleted but not un-named; v10.97 shipped
|
|
# one missing nodemailer-openpgp, which packages/email.js links on its
|
|
# first tick. Both were reasoned about by reading the code, and both
|
|
# would have taken seconds to catch by starting the thing. Every other
|
|
# architecture's bundle is derived from this one, so this is the place.
|
|
run: bash "$GITHUB_WORKSPACE/releases/bundle-smoke-boot.sh" "$GITHUB_WORKSPACE/.build/bundle"
|
|
|
|
- name: Check the binaries the amd64 bundle needs exist
|
|
run: |
|
|
set -euo pipefail
|
|
# The SQLite-only ferretdb-sqlite-amd64, or the full ferretdb-amd64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash releases/ferretdb-asset.sh --url amd64)"
|
|
bash releases/require-binaries.sh 'amd64 bundle' "$FERRET_URL"
|
|
|
|
- name: Embed Node.js, FerretDB (amd64) and launcher into the bundle
|
|
# Make the release .zip self-contained (offline): bundle Node.js + FerretDB
|
|
# + a start-wekan.sh that runs WeKan on the bundled Node against the bundled
|
|
# FerretDB (SQLite) by default, storing files on the filesystem under
|
|
# WRITABLE_PATH. This amd64 bundle is the base every other Linux arch is
|
|
# derived from; those jobs overwrite bundle/node and bundle/ferretdb with
|
|
# their own arch's binaries and inherit this launcher.
|
|
run: |
|
|
# Bundled Node.js: download the pinned Node ${NODE_VERSION} for linux-x64
|
|
# from nodejs.org and VERIFY it against SHASUMS256.txt, rather than
|
|
# copying the runner's unnamed, unchecksummed node. The helper exports
|
|
# NODE_FULL and NODE_SHA256 to $GITHUB_ENV for the provenance step.
|
|
bash releases/embed-verified-node.sh .build/bundle/node node-x64 "$NODE_VERSION"
|
|
# The SQLite-only ferretdb-sqlite-amd64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-amd64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
ferret_meta="$(bash "$GITHUB_WORKSPACE/releases/ferretdb-asset.sh" amd64 -o .build/bundle/ferretdb)" \
|
|
|| { echo "::error::FerretDB for amd64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
eval "$ferret_meta"
|
|
# Bundled MongoDB Database Tools (amd64) from wekan/mongo-tools-patches (per-arch,
|
|
# no mongodb.com). This base amd64 bundle is inherited by the other Linux
|
|
# arches, which overwrite these with their own arch's tools below.
|
|
bash "$GITHUB_WORKSPACE/releases/fetch-mongo-tools.sh" .build/bundle amd64 \
|
|
|| { echo "::error::The MongoDB Database Tools for amd64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
# Self-contained launcher (defaults to FerretDB SQLite + WRITABLE_PATH).
|
|
cp releases/ferretdb/start-wekan.sh .build/bundle/
|
|
chmod +x .build/bundle/start-wekan.sh
|
|
# #6458: cpu-exec + same-arch qemu-user. cpu-exec runs any bundled
|
|
# binary that declares required CPU features (e.g. an external
|
|
# MongoDB 5+: AVX on x86_64) through qemu-user emulation on CPUs
|
|
# that lack them — including hypervisors that mask AVX. Every Linux
|
|
# bundle ships its own arch's qemu-user; other arches overwrite
|
|
# these below.
|
|
cp snap-src/bin/cpu-exec .build/bundle/cpu-exec
|
|
chmod +x .build/bundle/cpu-exec
|
|
cp /usr/bin/qemu-x86_64-static .build/bundle/qemu-x86_64
|
|
chmod +x .build/bundle/qemu-x86_64
|
|
|
|
- name: Create amd64 zip
|
|
id: zip
|
|
run: |
|
|
cd .build
|
|
python3 "$GITHUB_WORKSPACE/releases/check-telemetry.py" --bundle bundle
|
|
zip -r wekan-${VERSION}-amd64.zip bundle
|
|
# A checksum beside the bundle, so a download can be checked.
|
|
sha256sum "wekan-${VERSION}-amd64.zip" > "wekan-${VERSION}-amd64.zip.sha256sum"
|
|
cat "wekan-${VERSION}-amd64.zip.sha256sum"
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
#
|
|
# EVERY path here is absolute, because this step ran `cd .build` above
|
|
# and NOTHING relative means what it looks like it means from inside
|
|
# it. Both halves of that bit:
|
|
#
|
|
# The SCRIPT. `bash releases/record-provenance.sh` resolves against
|
|
# .build/, which has no releases/ - so it was
|
|
# bash: releases/record-provenance.sh: No such file or directory
|
|
# every single run, and the `|| true` on the end swallowed it. amd64
|
|
# had therefore never recorded anything, and the only visible symptom
|
|
# was its absence from the release-notes table.
|
|
#
|
|
# The OUTPUT. `mkdir -p provenance` makes .build/provenance, while
|
|
# the upload-artifact below looks at provenance/ from the workspace
|
|
# root - "No files were found with the provided path: provenance/".
|
|
#
|
|
# Every other build job records from the workspace root, which is why
|
|
# only this one was affected by either.
|
|
#
|
|
# The `|| true` stays on the record calls: a release note must not fail
|
|
# a build that produced a good bundle. It is exactly what hid this for
|
|
# so long, so the absolute paths are what make it honest rather than
|
|
# the error handling.
|
|
mkdir -p "$GITHUB_WORKSPACE/provenance"
|
|
PROVENANCE_FILE="$GITHUB_WORKSPACE/provenance/amd64.tsv" bash "$GITHUB_WORKSPACE/releases/record-provenance.sh" \
|
|
'amd64' 'Node.js' "${NODE_FROM:-}" "${NODE_FULL:-$NODE_VERSION}" \
|
|
"${NODE_URL:-}" \
|
|
"${NODE_SHA256:-}" || true
|
|
# ...and `|| true` here too, for the same reason: this is an
|
|
# ASSIGNMENT, so under `set -e` a missing script ends the step with
|
|
# exit 127 - which is what this line did on v10.78 before the path was
|
|
# made absolute, failing the whole amd64 build after the zip was
|
|
# already built and checksummed.
|
|
PROVENANCE_FILE="$GITHUB_WORKSPACE/provenance/amd64.tsv" bash "$GITHUB_WORKSPACE/releases/record-provenance.sh" \
|
|
'amd64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
# A zip that EXISTS is not a zip that WORKS, and the log should say which of the
|
|
# two this is. The size answers "was the bundle directory empty when it was
|
|
# zipped"; the entries answer "can this bundle start at all" - bundle/main.js is
|
|
# what the launcher runs, bundle/node is the runtime the zip promises to carry.
|
|
zip="wekan-${VERSION}-amd64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created. The build step above produced no bundle - its log says why."
|
|
exit 1
|
|
fi
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Listing to a FILE first: `unzip -l "$zip" | grep -q` ends unzip with
|
|
# SIGPIPE the moment grep matches, and `set -o pipefail` then reports 141
|
|
# for the pipeline - so a found file reads as a missing one. It is what
|
|
# broke the win64 verify twice; these have only been lucky about the size
|
|
# of the pipe buffer.
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node; do
|
|
if ! grep -q " $want$" zip-listing.txt; then
|
|
echo "::error::$zip has no $want, so it cannot start WeKan. The embed step above did not put it into the bundle."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB and contains bundle/main.js and bundle/node."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-amd64
|
|
path: provenance/
|
|
if-no-files-found: warn
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
path: .build/wekan-${{ needs.prepare.outputs.version }}-amd64.zip
|
|
retention-days: 1
|
|
|
|
# The amd64 bundle goes onto the GitHub Release HERE, as the last step of
|
|
# the job that built and checked it - not later, in the `release` job,
|
|
# which used to wait for arm64 as well and then upload both. A file is
|
|
# attached the moment it exists, so a release fills up as its builds
|
|
# finish. It is the first file of the run, so this job also CREATES the
|
|
# release (with the CHANGELOG notes) when it does not exist yet - only once
|
|
# a bundle is there to put on it, so a run whose amd64 build fails still
|
|
# publishes no release at all.
|
|
#
|
|
# always() + the zip step's outcome: a cancel that arrives after the zip
|
|
# was built and checked still attaches it. Cancelling a run must not
|
|
# throw away what had already finished building.
|
|
- name: Make sure the GitHub Release exists
|
|
if: ${{ always() && steps.zip.outcome == 'success' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: bash releases/ensure-github-release.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "$VERSION"
|
|
|
|
- name: Attach amd64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.zip.outcome == 'success' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset=".build/wekan-${VERSION}-amd64.zip"
|
|
if [ ! -s "$asset" ] || [ ! -s "${asset}.sha256sum" ]; then
|
|
echo "::error::$asset or its .sha256sum is missing or empty, so the base amd64 bundle cannot be attached. Every downstream snap/docker/AppImage job would 404 on it; the zip step above says why."
|
|
exit 1
|
|
fi
|
|
bash releases/github-release-upload.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "$asset" "${asset}.sha256sum"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-amd64"
|
|
echo "$mark build-amd64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-amd64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 3. Build arm64 bundle (rebuild native modules natively) ─────────────────
|
|
build-arm64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64]
|
|
runs-on: ubuntu-24.04-arm
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# Without a checkout the repo scripts this job runs -
|
|
# releases/require-binaries.sh (and releases/record-provenance.sh below) -
|
|
# are not on disk, and the "Check the binaries ..." step dies with exit 127
|
|
# ("releases/require-binaries.sh: No such file or directory"). Check out
|
|
# first, before download-artifact drops the bundle into the same workspace,
|
|
# so the scripts are present at the repo root the calls expect.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
bash "$GITHUB_WORKSPACE/releases/apt-install.sh" libatomic1 build-essential g++ make python3 curl unzip zip xz-utils elfutils qemu-user-static
|
|
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
shell: bash
|
|
run: |
|
|
set -uo pipefail
|
|
out="$(bash releases/resolve-node-source.sh 'arm64' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::arm64 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Rebuild native modules for arm64 in container
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
unzip wekan-${VERSION}-amd64.zip
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -a bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
docker run --rm --platform linux/arm64 \
|
|
-v "$(pwd)/bundle:/bundle" \
|
|
-v "$(pwd)/releases:/releases:ro" \
|
|
-v "$(pwd)/Dockerfile:/Dockerfile:ro" \
|
|
-w /bundle/programs/server \
|
|
node:${NODE_VERSION}-slim \
|
|
sh -c "bash /releases/apt-install.sh libatomic1 build-essential python3 && bash /releases/use-release-npm.sh && bash /releases/npm-retry.sh npm install && node /releases/prune-build-only-modules.mjs /bundle && node /releases/bump-bundle-npm-deps.mjs /bundle && node /releases/bundle-trim.mjs /bundle --transport sockjs --drop-legacy-client --trim-prebuilds --platform linux --arch arm64 && node /releases/prune-unreachable-npm.mjs /bundle && node /releases/platform-native-packages.mjs /bundle linux arm64"
|
|
|
|
- name: Check the binaries the arm64 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
# The SQLite-only ferretdb-sqlite-arm64, or the full ferretdb-arm64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash releases/ferretdb-asset.sh --url arm64)"
|
|
bash releases/require-binaries.sh 'arm64 bundle' "$FERRET_URL"
|
|
|
|
- name: Embed Node.js + FerretDB (arm64) into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# The launcher (start-wekan.sh) is inherited from the amd64 base bundle;
|
|
# swap bundle/node (runner is arm64 -> linux-arm64 Node 26) and bundle/ferretdb.
|
|
run: |
|
|
# Bundled Node.js: download the pinned Node ${NODE_VERSION} for
|
|
# linux-arm64 from nodejs.org and VERIFY it. This job has no setup-node,
|
|
# so the old `cp $(command -v node)` shipped the runner's DEFAULT node -
|
|
# Node 22 on ubuntu-24.04-arm - not the pinned 24, and unchecksummed.
|
|
# The helper exports NODE_FULL and NODE_SHA256 for the provenance step.
|
|
bash releases/embed-verified-node.sh bundle/node node-arm64 "$NODE_VERSION"
|
|
# The SQLite-only ferretdb-sqlite-arm64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-arm64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
ferret_meta="$(bash "$GITHUB_WORKSPACE/releases/ferretdb-asset.sh" arm64 -o bundle/ferretdb)" \
|
|
|| { echo "::error::FerretDB for arm64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
eval "$ferret_meta"
|
|
# Overwrite the inherited amd64 MongoDB Database Tools with arm64 ones.
|
|
bash "$GITHUB_WORKSPACE/releases/fetch-mongo-tools.sh" bundle arm64 \
|
|
|| { echo "::error::The MongoDB Database Tools for arm64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
# #6458: replace the inherited amd64 qemu-user with this arch's own
|
|
# (cpu-exec is a shell script and stays as inherited). qemu-aarch64
|
|
# lets ARMv8.0 hosts (Raspberry Pi 4 and older) run binaries that
|
|
# need ARMv8.2-A, like MongoDB 5+.
|
|
rm -f bundle/qemu-x86_64
|
|
cp /usr/bin/qemu-aarch64-static bundle/qemu-aarch64
|
|
chmod +x bundle/qemu-aarch64
|
|
|
|
- name: Create arm64 zip
|
|
id: zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
python3 "$GITHUB_WORKSPACE/releases/check-telemetry.py" --bundle bundle
|
|
zip -r wekan-${VERSION}-arm64.zip bundle
|
|
# A checksum beside the bundle, so a download can be checked.
|
|
sha256sum "wekan-${VERSION}-arm64.zip" > "wekan-${VERSION}-arm64.zip.sha256sum"
|
|
cat "wekan-${VERSION}-arm64.zip.sha256sum"
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/arm64.tsv bash releases/record-provenance.sh \
|
|
'arm64' 'Node.js' "${NODE_FROM:-}" "${NODE_FULL:-$NODE_VERSION}" \
|
|
"${NODE_URL:-}" \
|
|
"${NODE_SHA256:-}" || true
|
|
PROVENANCE_FILE=provenance/arm64.tsv bash releases/record-provenance.sh \
|
|
'arm64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
# A zip that EXISTS is not a zip that WORKS, and the log should say which of the
|
|
# two this is. The size answers "was the bundle directory empty when it was
|
|
# zipped"; the entries answer "can this bundle start at all" - bundle/main.js is
|
|
# what the launcher runs, bundle/node is the runtime the zip promises to carry.
|
|
zip="wekan-${VERSION}-arm64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created. The build step above produced no bundle - its log says why."
|
|
exit 1
|
|
fi
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Listing to a FILE first: `unzip -l "$zip" | grep -q` ends unzip with
|
|
# SIGPIPE the moment grep matches, and `set -o pipefail` then reports 141
|
|
# for the pipeline - so a found file reads as a missing one. It is what
|
|
# broke the win64 verify twice; these have only been lucky about the size
|
|
# of the pipe buffer.
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node; do
|
|
if ! grep -q " $want$" zip-listing.txt; then
|
|
echo "::error::$zip has no $want, so it cannot start WeKan. The embed step above did not put it into the bundle."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB and contains bundle/main.js and bundle/node."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: provenance-arm64
|
|
path: provenance/
|
|
if-no-files-found: warn
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-arm64
|
|
path: wekan-${{ needs.prepare.outputs.version }}-arm64.zip
|
|
retention-days: 1
|
|
|
|
# Attached by THIS job, as soon as it is built and checked - the same rule
|
|
# as build-amd64 above, and the same always() so a cancel after the zip
|
|
# step still attaches it. build-amd64 normally created the release already;
|
|
# making sure again costs one API call and lets this job be re-run alone.
|
|
- name: Make sure the GitHub Release exists
|
|
if: ${{ always() && steps.zip.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: bash releases/ensure-github-release.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "$VERSION"
|
|
|
|
- name: Attach arm64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.zip.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-arm64.zip"
|
|
if [ ! -s "$asset" ] || [ ! -s "${asset}.sha256sum" ]; then
|
|
echo "::error::$asset or its .sha256sum is missing or empty, so the base arm64 bundle cannot be attached. Every downstream snap/docker/AppImage job would 404 on it; the zip step above says why."
|
|
exit 1
|
|
fi
|
|
bash releases/github-release-upload.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "$asset" "${asset}.sha256sum"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-arm64"
|
|
echo "$mark build-arm64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-arm64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 7. Publish the GitHub Release notes and check the base bundles ─────────
|
|
# This job no longer UPLOADS anything. build-amd64 creates the release and
|
|
# attaches its own zip the moment it is built, and build-arm64 attaches its
|
|
# own the same way; this job used to download both artifacts and upload them
|
|
# together, which held every file back until the slower of the two was done.
|
|
# What it still does: write the notes (softprops updates the release the
|
|
# build job created) and CHECK, from the release side, that both base bundles
|
|
# and their .sha256sum are there - every downstream snap / docker / AppImage
|
|
# job needs: release and downloads wekan-<version>-{amd64,arm64}.zip from it.
|
|
release:
|
|
permissions:
|
|
contents: write
|
|
needs:
|
|
- prepare
|
|
- build-amd64
|
|
- build-arm64
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# publishes the release notes and checks the base bundles are attached.
|
|
timeout-minutes: 90
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# ref: main, the same ref `prepare` read CHANGELOG-big.md from, so the notes
|
|
# composed below are the ones prepare validated. (bump pushes to main and
|
|
# prepare tags it; nothing else pushes during a release.)
|
|
#
|
|
# This job used to download the amd64/arm64 bundle artifacts too, and the
|
|
# checkout had to come BEFORE that download because checkout wipes the
|
|
# workspace (v10.63 and v10.64 shipped no base bundles that way). The
|
|
# bundles are now attached by their own build jobs, so nothing is
|
|
# downloaded here for a checkout to wipe.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Collect where the binaries came from
|
|
continue-on-error: true
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
pattern: provenance-*
|
|
path: provenance
|
|
merge-multiple: true
|
|
|
|
- name: Compose release notes from the changelog only
|
|
# The notes go from FILE to FILE and never become a shell value. Two
|
|
# earlier shapes each broke a release: inline `${{ … }}` put them in the
|
|
# shell SOURCE, so a backtick in any `code` span ran as a command (v10.59
|
|
# published nothing, "Incorrect: command not found"); and `env:` put a
|
|
# 172 KB string in envp, past the 128 KiB MAX_ARG_STRLEN, so execve
|
|
# refused to start bash at all (v10.92, "Argument list too long"). Read
|
|
# from CHANGELOG-big.md, appended with cat, the text is data all the way.
|
|
run: |
|
|
set -euo pipefail
|
|
bash releases/release-notes.sh "$VERSION" > release-notes.md
|
|
echo "----- release notes -----"
|
|
head -40 release-notes.md
|
|
|
|
# Create the Release (and its notes) - or, as normally happens now, UPDATE
|
|
# the one build-amd64 created when it attached the first bundle, so its
|
|
# notes are exactly the ones composed here. No `files:`: softprops does
|
|
# not fail on an unmatched file, so when the bundles were once missing it
|
|
# created a release with NO base bundles and reported success, and every
|
|
# downstream snap / docker / AppImage job then 404'd on
|
|
# wekan-<version>-amd64.zip. Each build job attaches its own file instead,
|
|
# loudly and verified from the release side; the next step checks the two
|
|
# base bundles from here.
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
|
|
with:
|
|
tag_name: v${{ needs.prepare.outputs.version }}
|
|
name: v${{ needs.prepare.outputs.version }}
|
|
body_path: release-notes.md
|
|
# FerretDB binaries are NOT attached here: the per-arch
|
|
# ferretdb-sqlite-<arch> and ferretdb-<arch> binaries live on the
|
|
# wekan/FerretDB releases (https://github.com/wekan/FerretDB/releases),
|
|
# which is where the WeKan builds fetch them from, prebuilt
|
|
# (releases/ferretdb-asset.sh). Each wekan-<version>-<arch>.zip bundle
|
|
# embeds its own arch's FerretDB binary.
|
|
|
|
- name: Check the amd64 and arm64 bundles are on the GitHub Release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
# build-amd64 and build-arm64 each attached their own zip and
|
|
# .sha256sum as their last step. This checks it from the OTHER side: an
|
|
# upload that reported success but left no asset behind is the failure
|
|
# nobody notices until a download 404s, and every downstream job below
|
|
# (snap, docker, AppImage) downloads these two from the release.
|
|
gh release view --repo "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" --json assets --jq '.assets[].name' > release-assets.txt
|
|
for arch in amd64 arm64; do
|
|
for asset in "wekan-${VERSION}-${arch}.zip" "wekan-${VERSION}-${arch}.zip.sha256sum"; do
|
|
if ! grep -qxF "$asset" release-assets.txt; then
|
|
echo "::error::$asset is not listed in release v${VERSION}. build-$arch attaches it as its last step; its log says why it did not. Re-run build-$arch, then this job."
|
|
exit 1
|
|
fi
|
|
done
|
|
done
|
|
echo "OK: amd64 and arm64 bundles (and their .sha256sum) are attached to release v${VERSION}."
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark release"
|
|
echo "$mark release" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::release FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 7a. Wrap the published core bundles as AppImages ──────────────────────
|
|
# AppImage.yml does not rebuild WeKan: it downloads the amd64 and arm64 ZIPs
|
|
# that `release` just attached and wraps them for every AppImage runtime
|
|
# architecture they can serve. Put the reusable call HERE, after `release`
|
|
# AND `build-extra-arches`: amd64/aarch64 wrap the core bundles, while i686
|
|
# and armhf wrap extra-architecture bundles that are attached later. Starting
|
|
# after only `release` made those two legs see a deterministic 404 and skip.
|
|
# Passing the exact tag prevents a newer concurrent release from being
|
|
# selected by AppImage.yml's standalone "newest release" fallback.
|
|
appimage:
|
|
name: AppImages
|
|
needs: [prepare, release, build-extra-arches]
|
|
uses: ./.github/workflows/AppImage.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
# The glibc AppImages only. The musl pair waits for the musl bundles
|
|
# in the "musl AppImages" call below; without this list both calls
|
|
# built it (v12.54: two "AppImage x86_64" and two "AppImage aarch64").
|
|
only: '["x86_64","aarch64","i686","armhf"]'
|
|
|
|
bun:
|
|
name: Bun runtime bundles
|
|
needs: [prepare, release]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/bun.yml
|
|
permissions:
|
|
contents: write
|
|
actions: read
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# The BSDs (docs/Platforms/FOSS/OS/BSD.md): the amd64 bundle, attached by
|
|
# build-amd64, rebuilt inside a VM of each BSD whose Node.js wekan/node-patches
|
|
# publishes; the others are skipped until it does.
|
|
bsd:
|
|
name: BSD bundles
|
|
needs: [prepare, release, build-amd64]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' && needs.build-amd64.result == 'success' }}
|
|
uses: ./.github/workflows/bsd.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# Alpine and the other musl systems: the amd64 and arm64 bundles rebuilt
|
|
# inside Alpine with the musl Node.js (releases/musl/build-bundle.sh).
|
|
musl:
|
|
name: musl bundles
|
|
needs: [prepare, release, build-amd64, build-arm64]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/musl.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# Android (Termux): the Linux bundles rebuilt in Termux with wekan/
|
|
# node-patches' node-android-<cpu>; skipped until those are published.
|
|
android:
|
|
name: Android bundles
|
|
needs: [prepare, release, build-amd64, build-arm64, build-extra-arches]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/android.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# The musl AppImages wrap the musl bundles, so they wait for them.
|
|
appimage-musl:
|
|
name: musl AppImages
|
|
needs: [prepare, release, musl]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/AppImage.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
only: '["x86_64-musl","aarch64-musl"]'
|
|
|
|
# One executable per platform, repackaged from that platform's bundle, so it
|
|
# waits for every bundle job (docs/Platforms/Single-File.md). A platform
|
|
# whose bundle failed is skipped there, not here.
|
|
single-file:
|
|
name: Single-file WeKan
|
|
needs: [prepare, release, build-amd64, build-arm64, build-win64, build-win-arm64, build-win32, build-mac-arm64, build-mac-x64, build-extra-arches, bsd, android]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/single-file.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# One Bun executable per Bun platform, from that platform's Bun bundle
|
|
# (docs/Platforms/Single-File.md, "Bun single files"), so it waits for them.
|
|
bun-single-file:
|
|
name: Bun single-file WeKan
|
|
needs: [prepare, release, bun]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/bun-single-file.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
mac-app:
|
|
name: Mac apps
|
|
needs: [prepare, release, build-mac-arm64, build-mac-x64]
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/mac.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# The Windows single-file package wraps the win64 ZIP after that job has
|
|
# attached it. windows.yml smoke-tests the final EXE, including the bundled
|
|
# start-wekan.bat -> FerretDB SQLite + Node.js startup chain.
|
|
windows-exe:
|
|
name: Windows single EXE
|
|
needs: [prepare, release, build-win64]
|
|
uses: ./.github/workflows/windows.yml
|
|
permissions:
|
|
contents: write
|
|
with:
|
|
tag: v${{ needs.prepare.outputs.version }}
|
|
publish: true
|
|
|
|
# ─── 7b. Extra-platform bundles (win64, mac-arm64, s390x, ppc64le) ───────────
|
|
# Every bundle below is built AFTER `release` and attaches its own .zip to the
|
|
# already-created GitHub Release (releases/github-release-upload.sh: `gh
|
|
# release upload --clobber`, retried, verified by name and size), as the last
|
|
# step of the job that built it and even when the run is cancelled after the
|
|
# build, rather than being a prerequisite of `release`. This deliberately decouples the slower /
|
|
# different-OS builds (Windows, macOS, QEMU-emulated arches) from the core
|
|
# amd64/arm64 release, Docker and snap, so a slow or flaky one never blocks them.
|
|
# These bundles are NOT part of the Docker image or snap.
|
|
|
|
# Build win64 bundle (rebuild native modules on Windows).
|
|
build-win64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
runs-on: windows-latest
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# Checked out into src/ so start-wekan.bat and snapcraft.yaml (which pins
|
|
# the MongoDB tools/mongosh versions) are available; the downloaded bundle
|
|
# is extracted alongside it in the workspace root.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
path: src
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 src/releases/check-telemetry.py --source src
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash src/releases/use-release-npm.sh
|
|
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -uo pipefail
|
|
out="$(bash $SRC/releases/resolve-node-source.sh 'win64' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::win64 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Use the runner's 7-Zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: pwsh
|
|
# windows-latest already has 7-Zip in C:\Program Files\7-Zip. Installing
|
|
# it again from Chocolatey made the build depend on community.chocolatey.org,
|
|
# and v12.29's build-win64 died there before building anything:
|
|
# Failed to fetch results from V2 feed ... 504 (Gateway Timeout)
|
|
# '7zip.install 26.3.0' is not compatible with '7zip 26.4.0 constraint'
|
|
# Chocolatey is now only the fallback for an image without it, retried.
|
|
run: |
|
|
$exe = 'C:\Program Files\7-Zip\7z.exe'
|
|
if (-not (Get-Command 7z -ErrorAction SilentlyContinue) -and (Test-Path $exe)) {
|
|
Add-Content -Path $env:GITHUB_PATH -Value (Split-Path $exe)
|
|
$env:PATH = (Split-Path $exe) + ';' + $env:PATH
|
|
}
|
|
if (Get-Command 7z -ErrorAction SilentlyContinue) {
|
|
(& 7z | Select-Object -First 3) -join "`n" | Write-Host
|
|
exit 0
|
|
}
|
|
for ($i = 1; $i -le 5; $i++) {
|
|
choco install -y 7zip
|
|
if ($LASTEXITCODE -eq 0) { exit 0 }
|
|
Write-Host "choco install 7zip failed (attempt $i of 5); retrying in $(30 * $i) s"
|
|
Start-Sleep -Seconds (30 * $i)
|
|
}
|
|
Write-Host "::error::7-Zip is not on this runner image and Chocolatey could not install it in 5 attempts (community.chocolatey.org unavailable?)."
|
|
exit 1
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Fix bcrypt for Node.js 26
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
7z x wekan-${VERSION}-amd64.zip
|
|
# Drop the Linux node + FerretDB binaries + MongoDB Database Tools + POSIX
|
|
# launcher inherited from the amd64 base bundle; the Windows node.exe,
|
|
# ferretdb.exe, *.exe tools and start-wekan.bat are added in later steps.
|
|
rm -f bundle/node bundle/ferretdb bundle/.ferretdb-default bundle/start-wekan.sh
|
|
rm -f bundle/bsondump bundle/mongodump bundle/mongoexport bundle/mongofiles \
|
|
bundle/mongoimport bundle/mongorestore bundle/mongostat bundle/mongotop bundle/mongo-tools
|
|
# Linux-only cpu-exec + qemu-user (#6458) make no sense on Windows.
|
|
rm -f bundle/cpu-exec bundle/qemu-x86_64
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$SRC/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$SRC/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -r bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
|
|
- name: Rebuild native modules for Windows
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
cd bundle/programs/server
|
|
rm -rf node_modules
|
|
bash "$SRC/releases/npm-retry.sh" npm install
|
|
# ../.. is the bundle root: this step is inside programs/server.
|
|
node "$SRC/releases/prune-build-only-modules.mjs" ../..
|
|
node "$SRC/releases/bump-bundle-npm-deps.mjs" ../..
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
node "$SRC/releases/bundle-trim.mjs" ../.. --transport sockjs --drop-legacy-client \
|
|
--trim-prebuilds --platform win32 --arch x64
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$SRC/releases/prune-unreachable-npm.mjs" ../..
|
|
|
|
- name: Add sharp for Windows x64 (win64), and check the native addons
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# The bundle came from the amd64 Linux one, so sharp (attachment
|
|
# thumbnails) had only @img/sharp-linux-x64 and every thumbnail fell
|
|
# back to the full-size image. This puts in @img/sharp-win32-x64 at
|
|
# the version sharp pins - prebuilt, libvips DLLs included - and drops
|
|
# the packages whose os/cpu name another platform. Then every addon
|
|
# the bundle loads is read from its PE header: bcrypt, argon2 and
|
|
# sharp must each have one for x64, because accounts-password imports
|
|
# the first two with no fallback.
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
node "$SRC/releases/platform-native-packages.mjs" bundle win32 x64
|
|
node "$SRC/releases/check-addon-arch.mjs" bundle x64 bcrypt argon2 @img/sharp-win32-x64
|
|
|
|
- name: Check the binaries the win64 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# bash, not the Windows default shell: this is a bash script (`set -euo
|
|
# pipefail`, a bash script call). Without it PowerShell runs the body and
|
|
# dies on `set -euo pipefail` with "A parameter cannot be found that
|
|
# matches parameter name 'euo'".
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# This job checks the repo out into src/ (see the checkout step above),
|
|
# so the script lives at $SRC/releases/, not the workspace root - the
|
|
# same path the start-wekan.bat copy below uses.
|
|
# The SQLite-only ferretdb-sqlite-win64, or the full ferretdb-win64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash $SRC/releases/ferretdb-asset.sh --url win64)"
|
|
bash $SRC/releases/require-binaries.sh 'win64 bundle' "$FERRET_URL"
|
|
|
|
- name: Add MongoDB Database Tools to the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# MongoDB Database Tools (Windows) built by wekan/mongo-tools-patches (pure Go),
|
|
# one <tool>-win64.exe per tool from that repo's newest release — no
|
|
# mongodb.com dependency. No mongosh: WeKan no longer bundles the MongoDB
|
|
# Shell; scripted DB access uses the bundled Node.js 26 + `mongodb` driver.
|
|
# (The Windows launcher, start-wekan.bat, is added by the FerretDB embed
|
|
# step below from releases/ferretdb/start-wekan.bat.)
|
|
bash "$SRC/releases/fetch-mongo-tools.sh" bundle win64 \
|
|
|| { echo "::error::The MongoDB Database Tools for win64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
|
|
echo "=== bundle contents ==="
|
|
ls -1 bundle/
|
|
|
|
- name: Embed Node.js, FerretDB (win64) and launcher into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# Make the Windows .zip self-contained: bundle node.exe (from the runner's
|
|
# win-x64 Node 26), ferretdb.exe (downloaded per-arch from the newest
|
|
# wekan/FerretDB release) and start-wekan.bat. FerretDB embedding is
|
|
# tolerant: if the win64 asset is missing the bundle stays MongoDB-only
|
|
# (start-wekan.bat then won't find ferretdb.exe).
|
|
run: |
|
|
SRC="$PWD/src"
|
|
# Bundled Node.js: download the pinned Node ${NODE_VERSION} win-x64
|
|
# node.exe from nodejs.org and VERIFY it, rather than copying the
|
|
# runner's unchecksummed node. Exports NODE_FULL/NODE_SHA256 for
|
|
# provenance.
|
|
# Capture node_full/node_sha256 in THIS shell (provenance is recorded in
|
|
# the same step, and $GITHUB_ENV only reaches later steps); a failed
|
|
# download/verify stops the build here rather than at the later guard.
|
|
node_meta="$(bash $SRC/releases/embed-verified-node.sh bundle/node.exe node-win64.exe "$NODE_VERSION")" \
|
|
|| { echo "::error::Verified Node.js embed failed for win64."; exit 1; }
|
|
eval "$node_meta"
|
|
# The SQLite-only ferretdb-sqlite-win64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-win64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
rc=0; ferret_meta="$(bash "$SRC/releases/ferretdb-asset.sh" win64 -o bundle/ferretdb.exe)" || rc=$?
|
|
case "$rc" in
|
|
0) eval "$ferret_meta"
|
|
echo "Embedded FerretDB $FERRET_ASSET ($FERRET_TAG) -> bundle/ferretdb.exe" ;;
|
|
1) rm -f bundle/ferretdb.exe
|
|
echo "No win64 FerretDB asset in the release; Windows bundle stays MongoDB-only." ;;
|
|
*) echo "::error::FerretDB for win64 could not be put in the bundle; the lines above say why."; exit 1 ;;
|
|
esac
|
|
# Self-contained Windows launcher (defaults to FerretDB SQLite).
|
|
cp $SRC/releases/ferretdb/start-wekan.bat bundle/
|
|
# The in-process archive mount the single EXE preloads. It is inert
|
|
# in this ZIP - with no WEKAN_VFS_ARCHIVE in the environment it loads
|
|
# and does nothing - and ships here so the EXE, which is built from
|
|
# this ZIP, has it to unpack.
|
|
cp $SRC/releases/single-exe/wekan-vfs.cjs bundle/
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/win64.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win64' 'Node.js' "${node_from:-}" "${node_full:-$NODE_VERSION}" \
|
|
"${node_url:-}" \
|
|
"${node_sha256:-}" || true
|
|
if [ -s bundle/ferretdb.exe ]; then
|
|
PROVENANCE_FILE=provenance/win64.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
fi
|
|
# Check what goes IN, before anything is archived. This is the honest place
|
|
# for it: whether the zip can hold a startable bundle is decided here, in a
|
|
# plain directory, with no archive-listing format in the way.
|
|
for want in main.js node.exe start-wekan.bat wekan-vfs.cjs; do
|
|
if [ ! -s "bundle/$want" ]; then
|
|
echo "::error::bundle/$want is missing or empty, so the win64 zip cannot start WeKan. The bundle comes from the build job; the lines above say what was copied in."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "bundle/ has main.js, node.exe, start-wekan.bat and wekan-vfs.cjs:"
|
|
ls -la bundle
|
|
|
|
- name: Create win64 zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: cmd
|
|
run: |
|
|
python src/releases/check-telemetry.py --bundle bundle
|
|
if errorlevel 1 exit /b 1
|
|
7z a wekan-%VERSION%-win64.zip bundle
|
|
|
|
- name: Verify the win64 zip
|
|
id: verify
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
# Same question as on the other platforms, asked in bash because the zip
|
|
# itself is made with 7-Zip under cmd: does this zip actually carry a
|
|
# startable bundle, or only a name that looks like one?
|
|
zip="wekan-${VERSION}-win64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created - 7z failed above, or the bundle directory was missing."
|
|
exit 1
|
|
fi
|
|
# A checksum beside the bundle, so a download can be checked.
|
|
sha256sum "$zip" > "${zip}.sha256sum"
|
|
cat "${zip}.sha256sum"
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Integrity: `7z t` reads every entry and fails on a truncated or corrupt
|
|
# archive. Together with the check on bundle/ before zipping, that is what
|
|
# actually decides whether this zip is startable.
|
|
if ! 7z t "$zip" > 7z-test.log 2>&1; then
|
|
echo "::error::$zip did not pass 7z t - the archive is corrupt or truncated."
|
|
tail -n 30 7z-test.log
|
|
exit 1
|
|
fi
|
|
echo "7z t: archive is intact."
|
|
# The listing is EVIDENCE, printed, not a hidden verdict. v10.48 failed the
|
|
# release because `grep` found neither "bundle\main.js" nor "bundle/main.js"
|
|
# in `7z l -ba` output that nothing ever printed, so a bad zip and a bad
|
|
# grep looked exactly alike. Now the listing shows itself, and a missing
|
|
# match is a WARNING: bundle/main.js was verified to exist before zipping
|
|
# and the archive passed its integrity test, so a zero count here says
|
|
# something about 7-Zip's output format, not about the bundle.
|
|
# Through a FILE, never a pipe. `cmd | head`/`cmd | grep -q` ends the
|
|
# reader early, the writer gets SIGPIPE, and with `set -o pipefail` (which
|
|
# GitHub's bash uses) the pipeline's status becomes 141 - so under `set -e`
|
|
# a MATCH fails the step. That is what "has no bundle/main.js" was in
|
|
# v10.48, and what exit code 141 was in v10.49: the file was there both
|
|
# times, and the listing below proves it (`bundle\main.js`, five lines in).
|
|
7z l -ba "$zip" > zip-listing.txt 2>/dev/null || true
|
|
entries="$(wc -l < zip-listing.txt)"
|
|
echo "7z l -ba listed $entries entries; the first five:"
|
|
head -5 zip-listing.txt || true
|
|
for want in main.js node.exe; do
|
|
n="$(grep -F -c -e "bundle\\$want" -e "bundle/$want" zip-listing.txt || true)"
|
|
echo " entries matching bundle/$want: $n"
|
|
if [ "${n:-0}" -eq 0 ]; then
|
|
echo "::warning::$zip listing shows no bundle/$want, but bundle/$want existed before zipping and the archive passed 7z t. Compare the five listing lines above with what is being searched for."
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB, intact, and was built from a bundle that had main.js and node.exe."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-win64
|
|
path: wekan-${{ needs.prepare.outputs.version }}-win64.zip
|
|
retention-days: 1
|
|
|
|
- name: Upload win64 provenance
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-win64
|
|
path: provenance/
|
|
if-no-files-found: ignore
|
|
retention-days: 1
|
|
|
|
- name: Attach win64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.verify.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# The repo is checked out into src/, so the workspace root is not a git
|
|
# repository; set GH_REPO so `gh` targets wekan/wekan without relying on
|
|
# git remote detection (else: "fatal: not a git repository").
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-win64.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/src/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-win64"
|
|
echo "$mark build-win64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-win64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Build win32 (32-bit Windows) bundle.
|
|
#
|
|
# BEST-EFFORT, like mac-x64 and the exotic Linux arches: nodejs.org has no
|
|
# 32-bit Windows Node 26 at all (upstream removed the build in Node 23) and
|
|
# unofficial-builds has none either, so this bundle's node.exe can only come
|
|
# from wekan/node-patches. Until node-win32.exe is published there the preflight
|
|
# SKIPS this job (a warning, not a red failure); it returns on its own the
|
|
# release after it appears.
|
|
#
|
|
# The runner is 64-bit and the bundle is 32-bit. There is NO 32-bit Windows
|
|
# Node 26 to install (that is the whole reason the fork exists), so setup-node
|
|
# runs the runner's normal x64 Node to DRIVE the build, and the native modules
|
|
# (bcrypt, argon2) are cross-compiled to ia32 by compile-native-addons.mjs in
|
|
# the rebuild step below - node-gyp --arch=ia32 against a nodedir holding the
|
|
# fork's ia32 node.lib. The shipped node.exe is the fork's 32-bit node-win32.exe.
|
|
# Windows on ARM. Every binary this bundle needs is published: nodejs.org
|
|
# builds node-<version>-win-arm64.zip itself, wekan/FerretDB publishes
|
|
# ferretdb-win-arm64.exe and wekan/mongo-tools-patches publishes the tools
|
|
# as -win-arm64.exe - so this is a bundle WeKan could always have shipped
|
|
# and simply did not.
|
|
#
|
|
# It builds on the x64 Windows runner, like win32 does: the Meteor bundle is
|
|
# JavaScript, the native modules are installed with --ignore-scripts and are
|
|
# not compiled for the runner's architecture either way, and the only
|
|
# architecture-specific things in the zip are the three binaries above,
|
|
# which are downloaded rather than built.
|
|
build-win-arm64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
runs-on: windows-latest
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# Checked out into src/ so start-wekan.bat and snapcraft.yaml (which pins
|
|
# the MongoDB tools/mongosh versions) are available; the downloaded bundle
|
|
# is extracted alongside it in the workspace root.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
path: src
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 src/releases/check-telemetry.py --source src
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash src/releases/use-release-npm.sh
|
|
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -uo pipefail
|
|
out="$(bash $SRC/releases/resolve-node-source.sh 'win-arm64' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::win-arm64 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Use the runner's 7-Zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: pwsh
|
|
# windows-latest already has 7-Zip in C:\Program Files\7-Zip. Installing
|
|
# it again from Chocolatey made the build depend on community.chocolatey.org,
|
|
# and v12.29's build-win64 died there before building anything:
|
|
# Failed to fetch results from V2 feed ... 504 (Gateway Timeout)
|
|
# '7zip.install 26.3.0' is not compatible with '7zip 26.4.0 constraint'
|
|
# Chocolatey is now only the fallback for an image without it, retried.
|
|
run: |
|
|
$exe = 'C:\Program Files\7-Zip\7z.exe'
|
|
if (-not (Get-Command 7z -ErrorAction SilentlyContinue) -and (Test-Path $exe)) {
|
|
Add-Content -Path $env:GITHUB_PATH -Value (Split-Path $exe)
|
|
$env:PATH = (Split-Path $exe) + ';' + $env:PATH
|
|
}
|
|
if (Get-Command 7z -ErrorAction SilentlyContinue) {
|
|
(& 7z | Select-Object -First 3) -join "`n" | Write-Host
|
|
exit 0
|
|
}
|
|
for ($i = 1; $i -le 5; $i++) {
|
|
choco install -y 7zip
|
|
if ($LASTEXITCODE -eq 0) { exit 0 }
|
|
Write-Host "choco install 7zip failed (attempt $i of 5); retrying in $(30 * $i) s"
|
|
Start-Sleep -Seconds (30 * $i)
|
|
}
|
|
Write-Host "::error::7-Zip is not on this runner image and Chocolatey could not install it in 5 attempts (community.chocolatey.org unavailable?)."
|
|
exit 1
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Fix bcrypt for Node.js 26
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
7z x wekan-${VERSION}-amd64.zip
|
|
# Drop the Linux node + FerretDB binaries + MongoDB Database Tools + POSIX
|
|
# launcher inherited from the amd64 base bundle; the Windows node.exe,
|
|
# ferretdb.exe, *.exe tools and start-wekan.bat are added in later steps.
|
|
rm -f bundle/node bundle/ferretdb bundle/.ferretdb-default bundle/start-wekan.sh
|
|
rm -f bundle/bsondump bundle/mongodump bundle/mongoexport bundle/mongofiles \
|
|
bundle/mongoimport bundle/mongorestore bundle/mongostat bundle/mongotop bundle/mongo-tools
|
|
# Linux-only cpu-exec + qemu-user (#6458) make no sense on Windows.
|
|
rm -f bundle/cpu-exec bundle/qemu-x86_64
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$SRC/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$SRC/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -r bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
|
|
- name: Rebuild native modules for Windows
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# The runner and its node are x64. argon2 0.44 publishes no
|
|
# win32-arm64 prebuild, so it must be COMPILED for arm64, and
|
|
# accounts-password imports it with no fallback. npm 12 no longer does
|
|
# that during the install below: it ignores npm_config_arch ("Unknown
|
|
# env config") and blocks install scripts outside allowScripts, so
|
|
# v12.32 shipped no arm64 argon2 and v12.33 failed its addon check.
|
|
# compile-native-addons.mjs runs node-gyp itself, for arm64, before
|
|
# prune-build-only-modules removes node-gyp.
|
|
run: |
|
|
SRC="$PWD/src"
|
|
cd bundle/programs/server
|
|
rm -rf node_modules
|
|
bash "$SRC/releases/npm-retry.sh" npm install
|
|
node "$SRC/releases/compile-native-addons.mjs" ../.. arm64 bcrypt argon2
|
|
# ../.. is the bundle root: this step is inside programs/server.
|
|
node "$SRC/releases/prune-build-only-modules.mjs" ../..
|
|
node "$SRC/releases/bump-bundle-npm-deps.mjs" ../..
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
node "$SRC/releases/bundle-trim.mjs" ../.. --transport sockjs --drop-legacy-client \
|
|
--trim-prebuilds --platform win32 --arch arm64
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$SRC/releases/prune-unreachable-npm.mjs" ../..
|
|
|
|
- name: Add sharp for Windows ARM64 (win-arm64), and check the native addons
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# The bundle came from the amd64 Linux one, so sharp (attachment
|
|
# thumbnails) had only @img/sharp-linux-x64 and every thumbnail fell
|
|
# back to the full-size image. This puts in @img/sharp-win32-arm64 at
|
|
# the version sharp pins - prebuilt, libvips DLLs included - and drops
|
|
# the packages whose os/cpu name another platform. Then every addon
|
|
# the bundle loads is read from its PE header: bcrypt, argon2 and
|
|
# sharp must each have one for arm64, because accounts-password imports
|
|
# the first two with no fallback.
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
node "$SRC/releases/platform-native-packages.mjs" bundle win32 arm64
|
|
node "$SRC/releases/check-addon-arch.mjs" bundle arm64 bcrypt argon2 @img/sharp-win32-arm64
|
|
|
|
- name: Check the binaries the win-arm64 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# bash, not the Windows default shell: this is a bash script (`set -euo
|
|
# pipefail`, a bash script call). Without it PowerShell runs the body and
|
|
# dies on `set -euo pipefail` with "A parameter cannot be found that
|
|
# matches parameter name 'euo'".
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# This job checks the repo out into src/ (see the checkout step above),
|
|
# so the script lives at $SRC/releases/, not the workspace root - the
|
|
# same path the start-wekan.bat copy below uses.
|
|
# The SQLite-only ferretdb-sqlite-win-arm64, or the full ferretdb-win-arm64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash $SRC/releases/ferretdb-asset.sh --url win-arm64)"
|
|
bash $SRC/releases/require-binaries.sh 'win-arm64 bundle' "$FERRET_URL"
|
|
|
|
- name: Add MongoDB Database Tools to the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# MongoDB Database Tools (Windows) built by wekan/mongo-tools-patches (pure Go),
|
|
# one <tool>-win-arm64.exe per tool from that repo's newest release — no
|
|
# mongodb.com dependency. No mongosh: WeKan no longer bundles the MongoDB
|
|
# Shell; scripted DB access uses the bundled Node.js 26 + `mongodb` driver.
|
|
# (The Windows launcher, start-wekan.bat, is added by the FerretDB embed
|
|
# step below from releases/ferretdb/start-wekan.bat.)
|
|
bash "$SRC/releases/fetch-mongo-tools.sh" bundle win-arm64 \
|
|
|| { echo "::error::The MongoDB Database Tools for win-arm64 could not be put in the bundle; the lines above say why."; exit 1; }
|
|
|
|
echo "=== bundle contents ==="
|
|
ls -1 bundle/
|
|
|
|
- name: Embed Node.js, FerretDB (win-arm64) and launcher into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# Make the Windows .zip self-contained: bundle node.exe (from the runner's
|
|
# win-arm64 Node 26), ferretdb.exe (downloaded per-arch from the newest
|
|
# wekan/FerretDB release) and start-wekan.bat. FerretDB embedding is
|
|
# tolerant: if the win-arm64 asset is missing the bundle stays MongoDB-only
|
|
# (start-wekan.bat then won't find ferretdb.exe).
|
|
run: |
|
|
SRC="$PWD/src"
|
|
# Bundled Node.js: download the pinned Node ${NODE_VERSION} win-arm64
|
|
# node.exe from nodejs.org and VERIFY it, rather than copying the
|
|
# runner's unchecksummed node. Exports NODE_FULL/NODE_SHA256 for
|
|
# provenance.
|
|
# Capture node_full/node_sha256 in THIS shell (provenance is recorded in
|
|
# the same step, and $GITHUB_ENV only reaches later steps); a failed
|
|
# download/verify stops the build here rather than at the later guard.
|
|
node_meta="$(bash $SRC/releases/embed-verified-node.sh bundle/node.exe node-win-arm64.exe "$NODE_VERSION")" \
|
|
|| { echo "::error::Verified Node.js embed failed for win-arm64."; exit 1; }
|
|
eval "$node_meta"
|
|
# The SQLite-only ferretdb-sqlite-win-arm64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-win-arm64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
rc=0; ferret_meta="$(bash "$SRC/releases/ferretdb-asset.sh" win-arm64 -o bundle/ferretdb.exe)" || rc=$?
|
|
case "$rc" in
|
|
0) eval "$ferret_meta"
|
|
echo "Embedded FerretDB $FERRET_ASSET ($FERRET_TAG) -> bundle/ferretdb.exe" ;;
|
|
1) rm -f bundle/ferretdb.exe
|
|
echo "No win-arm64 FerretDB asset in the release; Windows bundle stays MongoDB-only." ;;
|
|
*) echo "::error::FerretDB for win-arm64 could not be put in the bundle; the lines above say why."; exit 1 ;;
|
|
esac
|
|
# Self-contained Windows launcher (defaults to FerretDB SQLite).
|
|
cp $SRC/releases/ferretdb/start-wekan.bat bundle/
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/win-arm64.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win-arm64' 'Node.js' "${node_from:-}" "${node_full:-$NODE_VERSION}" \
|
|
"${node_url:-}" \
|
|
"${node_sha256:-}" || true
|
|
if [ -s bundle/ferretdb.exe ]; then
|
|
PROVENANCE_FILE=provenance/win-arm64.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win-arm64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
fi
|
|
# Check what goes IN, before anything is archived. This is the honest place
|
|
# for it: whether the zip can hold a startable bundle is decided here, in a
|
|
# plain directory, with no archive-listing format in the way.
|
|
for want in main.js node.exe start-wekan.bat; do
|
|
if [ ! -s "bundle/$want" ]; then
|
|
echo "::error::bundle/$want is missing or empty, so the win-arm64 zip cannot start WeKan. The bundle comes from the build job; the lines above say what was copied in."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "bundle/ has main.js, node.exe and start-wekan.bat:"
|
|
ls -la bundle
|
|
|
|
- name: Create win-arm64 zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: cmd
|
|
run: |
|
|
python src/releases/check-telemetry.py --bundle bundle
|
|
if errorlevel 1 exit /b 1
|
|
7z a wekan-%VERSION%-win-arm64.zip bundle
|
|
|
|
- name: Verify the win-arm64 zip
|
|
id: verify
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
# Same question as on the other platforms, asked in bash because the zip
|
|
# itself is made with 7-Zip under cmd: does this zip actually carry a
|
|
# startable bundle, or only a name that looks like one?
|
|
zip="wekan-${VERSION}-win-arm64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created - 7z failed above, or the bundle directory was missing."
|
|
exit 1
|
|
fi
|
|
# A checksum beside the bundle, so a download can be checked.
|
|
sha256sum "$zip" > "${zip}.sha256sum"
|
|
cat "${zip}.sha256sum"
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Integrity: `7z t` reads every entry and fails on a truncated or corrupt
|
|
# archive. Together with the check on bundle/ before zipping, that is what
|
|
# actually decides whether this zip is startable.
|
|
if ! 7z t "$zip" > 7z-test.log 2>&1; then
|
|
echo "::error::$zip did not pass 7z t - the archive is corrupt or truncated."
|
|
tail -n 30 7z-test.log
|
|
exit 1
|
|
fi
|
|
echo "7z t: archive is intact."
|
|
# The listing is EVIDENCE, printed, not a hidden verdict. v10.48 failed the
|
|
# release because `grep` found neither "bundle\main.js" nor "bundle/main.js"
|
|
# in `7z l -ba` output that nothing ever printed, so a bad zip and a bad
|
|
# grep looked exactly alike. Now the listing shows itself, and a missing
|
|
# match is a WARNING: bundle/main.js was verified to exist before zipping
|
|
# and the archive passed its integrity test, so a zero count here says
|
|
# something about 7-Zip's output format, not about the bundle.
|
|
# Through a FILE, never a pipe. `cmd | head`/`cmd | grep -q` ends the
|
|
# reader early, the writer gets SIGPIPE, and with `set -o pipefail` (which
|
|
# GitHub's bash uses) the pipeline's status becomes 141 - so under `set -e`
|
|
# a MATCH fails the step. That is what "has no bundle/main.js" was in
|
|
# v10.48, and what exit code 141 was in v10.49: the file was there both
|
|
# times, and the listing below proves it (`bundle\main.js`, five lines in).
|
|
7z l -ba "$zip" > zip-listing.txt 2>/dev/null || true
|
|
entries="$(wc -l < zip-listing.txt)"
|
|
echo "7z l -ba listed $entries entries; the first five:"
|
|
head -5 zip-listing.txt || true
|
|
for want in main.js node.exe; do
|
|
n="$(grep -F -c -e "bundle\\$want" -e "bundle/$want" zip-listing.txt || true)"
|
|
echo " entries matching bundle/$want: $n"
|
|
if [ "${n:-0}" -eq 0 ]; then
|
|
echo "::warning::$zip listing shows no bundle/$want, but bundle/$want existed before zipping and the archive passed 7z t. Compare the five listing lines above with what is being searched for."
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB, intact, and was built from a bundle that had main.js and node.exe."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-win-arm64
|
|
path: wekan-${{ needs.prepare.outputs.version }}-win-arm64.zip
|
|
retention-days: 1
|
|
|
|
- name: Upload win-arm64 provenance
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-win-arm64
|
|
path: provenance/
|
|
if-no-files-found: ignore
|
|
retention-days: 1
|
|
|
|
- name: Attach win-arm64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.verify.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# The repo is checked out into src/, so the workspace root is not a git
|
|
# repository; set GH_REPO so `gh` targets wekan/wekan without relying on
|
|
# git remote detection (else: "fatal: not a git repository").
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-win-arm64.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/src/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-win-arm64"
|
|
echo "$mark build-win-arm64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-win-arm64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Build win32 (32-bit Windows) bundle.
|
|
#
|
|
# BEST-EFFORT, like mac-x64 and the exotic Linux arches: nodejs.org has no
|
|
# 32-bit Windows Node 26 at all (upstream removed the build in Node 23) and
|
|
# unofficial-builds has none either, so this bundle's node.exe can only come
|
|
# from wekan/node-patches. Until node-win32.exe is published there the preflight
|
|
# SKIPS this job (a warning, not a red failure); it returns on its own the
|
|
# release after it appears.
|
|
#
|
|
# The runner is 64-bit and the bundle is 32-bit. There is NO 32-bit Windows
|
|
# Node 26 to install (that is the whole reason the fork exists), so setup-node
|
|
# runs the runner's normal x64 Node to DRIVE the build, and the native modules
|
|
# (bcrypt, argon2) are cross-compiled to ia32 by compile-native-addons.mjs in
|
|
# the rebuild step below - node-gyp --arch=ia32 against a nodedir holding the
|
|
# fork's ia32 node.lib. The shipped node.exe is the fork's 32-bit node-win32.exe.
|
|
build-win32:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
runs-on: windows-latest
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
path: src
|
|
persist-credentials: false
|
|
|
|
# x64 Node (the runner's own): there is no 32-bit Windows Node 26 to
|
|
# install. It only DRIVES npm/node-gyp; the ia32 output comes from
|
|
# node-gyp --arch=ia32 (compile-native-addons.mjs) in the rebuild step.
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 src/releases/check-telemetry.py --source src
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash src/releases/use-release-npm.sh
|
|
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# 32-bit Windows is the platform that needs the third source: neither
|
|
# nodejs.org nor unofficial-builds has published it since Node 23.
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -uo pipefail
|
|
out="$(bash $SRC/releases/resolve-node-source.sh 'win32' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::win32 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Use the runner's 7-Zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: pwsh
|
|
# windows-latest already has 7-Zip in C:\Program Files\7-Zip. Installing
|
|
# it again from Chocolatey made the build depend on community.chocolatey.org,
|
|
# and v12.29's build-win64 died there before building anything:
|
|
# Failed to fetch results from V2 feed ... 504 (Gateway Timeout)
|
|
# '7zip.install 26.3.0' is not compatible with '7zip 26.4.0 constraint'
|
|
# Chocolatey is now only the fallback for an image without it, retried.
|
|
run: |
|
|
$exe = 'C:\Program Files\7-Zip\7z.exe'
|
|
if (-not (Get-Command 7z -ErrorAction SilentlyContinue) -and (Test-Path $exe)) {
|
|
Add-Content -Path $env:GITHUB_PATH -Value (Split-Path $exe)
|
|
$env:PATH = (Split-Path $exe) + ';' + $env:PATH
|
|
}
|
|
if (Get-Command 7z -ErrorAction SilentlyContinue) {
|
|
(& 7z | Select-Object -First 3) -join "`n" | Write-Host
|
|
exit 0
|
|
}
|
|
for ($i = 1; $i -le 5; $i++) {
|
|
choco install -y 7zip
|
|
if ($LASTEXITCODE -eq 0) { exit 0 }
|
|
Write-Host "choco install 7zip failed (attempt $i of 5); retrying in $(30 * $i) s"
|
|
Start-Sleep -Seconds (30 * $i)
|
|
}
|
|
Write-Host "::error::7-Zip is not on this runner image and Chocolatey could not install it in 5 attempts (community.chocolatey.org unavailable?)."
|
|
exit 1
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Fix bcrypt for Node.js 26
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
7z x wekan-${VERSION}-amd64.zip
|
|
# Drop the Linux node + FerretDB + MongoDB Database Tools + POSIX launcher
|
|
# inherited from the amd64 base bundle; the Windows node.exe, ferretdb.exe,
|
|
# *.exe tools and start-wekan.bat are added in later steps.
|
|
rm -f bundle/node bundle/ferretdb bundle/.ferretdb-default bundle/start-wekan.sh
|
|
rm -f bundle/bsondump bundle/mongodump bundle/mongoexport bundle/mongofiles \
|
|
bundle/mongoimport bundle/mongorestore bundle/mongostat bundle/mongotop bundle/mongo-tools
|
|
rm -f bundle/cpu-exec bundle/qemu-x86_64
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$SRC/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$SRC/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -r bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
|
|
- name: Rebuild native modules for Windows (32-bit)
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# The x64 runner Node drives node-gyp, and --arch=ia32 makes it
|
|
# cross-build 32-bit (Win32) native modules (bcrypt, argon2). An ia32 addon
|
|
# must LINK against an ia32 node.lib, and nodejs.org dropped 32-bit Windows
|
|
# in Node 23 - so node-gyp cannot fetch win-x86/node.lib. Build a nodedir
|
|
# it CAN use: node headers (arch-independent, from nodejs.org) plus the
|
|
# node-win32.lib that wekan/node-patches publishes beside its
|
|
# node-win32.exe, and point node-gyp at it with nodedir.
|
|
env:
|
|
NODE_FULL: ${{ steps.preflight.outputs.node_full }}
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# RUNNER_TEMP is a Windows path, D:\a\_temp. GNU tar reads anything
|
|
# before a colon as a REMOTE HOST (host:path, for rmt), so
|
|
# `tar -C D:\a\_temp/node-ia32` died with "Cannot open: No such file
|
|
# or directory" - v12.32, the first release whose win32 job got this
|
|
# far. So the shell works on the POSIX form of the path, tar is given
|
|
# only relative names, and node-gyp gets the Windows form it expects.
|
|
ND="$(cygpath -u "$RUNNER_TEMP")/node-ia32"
|
|
mkdir -p "$ND/ia32" "$ND/Release"
|
|
# Headers (same for every arch); try /download/release then /dist.
|
|
bash "$SRC/releases/fetch.sh" --optional -o "$ND/node-headers.tar.gz" \
|
|
"https://nodejs.org/download/release/${NODE_FULL}/node-${NODE_FULL}-headers.tar.gz" \
|
|
|| bash "$SRC/releases/fetch.sh" -o "$ND/node-headers.tar.gz" \
|
|
"https://nodejs.org/dist/${NODE_FULL}/node-${NODE_FULL}-headers.tar.gz"
|
|
(cd "$ND" && tar -xzf node-headers.tar.gz --strip-components=1 && rm -f node-headers.tar.gz)
|
|
test -f "$ND/include/node/node.h" \
|
|
|| { echo "::error::The Node.js ${NODE_FULL} headers did not unpack into $ND/include/node."; exit 1; }
|
|
# The 32-bit import library, at the two paths node-gyp may look in. It
|
|
# comes from wekan/node-patches, which is also where the node-win32.exe
|
|
# in this bundle comes from (nobody else builds either any more), so the
|
|
# addons link against the import library of the very node they run on.
|
|
bash "$SRC/releases/fetch.sh" -o "$ND/ia32/node.lib" \
|
|
"https://github.com/wekan/node-patches/releases/download/${NODE_FULL}/node-win32.lib"
|
|
cp "$ND/ia32/node.lib" "$ND/Release/node.lib"
|
|
NODEDIR="$(cygpath -w "$ND")"
|
|
echo "Cross-building ia32 native modules against nodedir $NODEDIR (fork node.lib)."
|
|
cd bundle/programs/server
|
|
rm -rf node_modules
|
|
bash "$SRC/releases/npm-retry.sh" npm install
|
|
# npm 12 ignores npm_config_arch/npm_config_nodedir and blocks install
|
|
# scripts outside allowScripts, so the install above compiles nothing
|
|
# (v12.33). bcrypt and argon2 publish no win32-ia32 prebuild: compile
|
|
# them here with node-gyp, for ia32 against this nodedir, before
|
|
# prune-build-only-modules removes node-gyp.
|
|
node "$SRC/releases/compile-native-addons.mjs" ../.. ia32 --nodedir "$NODEDIR" bcrypt argon2
|
|
# ../.. is the bundle root: this step is inside programs/server.
|
|
node "$SRC/releases/prune-build-only-modules.mjs" ../..
|
|
node "$SRC/releases/bump-bundle-npm-deps.mjs" ../..
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
node "$SRC/releases/bundle-trim.mjs" ../.. --transport sockjs --drop-legacy-client \
|
|
--trim-prebuilds --platform win32 --arch ia32
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$SRC/releases/prune-unreachable-npm.mjs" ../..
|
|
# The next step reads the compiled binaries to prove they are ia32.
|
|
|
|
- name: Add sharp for Windows 32-bit (win32), and check the native addons
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# The bundle came from the amd64 Linux one, so sharp (attachment
|
|
# thumbnails) had only @img/sharp-linux-x64 and every thumbnail fell
|
|
# back to the full-size image. This puts in @img/sharp-win32-ia32 at
|
|
# the version sharp pins - prebuilt, libvips DLLs included - and drops
|
|
# the packages whose os/cpu name another platform. Then every addon
|
|
# the bundle loads is read from its PE header: bcrypt, argon2 and
|
|
# sharp must each have one for ia32, because accounts-password imports
|
|
# the first two with no fallback.
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
node "$SRC/releases/platform-native-packages.mjs" bundle win32 ia32
|
|
node "$SRC/releases/check-addon-arch.mjs" bundle ia32 bcrypt argon2 @img/sharp-win32-ia32
|
|
|
|
- name: Check the binaries the win32 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# The SQLite-only ferretdb-sqlite-win32, or the full ferretdb-win32 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash $SRC/releases/ferretdb-asset.sh --url win32)"
|
|
bash $SRC/releases/require-binaries.sh 'win32 bundle' "$FERRET_URL"
|
|
|
|
- name: Add MongoDB Database Tools to the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
SRC="$PWD/src"
|
|
set -euo pipefail
|
|
# MongoDB Database Tools (32-bit Windows) from wekan/mongo-tools-patches; tolerant
|
|
# (skip any tool not built for win32).
|
|
rc=0; bash "$SRC/releases/fetch-mongo-tools.sh" bundle win32 || rc=$?
|
|
[ "$rc" != 2 ] || { echo "::error::A MongoDB Database Tools download failed or did not match its checksum; the lines above say which."; exit 1; }
|
|
[ "$rc" = 0 ] || echo "No MongoDB Database Tools for win32; skipping"
|
|
echo "=== bundle contents ==="
|
|
ls -1 bundle/
|
|
|
|
- name: Embed Node.js, FerretDB (win32) and launcher into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
# Make the Windows .zip self-contained: bundle node.exe (the fork's
|
|
# node-win32.exe, verified against its .sha256sum), ferretdb.exe
|
|
# (ferretdb-win32.exe) and start-wekan.bat. FerretDB is tolerant: if its
|
|
# asset is missing the bundle stays MongoDB-only.
|
|
run: |
|
|
SRC="$PWD/src"
|
|
node_meta="$(bash $SRC/releases/embed-verified-node.sh bundle/node.exe node-win32.exe "$NODE_VERSION")" \
|
|
|| { echo "::error::Verified Node.js embed failed for win32."; exit 1; }
|
|
eval "$node_meta"
|
|
# The SQLite-only ferretdb-sqlite-win32 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-win32 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
rc=0; ferret_meta="$(bash "$SRC/releases/ferretdb-asset.sh" win32 -o bundle/ferretdb.exe)" || rc=$?
|
|
case "$rc" in
|
|
0) eval "$ferret_meta"
|
|
echo "Embedded FerretDB $FERRET_ASSET ($FERRET_TAG) -> bundle/ferretdb.exe" ;;
|
|
1) rm -f bundle/ferretdb.exe
|
|
echo "No win32 FerretDB asset in the release; Windows bundle stays MongoDB-only." ;;
|
|
*) echo "::error::FerretDB for win32 could not be put in the bundle; the lines above say why."; exit 1 ;;
|
|
esac
|
|
cp $SRC/releases/ferretdb/start-wekan.bat bundle/
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/win32.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win32' 'Node.js' "${node_from:-}" "${node_full:-$NODE_VERSION}" \
|
|
"${node_url:-}" \
|
|
"${node_sha256:-}" || true
|
|
if [ -s bundle/ferretdb.exe ]; then
|
|
PROVENANCE_FILE=provenance/win32.tsv bash $SRC/releases/record-provenance.sh \
|
|
'win32' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
fi
|
|
for want in main.js node.exe start-wekan.bat; do
|
|
if [ ! -s "bundle/$want" ]; then
|
|
echo "::error::bundle/$want is missing or empty, so the win32 zip cannot start WeKan. The bundle comes from the build job; the lines above say what was copied in."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "bundle/ has main.js, node.exe and start-wekan.bat:"
|
|
ls -la bundle
|
|
|
|
- name: Create win32 zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: cmd
|
|
run: |
|
|
python src/releases/check-telemetry.py --bundle bundle
|
|
if errorlevel 1 exit /b 1
|
|
7z a wekan-%VERSION%-win32.zip bundle
|
|
|
|
- name: Verify the win32 zip
|
|
id: verify
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
shell: bash
|
|
run: |
|
|
zip="wekan-${VERSION}-win32.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created - 7z failed above, or the bundle directory was missing."
|
|
exit 1
|
|
fi
|
|
sha256sum "$zip" > "${zip}.sha256sum"
|
|
cat "${zip}.sha256sum"
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
if ! 7z t "$zip" > 7z-test.log 2>&1; then
|
|
echo "::error::$zip did not pass 7z t - the archive is corrupt or truncated."
|
|
tail -n 30 7z-test.log
|
|
exit 1
|
|
fi
|
|
echo "7z t: archive is intact."
|
|
7z l -ba "$zip" > zip-listing.txt 2>/dev/null || true
|
|
entries="$(wc -l < zip-listing.txt)"
|
|
echo "7z l -ba listed $entries entries; the first five:"
|
|
head -5 zip-listing.txt || true
|
|
for want in main.js node.exe; do
|
|
n="$(grep -F -c -e "bundle\\$want" -e "bundle/$want" zip-listing.txt || true)"
|
|
echo " entries matching bundle/$want: $n"
|
|
if [ "${n:-0}" -eq 0 ]; then
|
|
echo "::warning::$zip listing shows no bundle/$want, but bundle/$want existed before zipping and the archive passed 7z t. Compare the five listing lines above with what is being searched for."
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB, intact, and was built from a bundle that had main.js and node.exe."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-win32
|
|
path: wekan-${{ needs.prepare.outputs.version }}-win32.zip
|
|
retention-days: 1
|
|
|
|
- name: Upload win32 provenance
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-win32
|
|
path: provenance/
|
|
if-no-files-found: ignore
|
|
retention-days: 1
|
|
|
|
- name: Attach win32 bundle to the GitHub Release
|
|
if: ${{ always() && steps.verify.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-win32.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/src/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
- name: Job result
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-win32"
|
|
echo "$mark build-win32" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-win32 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Build mac-arm64 bundle (rebuild native modules on Apple Silicon).
|
|
build-mac-arm64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
# Apple Silicon (arm64). It was `macos-14`, and GitHub RETIRED that image:
|
|
# the v12.98 run's build-mac-arm64 was cancelled with "The configuration
|
|
# 'macos-14-arm64-us-default' is not supported", so v12.98 shipped no
|
|
# mac-arm64 bundle. macos-15 is Apple Silicon too (the same label mac.yml
|
|
# already builds on).
|
|
runs-on: macos-15
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# Without a checkout releases/require-binaries.sh is not on disk and the
|
|
# "Check the binaries ..." step dies with exit 127. Check out first, before
|
|
# download-artifact drops the bundle into the same workspace, so the script
|
|
# is present at the repo root the call expects.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash releases/use-release-npm.sh
|
|
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
shell: bash
|
|
run: |
|
|
set -uo pipefail
|
|
out="$(bash releases/resolve-node-source.sh 'mac-arm64' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::mac-arm64 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Rebuild native modules for macOS arm64
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
unzip -q wekan-${VERSION}-amd64.zip
|
|
# Replace the Linux node + FerretDB binaries + MongoDB Database Tools
|
|
# inherited from the amd64 base bundle with the macOS builds (added in a
|
|
# later step). The POSIX launcher start-wekan.sh works on macOS, so keep it.
|
|
rm -f bundle/node bundle/ferretdb bundle/.ferretdb-default
|
|
# Linux-only cpu-exec + qemu-user (#6458): qemu-user does not exist for
|
|
# macOS (Apple Silicon needs no AVX emulation anyway).
|
|
rm -f bundle/cpu-exec bundle/qemu-x86_64
|
|
rm -f bundle/bsondump bundle/mongodump bundle/mongoexport bundle/mongofiles \
|
|
bundle/mongoimport bundle/mongorestore bundle/mongostat bundle/mongotop bundle/mongo-tools
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -a bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
cd bundle/programs/server
|
|
rm -rf node_modules
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install
|
|
# ../.. is the bundle root: this is still inside programs/server.
|
|
node "$GITHUB_WORKSPACE/releases/prune-build-only-modules.mjs" ../..
|
|
node "$GITHUB_WORKSPACE/releases/bump-bundle-npm-deps.mjs" ../..
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
node "$GITHUB_WORKSPACE/releases/bundle-trim.mjs" ../.. --transport sockjs --drop-legacy-client \
|
|
--trim-prebuilds --platform darwin --arch arm64
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$GITHUB_WORKSPACE/releases/prune-unreachable-npm.mjs" ../..
|
|
# sharp (attachment thumbnails): the amd64 bundle has only its Linux
|
|
# package. Add the macOS arm64 one and check every native addon.
|
|
node "$GITHUB_WORKSPACE/releases/platform-native-packages.mjs" ../.. darwin arm64
|
|
cd ../../..
|
|
|
|
- name: Check the binaries the mac-arm64 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
# The SQLite-only ferretdb-sqlite-mac-arm64, or the full ferretdb-mac-arm64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash releases/ferretdb-asset.sh --url mac-arm64)"
|
|
bash releases/require-binaries.sh 'mac-arm64 bundle' "$FERRET_URL"
|
|
|
|
- name: Embed Node.js + FerretDB (mac-arm64) into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# Bundle the macOS arm64 Node.js (runner's darwin-arm64 Node 26) and the
|
|
# macOS FerretDB binary, downloaded per-arch from the newest wekan/FerretDB
|
|
# release. FerretDB is tolerant: if the mac-arm64 asset is missing the
|
|
# bundle stays MongoDB-only (start-wekan.sh then won't find ferretdb).
|
|
run: |
|
|
# Bundled Node.js: download the pinned Node ${NODE_VERSION} darwin-arm64
|
|
# build from nodejs.org and VERIFY it, rather than copying the runner's
|
|
# unchecksummed node. Exports NODE_FULL/NODE_SHA256 for provenance.
|
|
# Capture node_full/node_sha256 in THIS shell (provenance is recorded in
|
|
# the same step, and $GITHUB_ENV only reaches later steps); a failed
|
|
# download/verify stops the build here rather than at the later guard.
|
|
node_meta="$(bash releases/embed-verified-node.sh bundle/node node-mac-arm64 "$NODE_VERSION")" \
|
|
|| { echo "::error::Verified Node.js embed failed for mac-arm64."; exit 1; }
|
|
eval "$node_meta"
|
|
# The SQLite-only ferretdb-sqlite-mac-arm64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-mac-arm64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
rc=0; ferret_meta="$(bash "$GITHUB_WORKSPACE/releases/ferretdb-asset.sh" mac-arm64 -o bundle/ferretdb)" || rc=$?
|
|
case "$rc" in
|
|
0) eval "$ferret_meta"
|
|
echo "Embedded FerretDB $FERRET_ASSET ($FERRET_TAG) -> bundle/ferretdb" ;;
|
|
1) rm -f bundle/ferretdb
|
|
echo "No mac-arm64 FerretDB asset in the release; macOS bundle stays MongoDB-only."
|
|
rm -f bundle/start-wekan.sh ;;
|
|
*) echo "::error::FerretDB for mac-arm64 could not be put in the bundle; the lines above say why."; exit 1 ;;
|
|
esac
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/mac-arm64.tsv bash releases/record-provenance.sh \
|
|
'mac-arm64' 'Node.js' "${node_from:-}" "${node_full:-$NODE_VERSION}" \
|
|
"${node_url:-}" \
|
|
"${node_sha256:-}" || true
|
|
if [ -s bundle/ferretdb ]; then
|
|
PROVENANCE_FILE=provenance/mac-arm64.tsv bash releases/record-provenance.sh \
|
|
'mac-arm64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
fi
|
|
# macOS MongoDB Database Tools (mac-arm64) from wekan/mongo-tools-patches; tolerant
|
|
# (skip any tool not built for macOS).
|
|
rc=0; bash "$GITHUB_WORKSPACE/releases/fetch-mongo-tools.sh" bundle mac-arm64 || rc=$?
|
|
[ "$rc" != 2 ] || { echo "::error::A MongoDB Database Tools download failed or did not match its checksum; the lines above say which."; exit 1; }
|
|
[ "$rc" = 0 ] || echo "No MongoDB Database Tools for mac-arm64; skipping"
|
|
|
|
- name: Create mac-arm64 zip
|
|
id: zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
python3 "$GITHUB_WORKSPACE/releases/check-telemetry.py" --bundle bundle
|
|
zip -r wekan-${VERSION}-mac-arm64.zip bundle
|
|
# A checksum beside the bundle, so a download can be checked. macOS has
|
|
# no `sha256sum` (that is a GNU coreutils name); `shasum -a 256` is the
|
|
# BSD/macOS spelling and writes the same "<hash> <file>" format.
|
|
shasum -a 256 "wekan-${VERSION}-mac-arm64.zip" > "wekan-${VERSION}-mac-arm64.zip.sha256sum"
|
|
cat "wekan-${VERSION}-mac-arm64.zip.sha256sum"
|
|
# A zip that EXISTS is not a zip that WORKS, and the log should say which of the
|
|
# two this is. The size answers "was the bundle directory empty when it was
|
|
# zipped"; the entries answer "can this bundle start at all" - bundle/main.js is
|
|
# what the launcher runs, bundle/node is the runtime the zip promises to carry.
|
|
zip="wekan-${VERSION}-mac-arm64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created. The build step above produced no bundle - its log says why."
|
|
exit 1
|
|
fi
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Listing to a FILE first: `unzip -l "$zip" | grep -q` ends unzip with
|
|
# SIGPIPE the moment grep matches, and `set -o pipefail` then reports 141
|
|
# for the pipeline - so a found file reads as a missing one. It is what
|
|
# broke the win64 verify twice; these have only been lucky about the size
|
|
# of the pipe buffer.
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node; do
|
|
if ! grep -q " $want$" zip-listing.txt; then
|
|
echo "::error::$zip has no $want, so it cannot start WeKan. The embed step above did not put it into the bundle."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB and contains bundle/main.js and bundle/node."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-mac-arm64
|
|
path: wekan-${{ needs.prepare.outputs.version }}-mac-arm64.zip
|
|
retention-days: 1
|
|
|
|
- name: Upload mac-arm64 provenance
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-mac-arm64
|
|
path: provenance/
|
|
if-no-files-found: ignore
|
|
retention-days: 1
|
|
|
|
- name: Attach mac-arm64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.zip.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# No repo checkout in this job, so set GH_REPO so `gh` knows the target
|
|
# repository instead of trying (and failing) to detect a git remote.
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-mac-arm64.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-mac-arm64"
|
|
echo "$mark build-mac-arm64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-mac-arm64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Build mac-x64 bundle (rebuild native modules on an Intel Mac runner).
|
|
#
|
|
# BEST-EFFORT, like win32 and the exotic Linux arches: nodejs.org publishes
|
|
# darwin-x64, so this normally resolves there - but the preflight stays, so the
|
|
# day Intel macOS stops being published this job SKIPS with a warning instead of
|
|
# failing red, and returns on its own if a Node.js for it appears again.
|
|
build-mac-x64:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
# Intel (x86_64) macOS. It was `macos-13`, and GitHub RETIRED that image -
|
|
# actions/runner-images publishes macos-15 and macos-26 only (macos-14 was
|
|
# retired later too), and
|
|
# macos-13 is gone from the hosted-runner table. A retired label does not
|
|
# fail: the job QUEUES FOREVER waiting for a runner that will never come, so
|
|
# every release since then had a build-mac-x64 sitting there for hours until
|
|
# it was cancelled by hand - and cancelling it cancelled the RUN, which is
|
|
# what skipped the charts jobs (they had not started yet).
|
|
# No release has ever carried a wekan-<version>-mac-x64.zip because of it.
|
|
# Intel macOS is still offered, under new labels: macos-15-intel and
|
|
# macos-26-intel (macos-15/26 without the suffix are Apple Silicon). This
|
|
# is the same label .tools/Secretchronicles/TSC already builds its Intel Mac on.
|
|
runs-on: macos-15-intel
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash releases/use-release-npm.sh
|
|
|
|
# Does the fork publish node-mac-x64 for this version yet? WeKan's Node.js
|
|
# comes only from the fork, so if it has not built this binary there is
|
|
# nothing to ship and the job SKIPS rather than failing. Every build step
|
|
# below is gated on skip != 'true'.
|
|
# Which Node.js this platform gets - and whether it is built at all.
|
|
#
|
|
# WeKan takes its Node.js from official nodejs.org, then
|
|
# unofficial-builds.nodejs.org, then wekan/node-patches
|
|
# (releases/resolve-node-source.sh is the one place that order lives).
|
|
# Intel macOS is published by nodejs.org, so this normally resolves
|
|
# there; the preflight stays so it skips rather than fails if it stops.
|
|
# When NO source has one for this CPU the platform is simply NOT BUILT
|
|
# this release: every step below is gated on skip, and it comes back by
|
|
# itself the first run after a Node.js for it is published anywhere.
|
|
- name: Preflight - resolve this platform's Node.js
|
|
id: preflight
|
|
run: |
|
|
set -uo pipefail
|
|
out="$(bash releases/resolve-node-source.sh 'mac-x64' "$NODE_VERSION")" || true
|
|
if printf '%s\n' "$out" | grep -q '^node_found=true$'; then
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url|kind|member|sha256)=' >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$out" | grep -E '^node_(full|from|url)='
|
|
else
|
|
echo "::warning::mac-x64 is not built this time. No Node.js for it at nodejs.org, unofficial-builds.nodejs.org or wekan/node-patches; it returns by itself when one is published."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Download amd64 bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
- name: Rebuild native modules for macOS x64
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
unzip -q wekan-${VERSION}-amd64.zip
|
|
# Replace the Linux node + FerretDB + MongoDB Database Tools inherited from
|
|
# the amd64 base bundle with the macOS builds (added below). The POSIX
|
|
# launcher start-wekan.sh works on macOS, so keep it.
|
|
rm -f bundle/node bundle/ferretdb bundle/.ferretdb-default
|
|
# Linux-only cpu-exec + qemu-user (#6458) make no sense on macOS.
|
|
rm -f bundle/cpu-exec bundle/qemu-x86_64
|
|
rm -f bundle/bsondump bundle/mongodump bundle/mongoexport bundle/mongofiles \
|
|
bundle/mongoimport bundle/mongorestore bundle/mongostat bundle/mongotop bundle/mongo-tools
|
|
# Fix: bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3
|
|
# which fails to compile on Node.js 26. Replace with bcrypt 6.0.0.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
rm -rf "$BCRYPT_DIR"
|
|
TMP=$(mktemp -d)
|
|
pushd "$TMP" > /dev/null
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm pack bcrypt@6.0.0
|
|
mkdir bcrypt && tar xzf bcrypt-*.tgz --strip-components=1 -C bcrypt
|
|
cd bcrypt && bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install --ignore-scripts && cd ..
|
|
cp -a bcrypt "$BCRYPT_DIR"
|
|
popd > /dev/null
|
|
rm -rf "$TMP"
|
|
fi
|
|
cd bundle/programs/server
|
|
rm -rf node_modules
|
|
bash "$GITHUB_WORKSPACE/releases/npm-retry.sh" npm install
|
|
# ../.. is the bundle root: this is still inside programs/server.
|
|
node "$GITHUB_WORKSPACE/releases/prune-build-only-modules.mjs" ../..
|
|
node "$GITHUB_WORKSPACE/releases/bump-bundle-npm-deps.mjs" ../..
|
|
# WeKan runs sockjs on every platform, so no bundle ships uWebSockets.js:
|
|
# ddp-server requires it only inside the uws transport setup(), which sockjs
|
|
# never calls, and the module is 121M of prebuilt binaries for OS/CPU/ABI
|
|
# combinations one machine cannot use anyway. --drop-legacy-client removes the
|
|
# second client build, for browsers without modern JS, and its name in the two
|
|
# manifests that list it. Source maps go too: 4766 files a debugger reads and
|
|
# nothing on the loading path touches.
|
|
node "$GITHUB_WORKSPACE/releases/bundle-trim.mjs" ../.. --transport sockjs --drop-legacy-client \
|
|
--trim-prebuilds --platform darwin --arch x64
|
|
# And the third tree: programs/server/npm/node_modules is a full `npm install`,
|
|
# devDependencies included, that rspack cannot tree-shake because Atmosphere
|
|
# packages load it through Npm.require(). This removes only what it can prove
|
|
# nothing requires, and refuses any policy entry the graph says IS reached.
|
|
node "$GITHUB_WORKSPACE/releases/prune-unreachable-npm.mjs" ../..
|
|
# sharp (attachment thumbnails): the amd64 bundle has only its Linux
|
|
# package. Add the macOS x64 one and check every native addon.
|
|
node "$GITHUB_WORKSPACE/releases/platform-native-packages.mjs" ../.. darwin x64
|
|
cd ../../..
|
|
|
|
- name: Check the binaries the mac-x64 bundle needs exist
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
# The SQLite-only ferretdb-sqlite-mac-amd64, or the full ferretdb-mac-amd64 of
|
|
# the newest release until one has it (releases/ferretdb-asset.sh says which).
|
|
FERRET_URL="$(bash releases/ferretdb-asset.sh --url mac-amd64)"
|
|
bash releases/require-binaries.sh 'mac-x64 bundle' "$FERRET_URL"
|
|
|
|
- name: Embed Node.js + FerretDB (mac-x64) into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# Bundle the macOS x64 Node.js the preflight resolved (nodejs.org's
|
|
# darwin-x64 build, verified against its published SHA256) and the macOS
|
|
# FerretDB binary
|
|
# (ferretdb-mac-amd64). FerretDB is tolerant: if its asset is missing the
|
|
# bundle stays MongoDB-only (start-wekan.sh then won't find ferretdb).
|
|
run: |
|
|
node_meta="$(bash releases/embed-verified-node.sh bundle/node node-mac-x64 "$NODE_VERSION")" \
|
|
|| { echo "::error::Verified Node.js embed failed for mac-x64."; exit 1; }
|
|
eval "$node_meta"
|
|
# The SQLite-only ferretdb-sqlite-mac-amd64 from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-mac-amd64 of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
rc=0; ferret_meta="$(bash "$GITHUB_WORKSPACE/releases/ferretdb-asset.sh" mac-amd64 -o bundle/ferretdb)" || rc=$?
|
|
case "$rc" in
|
|
0) eval "$ferret_meta"
|
|
echo "Embedded FerretDB $FERRET_ASSET ($FERRET_TAG) -> bundle/ferretdb" ;;
|
|
1) rm -f bundle/ferretdb
|
|
echo "No mac-amd64 FerretDB asset in the release; macOS bundle stays MongoDB-only."
|
|
rm -f bundle/start-wekan.sh ;;
|
|
*) echo "::error::FerretDB for mac-amd64 could not be put in the bundle; the lines above say why."; exit 1 ;;
|
|
esac
|
|
# Where this bundle's binaries came from, for the release notes.
|
|
mkdir -p provenance
|
|
PROVENANCE_FILE=provenance/mac-x64.tsv bash releases/record-provenance.sh \
|
|
'mac-x64' 'Node.js' "${node_from:-}" "${node_full:-$NODE_VERSION}" \
|
|
"${node_url:-}" \
|
|
"${node_sha256:-}" || true
|
|
if [ -s bundle/ferretdb ]; then
|
|
PROVENANCE_FILE=provenance/mac-x64.tsv bash releases/record-provenance.sh \
|
|
'mac-x64' 'FerretDB' 'wekan/FerretDB' "${FERRET_TAG:-latest}" \
|
|
"${FERRET_URL:-}" \
|
|
"${FERRET_SHA:-}" || true
|
|
fi
|
|
# macOS MongoDB Database Tools (mac-x64) from wekan/mongo-tools-patches; tolerant
|
|
# (skip any tool not built for this arch).
|
|
rc=0; bash "$GITHUB_WORKSPACE/releases/fetch-mongo-tools.sh" bundle mac-x64 || rc=$?
|
|
[ "$rc" != 2 ] || { echo "::error::A MongoDB Database Tools download failed or did not match its checksum; the lines above say which."; exit 1; }
|
|
[ "$rc" = 0 ] || echo "No MongoDB Database Tools for mac-x64; skipping"
|
|
|
|
- name: Create mac-x64 zip
|
|
id: zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
run: |
|
|
python3 "$GITHUB_WORKSPACE/releases/check-telemetry.py" --bundle bundle
|
|
zip -r wekan-${VERSION}-mac-x64.zip bundle
|
|
shasum -a 256 "wekan-${VERSION}-mac-x64.zip" > "wekan-${VERSION}-mac-x64.zip.sha256sum"
|
|
cat "wekan-${VERSION}-mac-x64.zip.sha256sum"
|
|
zip="wekan-${VERSION}-mac-x64.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created. The build step above produced no bundle - its log says why."
|
|
exit 1
|
|
fi
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node; do
|
|
if ! grep -q " $want$" zip-listing.txt; then
|
|
echo "::error::$zip has no $want, so it cannot start WeKan. The embed step above did not put it into the bundle."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB and contains bundle/main.js and bundle/node."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-mac-x64
|
|
path: wekan-${{ needs.prepare.outputs.version }}-mac-x64.zip
|
|
retention-days: 1
|
|
|
|
- name: Upload mac-x64 provenance
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: provenance-mac-x64
|
|
path: provenance/
|
|
if-no-files-found: ignore
|
|
retention-days: 1
|
|
|
|
- name: Attach mac-x64 bundle to the GitHub Release
|
|
if: ${{ always() && steps.zip.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-mac-x64.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
- name: Job result
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-mac-x64"
|
|
echo "$mark build-mac-x64" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-mac-x64 FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Extra-architecture Linux bundles — every Linux arch wekan/FerretDB builds for
|
|
# that has NO MongoDB server, so they ship FerretDB v1 as their database.
|
|
#
|
|
# Each one needs a Node.js 26 for its CPU, and it comes from the three sources
|
|
# in order: official nodejs.org (ppc64le, s390x), then
|
|
# unofficial-builds.nodejs.org (riscv64, loong64), then wekan/node-patches
|
|
# (i386, armhf, armv7 - what neither of the others builds). The preflight
|
|
# (check-arch-binaries.sh, through resolve-node-source.sh) picks the first that
|
|
# has this CPU and verifies the download against the SHA256 that source
|
|
# published. An arch none of the three has is NOT BUILT this release, and comes
|
|
# back by itself the first run after a Node.js for it appears.
|
|
#
|
|
# An arch is listed here only when the fork has (or will have) a node-<arch> for
|
|
# it. The one FerretDB target deliberately absent is armel (ARMv5, soft-float):
|
|
# V8 has not supported ARMv5 for many years - nobody, this fork included, can
|
|
# build a Node.js for it - so there would be nothing to run the bundle with. See
|
|
# docs/Platforms/Platforms.md.
|
|
build-extra-arches:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, build-amd64, release]
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 300
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# `node_arch` is what the Node.js download is called, which is not
|
|
# always what we call the platform: Node says x86 where Debian, snap
|
|
# and FerretDB all say i386, and armv7l where they say armhf.
|
|
# `ferretdb_arch` is the asset name in the wekan/FerretDB release.
|
|
#
|
|
# `image` is the base image the emulated container runs, and it has to
|
|
# be one that PUBLISHES this platform. ubuntu:26.04 does not build 386,
|
|
# so `docker run --platform linux/386 ubuntu:26.04` answers "no matching
|
|
# manifest for linux/386 in the manifest list entries" - which is how
|
|
# the i386 and loong64 jobs failed. debian:trixie publishes 386, amd64,
|
|
# arm/v5, arm/v7, arm64, ppc64le, riscv64 and s390x, so it covers every
|
|
# architecture here. The preflight step checks it rather than trusting
|
|
# this table.
|
|
# s390x is BEST-EFFORT: WeKan takes its Node.js only from the wekan/node
|
|
# fork, and the fork builds node-s390x on its own schedule. Until it has
|
|
# published node-s390x for this major, the preflight SKIPS s390x (a
|
|
# warning, exit 0) rather than failing the whole matrix job and skipping
|
|
# docker with it; it returns on its own the release after the fork
|
|
# publishes it. (FerretDB and the debian:trixie base already have s390x,
|
|
# so only the fork's Node.js gates it.)
|
|
- arch: s390x
|
|
platform: linux/s390x
|
|
image: debian:trixie
|
|
node_arch: s390x
|
|
ferretdb_arch: s390x
|
|
optional: true
|
|
# ppc64le and riscv64 are BEST-EFFORT too. Every extra arch is built by
|
|
# running the fork's target-CPU node UNDER QEMU to rebuild the native
|
|
# modules, and qemu-user does not run every Node.js perfectly: ppc64le
|
|
# crashed at node startup deserializing its V8 snapshot -
|
|
# # Check failed: IsFreeSpaceOrFiller(filler).
|
|
# ... v8::Isolate::Initialize ... qemu: uncaught target signal 5
|
|
# so `npm install` trapped and the leg failed. A single emulated CPU
|
|
# that cannot run this release must NOT fail the whole matrix (which
|
|
# would, before the docker job learned to build only the bundles that
|
|
# landed, have skipped docker too). optional=true makes such a leg SKIP
|
|
# with a warning; the arch returns the release it runs cleanly again.
|
|
- arch: ppc64le
|
|
platform: linux/ppc64le
|
|
image: debian:trixie
|
|
node_arch: ppc64le
|
|
ferretdb_arch: ppc64le
|
|
optional: true
|
|
- arch: riscv64
|
|
platform: linux/riscv64
|
|
image: debian:trixie
|
|
node_arch: riscv64
|
|
ferretdb_arch: riscv64
|
|
optional: true
|
|
# i386 and armhf are the two 32-bit CPUs neither nodejs.org nor
|
|
# unofficial-builds publishes a Node 26 for - nodejs.org has no
|
|
# linux-x86 build at all, and no armv7l one for this major - so their
|
|
# Node.js can only come from wekan/node-patches. Until it is published
|
|
# there the preflight SKIPS them (a warning, exit 0) instead of failing
|
|
# the run: a red job every release for a CPU nothing publishes a runtime
|
|
# for is noise. (FerretDB ships both already, so only Node.js gates
|
|
# them.)
|
|
- arch: i386
|
|
platform: linux/386
|
|
image: debian:trixie
|
|
node_arch: x86
|
|
ferretdb_arch: i386
|
|
optional: true
|
|
# ARMv6: Raspberry Pi 1 and Zero. It takes wekan/node-patches'
|
|
# node-armv6 (nobody else publishes an ARMv6 Node - nodejs.org dropped
|
|
# it after Node 11), and FerretDB and the MongoDB tools build a GOARM=6
|
|
# armv6 of their own. Their armel is GOARM=5 and WOULD run on these
|
|
# boards, but in software floating point, so it is not used here.
|
|
#
|
|
# The CONTAINER is linux/arm/v7, not linux/arm/v6, and that is not a
|
|
# typo. DEBIAN HAS NO ARMv6 PORT: debian:trixie publishes arm/v5 and
|
|
# arm/v7 only, and because containerd treats a lower ARM variant as
|
|
# compatible, asking it for linux/arm/v6 silently handed back arm/v5 -
|
|
# Debian armel, ARMv5 SOFT-float. node-armv6 is HARD-float, so it could
|
|
# not start there and the job died on
|
|
# qemu-arm: Could not open '/lib/ld-linux-armhf.so.3'
|
|
# after the whole apt install (v10.80). Debian's arm/v7 IS armhf: the
|
|
# same hard-float ABI and the same loader, so node-armv6 runs in it.
|
|
#
|
|
# Nothing ARMv7 reaches the bundle. What the container does is run
|
|
# `npm install`, and that install compiles NOTHING - it is npm-rebuild
|
|
# over pure-JavaScript packages ("rebuilt dependencies successfully",
|
|
# no node-gyp, no CXX). Every binary in the bundle is downloaded already
|
|
# built FOR ARMv6: node-armv6, ferretdb-armv6 and the armv6 MongoDB
|
|
# tools. The container only has to be a userland this arch's node can
|
|
# RUN in, and armhf is exactly that. The one thing that would have been
|
|
# the container's own CPU is the bundled qemu-user, and that is why
|
|
# SAME_ARCH_CONTAINER is false below.
|
|
- arch: armv6
|
|
platform: linux/arm/v7
|
|
image: debian:trixie
|
|
node_arch: armv6
|
|
ferretdb_arch: armv6
|
|
same_arch_container: false
|
|
optional: true
|
|
- arch: armhf
|
|
platform: linux/arm/v7
|
|
image: debian:trixie
|
|
node_arch: armv7l
|
|
ferretdb_arch: armhf
|
|
optional: true
|
|
# armv7 is the fork's generic ARMv7 build (node-armv7), a SEPARATE bundle
|
|
# from armhf (Debian's hard-float node-armhf) - the fork builds both, so
|
|
# each gets its own .zip. It runs in the same linux/arm/v7 container and
|
|
# shares FerretDB's armhf binary (FerretDB has no distinct armv7). Best-
|
|
# effort, like the other 32-bit ARM/x86 bundles.
|
|
- arch: armv7
|
|
platform: linux/arm/v7
|
|
image: debian:trixie
|
|
node_arch: armv7l
|
|
ferretdb_arch: armhf
|
|
optional: true
|
|
# loong64 has NO base image on Docker Hub - not debian, not ubuntu, at
|
|
# any tag - so there is no loong64 userland to rebuild the native
|
|
# modules in. node-loong64 and ferretdb-loong64 both exist; the
|
|
# container does not. It is BEST-EFFORT (optional): the preflight skips
|
|
# it with a warning instead of failing, because a hard failure here
|
|
# fails the whole build-extra-arches matrix job and SKIPS every job that
|
|
# needs it - docker, and through docker charts - so one
|
|
# unbuildable CPU took the Docker image down with it. It stays in the
|
|
# matrix so it is visible on every run (as a skip), and returns to a
|
|
# real build the day a linux/loong64 base image is published.
|
|
- arch: loong64
|
|
platform: linux/loong64
|
|
image: debian:trixie
|
|
node_arch: loong64
|
|
ferretdb_arch: loong64
|
|
optional: true
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# FIRST, and before "Install dependencies": this job runs
|
|
# releases/check-arch-binaries.sh, releases/record-provenance.sh,
|
|
# releases/apt-install.sh and releases/fetch.sh, and mounts $(pwd)/releases
|
|
# into the container - none of which exist without a checkout. Installing
|
|
# the packages first is what broke the v10.88 run: the install step is
|
|
# itself one of those scripts now, so it stopped at
|
|
#
|
|
# bash: /home/runner/work/wekan/wekan/releases/apt-install.sh: No such file or directory
|
|
#
|
|
# It also has to come before the artifact download, because
|
|
# actions/checkout cleans the workspace and would remove the bundle.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
bash "$GITHUB_WORKSPACE/releases/apt-install.sh" curl unzip zip
|
|
|
|
- name: Set up QEMU for ${{ matrix.arch }} emulation
|
|
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
|
|
|
|
- name: Download amd64 bundle
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: bundle-amd64
|
|
|
|
# The artifact IS the zip (build-amd64 uploads wekan-<version>-amd64.zip),
|
|
# so it has to be unpacked before the container mounts $(pwd)/bundle - the
|
|
# same unzip build-arm64/win64/mac-arm64 do. Without it Docker creates an
|
|
# EMPTY /bundle and the rebuild dies with
|
|
# "ENOENT ... /bundle/programs/server/package.json".
|
|
- name: Unpack the amd64 bundle
|
|
run: unzip -q "wekan-${VERSION}-amd64.zip"
|
|
|
|
# Everything this bundle needs from another project's releases, checked
|
|
# BEFORE any of it is used: a base image for this CPU, a Node.js build for
|
|
# it, the FerretDB binary, the MongoDB tools. Any of them can be absent - a
|
|
# fork build that has not finished, a release that skipped an architecture
|
|
# - and when one is, the job should stop here naming WHICH file is missing
|
|
# and WHERE it should be published, rather than an hour later inside an
|
|
# emulated container with a 404 in the middle of an npm install.
|
|
- name: Check the binaries ${{ matrix.arch }} needs exist
|
|
id: preflight
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
MATRIX_NODE_ARCH: ${{ matrix.node_arch }}
|
|
MATRIX_FERRETDB_ARCH: ${{ matrix.ferretdb_arch }}
|
|
MATRIX_IMAGE: ${{ matrix.image }}
|
|
MATRIX_PLATFORM: ${{ matrix.platform }}
|
|
MATRIX_OPTIONAL: ${{ matrix.optional }}
|
|
run: |
|
|
set -euo pipefail
|
|
bash releases/check-arch-binaries.sh \
|
|
"${MATRIX_ARCH}" \
|
|
"${MATRIX_NODE_ARCH}" \
|
|
"${MATRIX_FERRETDB_ARCH}" \
|
|
"$NODE_VERSION" \
|
|
"${MATRIX_IMAGE}" \
|
|
"${MATRIX_PLATFORM}" \
|
|
"${MATRIX_OPTIONAL}" \
|
|
| tee /tmp/preflight.txt
|
|
# skip=true when a best-effort arch has no Node.js port yet; the build
|
|
# steps below are gated on it. node_* are absent in that case.
|
|
grep -E '^(node_full|node_from|node_url|node_kind|node_member|node_sha256|skip)=' /tmp/preflight.txt >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Record where this bundle's Node.js came from
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
env:
|
|
NODE_FULL: ${{ steps.preflight.outputs.node_full }}
|
|
NODE_FROM: ${{ steps.preflight.outputs.node_from }}
|
|
NODE_URL: ${{ steps.preflight.outputs.node_url }}
|
|
NODE_SHA256: ${{ steps.preflight.outputs.node_sha256 }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
bash releases/record-provenance.sh "${MATRIX_ARCH}" 'Node.js' \
|
|
"$NODE_FROM" "$NODE_FULL" "$NODE_URL" "${NODE_SHA256:-}"
|
|
|
|
- name: Rebuild native modules for ${{ matrix.arch }} under emulation
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
env:
|
|
NODE_FULL: ${{ steps.preflight.outputs.node_full }}
|
|
NODE_FROM: ${{ steps.preflight.outputs.node_from }}
|
|
NODE_URL: ${{ steps.preflight.outputs.node_url }}
|
|
NODE_KIND: ${{ steps.preflight.outputs.node_kind }}
|
|
NODE_MEMBER: ${{ steps.preflight.outputs.node_member }}
|
|
NODE_SHA256: ${{ steps.preflight.outputs.node_sha256 }}
|
|
MATRIX_NODE_ARCH: ${{ matrix.node_arch }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
MATRIX_PLATFORM: ${{ matrix.platform }}
|
|
MATRIX_SAME_ARCH_CONTAINER: ${{ matrix.same_arch_container }}
|
|
MATRIX_IMAGE: ${{ matrix.image }}
|
|
run: |
|
|
set -euo pipefail
|
|
# bcrypt 5.0.1 (Meteor accounts-password) ships node-addon-api@3 which
|
|
# fails to compile on Node 26; the npm install inside the container
|
|
# compiles it (and any other native module) for the target arch.
|
|
BCRYPT_DIR="$(pwd)/bundle/programs/server/npm/node_modules/meteor/accounts-password/node_modules/bcrypt"
|
|
if [ -d "$BCRYPT_DIR" ]; then
|
|
(cd "$BCRYPT_DIR" && npm install --no-save node-addon-api@^8 >/dev/null 2>&1 || true)
|
|
fi
|
|
|
|
# The official node:${NODE_VERSION} image publishes only amd64 and
|
|
# arm64, so `docker run --platform linux/s390x node:26-slim` fails with
|
|
# "no matching manifest". Run a plain distribution image that does
|
|
# publish this architecture and install Node.js inside it.
|
|
echo "Using Node ${NODE_FULL} (${MATRIX_NODE_ARCH}) for ${MATRIX_ARCH}, from ${NODE_FROM}"
|
|
|
|
# The container script is a FILE, mounted in. It used to be an inline
|
|
# `bash -c '...'` and it contains apostrophes - which a single-quoted
|
|
# shell argument cannot hold. The first one ENDED the string, the rest
|
|
# of the script became separate words, and ${NODE_ARCH} was left to the
|
|
# RUNNER's shell, which does not have it. So every one of these jobs
|
|
# asked nodejs.org for "node-v24.18.1-linux-.tar.xz", with an empty
|
|
# architecture, and died on the 404 - four of the six failures in the
|
|
# v10.57 run. A file has no quoting layer to get wrong, and `bash -n`
|
|
# can check it.
|
|
# install-node-for-arch.sh refuses to run without TMPDIR: the
|
|
# container's own /tmp is a small part of its writable layer, so its
|
|
# /tmp is this checkout's .tools/tmp/repack-<arch>-tmp, as in
|
|
# releases/repack-bundle-for-arch.sh. Without it every emulated arch
|
|
# failed at "TMPDIR must be the mounted .tools/tmp" (v12.66).
|
|
CONTAINER_TMP="$(pwd)/.tools/tmp/repack-${MATRIX_ARCH}-tmp"
|
|
mkdir -p "$CONTAINER_TMP" && chmod 1777 "$CONTAINER_TMP"
|
|
docker run --rm --platform "${MATRIX_PLATFORM}" \
|
|
-e TMPDIR=/tmp \
|
|
-v "$CONTAINER_TMP:/tmp" \
|
|
-e NODE_FULL="$NODE_FULL" \
|
|
-e NODE_FROM="$NODE_FROM" \
|
|
-e NODE_URL="$NODE_URL" \
|
|
-e NODE_KIND="$NODE_KIND" \
|
|
-e NODE_MEMBER="$NODE_MEMBER" \
|
|
-e NODE_SHA256="$NODE_SHA256" \
|
|
-e ARCH="${MATRIX_ARCH}" \
|
|
-e NODE_ARCH="${MATRIX_NODE_ARCH}" \
|
|
-e SAME_ARCH_CONTAINER="${MATRIX_SAME_ARCH_CONTAINER}" \
|
|
-v "$(pwd)/bundle:/bundle" \
|
|
-v "$(pwd)/releases:/releases:ro" \
|
|
-w /bundle/programs/server \
|
|
"${MATRIX_IMAGE}" \
|
|
bash /releases/install-node-for-arch.sh
|
|
|
|
- name: Embed FerretDB (${{ matrix.arch }}) into the bundle
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
# These arches have no MongoDB server, so FerretDB is their default DB.
|
|
# The launcher (start-wekan.sh) is inherited from the amd64 base bundle;
|
|
# download only this arch's binary from the newest wekan/FerretDB release.
|
|
# A marker file makes FerretDB the default backend at runtime (see the
|
|
# launcher + Docker entrypoint).
|
|
env:
|
|
MATRIX_FERRETDB_ARCH: ${{ matrix.ferretdb_arch }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
# `ferretdb_arch`, not `arch`: FerretDB names the 32-bit ARM asset armhf
|
|
# and the 32-bit x86 one i386, which is what we call them too - but the
|
|
# two names are kept separate here so a platform whose Node.js name,
|
|
# FerretDB name and our own name disagree cannot silently download the
|
|
# wrong CPU's binary.
|
|
# The SQLite-only ferretdb-sqlite-<arch> from the newest wekan/FerretDB
|
|
# release that has it - or, until one does, the full ferretdb-<arch> of the
|
|
# newest release - verified against its .sha256sum. No FerretDB is built
|
|
# here. releases/ferretdb-asset.sh says in the log which one it took and
|
|
# why, and hands back FERRET_ASSET, FERRET_TAG, FERRET_URL and FERRET_SHA
|
|
# for the provenance record (here, and through $GITHUB_ENV in later steps).
|
|
ferret_meta="$(bash "$GITHUB_WORKSPACE/releases/ferretdb-asset.sh" "${MATRIX_FERRETDB_ARCH}" -o bundle/ferretdb)" \
|
|
|| { echo "::error::FerretDB for ${MATRIX_FERRETDB_ARCH} could not be put in the bundle; the lines above say why."; exit 1; }
|
|
eval "$ferret_meta"
|
|
bash releases/record-provenance.sh "${MATRIX_ARCH}" 'FerretDB' \
|
|
'wekan/FerretDB' "${FERRET_TAG:-latest}" "$FERRET_URL" "$FERRET_SHA"
|
|
# Overwrite the inherited amd64 MongoDB Database Tools with this arch's ones.
|
|
# Tolerant: wekan/mongo-tools-patches does not publish mongo-tools for every arch this
|
|
# bundle is built for, and a missing mongodump is a missing convenience,
|
|
# not a broken bundle - FerretDB is the database and the launcher does
|
|
# not need these to start. A silently-amd64 tool would be worse.
|
|
# It removes the inherited amd64 tools first, so a platform with none
|
|
# ships without them rather than with the wrong CPU's.
|
|
rc=0; bash "$GITHUB_WORKSPACE/releases/fetch-mongo-tools.sh" bundle "${MATRIX_FERRETDB_ARCH}" || rc=$?
|
|
[ "$rc" != 2 ] || { echo "::error::A MongoDB Database Tools download failed or did not match its checksum; the lines above say which."; exit 1; }
|
|
[ "$rc" = 0 ] || echo "::warning::No MongoDB Database Tools for ${MATRIX_FERRETDB_ARCH} in wekan/mongo-tools-patches; the bundle ships without them."
|
|
touch bundle/.ferretdb-default
|
|
|
|
- name: Create ${{ matrix.arch }} zip
|
|
id: zip
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
python3 "$GITHUB_WORKSPACE/releases/check-telemetry.py" --bundle bundle
|
|
zip -r "wekan-${VERSION}-${MATRIX_ARCH}.zip" bundle
|
|
# A zip that EXISTS is not a zip that WORKS, and the log should say which of the
|
|
# two this is. The size answers "was the bundle directory empty when it was
|
|
# zipped"; the entries answer "can this bundle start at all" - bundle/main.js is
|
|
# what the launcher runs, bundle/node is the runtime the zip promises to carry.
|
|
zip="wekan-${VERSION}-${MATRIX_ARCH}.zip"
|
|
if [ ! -f "$zip" ]; then
|
|
echo "::error::$zip was not created. The build step above produced no bundle - its log says why."
|
|
exit 1
|
|
fi
|
|
bytes=$(wc -c < "$zip")
|
|
if [ "$bytes" -lt 10000000 ]; then
|
|
echo "::error::$zip is only $bytes bytes; a whole bundle is tens of megabytes. The bundle directory was empty or partial when it was zipped."
|
|
exit 1
|
|
fi
|
|
# Listing to a FILE first: `unzip -l "$zip" | grep -q` ends unzip with
|
|
# SIGPIPE the moment grep matches, and `set -o pipefail` then reports 141
|
|
# for the pipeline - so a found file reads as a missing one. It is what
|
|
# broke the win64 verify twice; these have only been lucky about the size
|
|
# of the pipe buffer.
|
|
unzip -l "$zip" > zip-listing.txt
|
|
for want in bundle/main.js bundle/node; do
|
|
if ! grep -q " $want$" zip-listing.txt; then
|
|
echo "::error::$zip has no $want, so it cannot start WeKan. The embed step above did not put it into the bundle."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "OK: $zip is $((bytes/1024/1024)) MiB and contains bundle/main.js and bundle/node."
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: bundle-${{ matrix.arch }}
|
|
path: wekan-${{ needs.prepare.outputs.version }}-${{ matrix.arch }}.zip
|
|
retention-days: 1
|
|
|
|
|
|
# always() + the zip step's outcome, like the attach step below: the
|
|
# checksum is part of what gets attached, so a cancel after the zip was
|
|
# built must not skip it and leave the zip with nothing to attach.
|
|
- name: Checksum the ${{ matrix.arch }} zip and collect provenance
|
|
id: checksum
|
|
if: ${{ always() && steps.zip.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
zip="wekan-${VERSION}-${MATRIX_ARCH}.zip"
|
|
sha256sum "$zip" > "${zip}.sha256sum"
|
|
cat "${zip}.sha256sum"
|
|
mkdir -p provenance
|
|
[ -f provenance.tsv ] && mv provenance.tsv "provenance/${MATRIX_ARCH}.tsv" || true
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
if: steps.preflight.outputs.skip != 'true'
|
|
with:
|
|
name: provenance-${{ matrix.arch }}
|
|
path: provenance/
|
|
if-no-files-found: warn
|
|
|
|
- name: Attach ${{ matrix.arch }} bundle to the GitHub Release
|
|
if: ${{ always() && steps.checksum.outcome == 'success' && steps.preflight.outputs.skip != 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# No repo checkout in this job, so set GH_REPO so `gh` knows the target
|
|
# repository instead of trying (and failing) to detect a git remote.
|
|
GH_REPO: ${{ github.repository }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="wekan-${VERSION}-${MATRIX_ARCH}.zip"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-extra-arches ${MATRIX_ARCH}"
|
|
echo "$mark build-extra-arches ${MATRIX_ARCH}" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-extra-arches ${MATRIX_ARCH} FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 7c. Build the Sandstorm .spk and attach it to the Release ───────────────
|
|
# Same steps as the standalone sandstorm.yml workflow (kept for building/testing
|
|
# the .spk on its own without a full release); here it builds from the release
|
|
# tag and attaches wekan-<version>-sandstorm.spk to the GitHub Release.
|
|
#
|
|
# EXPERIMENTAL in CI (same caveats as sandstorm.yml):
|
|
# * Sandstorm needs unprivileged user namespaces; GitHub's Ubuntu runners are VMs
|
|
# that allow them, but this is the fragile part.
|
|
# * meteor-spk SIGNS the .spk with the app private key from the Sandstorm keyring;
|
|
# provide it as the SANDSTORM_KEYRING secret (base64 of ~/.sandstorm-keyring).
|
|
#
|
|
# continue-on-error: the experimental Sandstorm build must NOT fail the release;
|
|
# like the other post-`release` bundle jobs it only attaches its artifact.
|
|
build-sandstorm:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, release]
|
|
continue-on-error: true
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
SANDSTORM_KEYRING: ${{ secrets.SANDSTORM_KEYRING }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${SANDSTORM_KEYRING:-}" ] || missing="$missing SANDSTORM_KEYRING"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::build-sandstorm: missing repository secret(s):$missing — the .spk cannot be packed. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " SANDSTORM_KEYRING - base64 of ~/.sandstorm-keyring; meteor-spk signs the .spk with it"
|
|
exit 1
|
|
fi
|
|
# Present is not the same as WORKING: a keyring that is not valid base64
|
|
# used to surface half an hour later, as `meteor-spk pack` failing to open
|
|
# a file it had written garbage into.
|
|
if ! bytes="$(printf '%s' "$SANDSTORM_KEYRING" | base64 -d 2>/dev/null | wc -c)" || [ "$bytes" -eq 0 ]; then
|
|
echo "::error::build-sandstorm: SANDSTORM_KEYRING is not valid base64, or decodes to nothing. Set it with: base64 -w0 ~/.sandstorm-keyring"
|
|
exit 1
|
|
fi
|
|
echo "build-sandstorm: SANDSTORM_KEYRING decodes to $bytes bytes."
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Use release npm version
|
|
run: bash releases/use-release-npm.sh
|
|
|
|
- name: Enable unprivileged user namespaces (Ubuntu 24.04 restricts them)
|
|
# Ubuntu 24.04's AppArmor defaults kernel.apparmor_restrict_unprivileged_userns=1,
|
|
# which blocks the unprivileged user namespaces that the Sandstorm install and
|
|
# the spk supervisor rely on (the "fragile part" noted above). Relax it so
|
|
# `install.sandstorm.org` and meteor-spk can create sandboxes on the runner.
|
|
# `|| true`: on kernels/runners without these knobs, setting them is a no-op.
|
|
run: |
|
|
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
|
|
sudo sysctl -w kernel.unprivileged_userns_clone=1 2>/dev/null || true
|
|
|
|
- name: Install system dependencies and Meteor
|
|
run: |
|
|
bash "$GITHUB_WORKSPACE/releases/apt-install.sh" p7zip-full wget curl libatomic1 build-essential g++ make python3 unzip xz-utils git qemu-user-static
|
|
if [ ! -f "$HOME/.meteor/meteor" ]; then
|
|
# Downloaded, then run: a `curl | sh` cannot be retried, because
|
|
# by the time the download fails sh is already half way through it.
|
|
bash "$GITHUB_WORKSPACE/releases/fetch.sh" -o /tmp/install-meteor.sh https://install.meteor.com/
|
|
sh /tmp/install-meteor.sh
|
|
fi
|
|
echo "$HOME/.meteor" >> "$GITHUB_PATH"
|
|
|
|
- name: Install Sandstorm (dev, unattended)
|
|
# Installed BEFORE assembling the deps: build-deps.sh's [bridge] step copies
|
|
# the modern /opt/sandstorm/latest/bin/sandstorm-http-bridge over the ancient
|
|
# bundled one, so the Sandstorm install must be in place first.
|
|
run: |
|
|
# Downloaded, then run: a `curl | sh` cannot be retried, because by the
|
|
# time the download fails sh is already half way through the script.
|
|
bash "$GITHUB_WORKSPACE/releases/fetch.sh" -o /tmp/install-sandstorm.sh https://install.sandstorm.org
|
|
sudo bash /tmp/install-sandstorm.sh -d
|
|
|
|
- name: Assemble modern meteor-spk.deps (Node 26 + FerretDB + Mongo 3.x CLIs)
|
|
# Base = upstream meteor-spk 0.6.0 from dl.sandstorm.org (has mongod 3.0 +
|
|
# niscud). build-deps.sh swaps in Node 26, adds FerretDB + the Mongo 3.x
|
|
# CLIs + the migration launcher/importer, keeps niscud, and swaps in the
|
|
# modern sandstorm-http-bridge from the Sandstorm install above. No dependency
|
|
# on the retired releases.wekan.team or the old projects.7z.
|
|
# FerretDB is the PREBUILT SQLite-only ferretdb-sqlite-amd64 from the newest
|
|
# wekan/FerretDB release that has it (the full ferretdb-amd64 of the newest
|
|
# release until one does), picked by releases/ferretdb-asset.sh - nothing
|
|
# is compiled here (docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md).
|
|
env:
|
|
FERRETDB_SOURCE: download
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
bash sandstorm-src/build-deps.sh
|
|
echo "$GITHUB_WORKSPACE/.tools/projects/meteor-spk/meteor-spk-0.6.0" >> "$GITHUB_PATH"
|
|
|
|
- name: Restore the Sandstorm signing keyring
|
|
env:
|
|
SANDSTORM_KEYRING: ${{ secrets.SANDSTORM_KEYRING }}
|
|
run: |
|
|
if [ -n "${SANDSTORM_KEYRING:-}" ]; then
|
|
# meteor-spk / spk read the app signing key from ~/.sandstorm-keyring —
|
|
# a FILE directly in $HOME (see the pack crash path
|
|
# "/home/runner/.sandstorm-keyring"). Write it exactly there, NOT to
|
|
# ~/.sandstorm/sandstorm-keyring, or `meteor-spk pack` aborts with
|
|
# "open(~/.sandstorm-keyring): No such file or directory".
|
|
printf '%s' "$SANDSTORM_KEYRING" | base64 -d > "$HOME/.sandstorm-keyring"
|
|
chmod 600 "$HOME/.sandstorm-keyring"
|
|
echo "Restored ~/.sandstorm-keyring ($(wc -c < "$HOME/.sandstorm-keyring") bytes)."
|
|
else
|
|
echo "::error::SANDSTORM_KEYRING secret is not set. spk pack signs the .spk with the WeKan Sandstorm app's private key, which lives in this keyring, so packing cannot proceed without it. Add the base64 of your ~/.sandstorm-keyring file as the SANDSTORM_KEYRING repository secret (e.g. 'base64 -w0 ~/.sandstorm-keyring')."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install Meteor npm dependencies
|
|
# PUPPETEER_SKIP_DOWNLOAD: puppeteer is a devDependency used only by tests,
|
|
# not by the server, so it never belongs in the packed .spk. Skipping its
|
|
# Chromium download (~150 MB) avoids any risk of it bloating the build and
|
|
# speeds up CI.
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: '1'
|
|
run: |
|
|
(meteor update --npm 2>/dev/null || true) && bash releases/npm-retry.sh meteor npm install
|
|
|
|
- name: Build the Sandstorm .spk
|
|
id: build
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: '1'
|
|
run: |
|
|
set -euo pipefail
|
|
# Version-named (not timestamped like sandstorm.yml): the release re-runs
|
|
# idempotently with --clobber replacing the same asset.
|
|
SPK="wekan-${VERSION}-sandstorm.spk"
|
|
|
|
# WHERE THE GIGABYTE IS. Sandstorm refuses an app over 1 GiB
|
|
# uncompressed across .meteor-spk/deps and .meteor-spk/bundle, and
|
|
# v10.93 failed on exactly that with nothing else said - so the trees
|
|
# are measured after the build, on failure and on success. `du -shL`
|
|
# DEREFERENCES: deps is a symlink to the meteor-spk.deps tree.
|
|
sizes() {
|
|
for tree in .meteor-spk/deps .meteor-spk/bundle; do
|
|
[ -e "$tree" ] || { echo "--- $tree: not present"; continue; }
|
|
echo "--- $tree: $(du -shL "$tree" 2>/dev/null | cut -f1) total"
|
|
du -shL "$tree"/* 2>/dev/null | sort -rh | head -20 || true
|
|
done
|
|
if [ -d .meteor-spk/bundle/programs/server/node_modules ]; then
|
|
echo "--- .meteor-spk/bundle/programs/server/node_modules, biggest 20:"
|
|
du -shL .meteor-spk/bundle/programs/server/node_modules/* 2>/dev/null \
|
|
| sort -rh | head -20 || true
|
|
fi
|
|
}
|
|
|
|
# The smaller .spk (docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md):
|
|
# built with the Sandstorm package profile - no password, OAuth2, OIDC,
|
|
# CAS, LDAP, SAML or social-login packages, which a grain never runs -
|
|
# then trimmed to a linux/x64 sockjs grain (bundle-trim.mjs,
|
|
# prune-unreachable-npm.mjs, prune-build-only-modules.mjs) and packed
|
|
# with Sandstorm's own `spk pack`, which packs the trimmed trees as
|
|
# they are. `meteor-spk pack` is not used: it rebuilds the bundle first
|
|
# and throws the trim away (v10.98's log: 856M -> 424M, then rebuilt).
|
|
# The trim used to run only after a FAILED pack; it is the first pack now.
|
|
set +e
|
|
bash releases/sandstorm-slim-spk.sh "$SPK"
|
|
pack_rc=$?
|
|
set -e
|
|
sizes || true
|
|
if [ "$pack_rc" -ne 0 ]; then
|
|
echo "::error::the Sandstorm .spk did not pack (exit $pack_rc). The sizes above are what it tried to pack; Sandstorm's limit is 1 GiB uncompressed across .meteor-spk/deps and .meteor-spk/bundle together."
|
|
exit "$pack_rc"
|
|
fi
|
|
# Report the packed size and warn if it exceeds Cloudflare's 100 MB upload
|
|
# cap (a proxied browser upload to a Cloudflare-fronted Sandstorm 413s above
|
|
# this; install via a DNS-only host / SSH tunnel, or trim further).
|
|
SPK_BYTES=$(stat -c%s "$SPK")
|
|
echo "Packed $SPK: $((SPK_BYTES/1024/1024)) MiB ($SPK_BYTES bytes)"
|
|
if [ "$SPK_BYTES" -gt $((100*1024*1024)) ]; then
|
|
echo "::warning::$SPK is $((SPK_BYTES/1024/1024)) MiB — over Cloudflare's 100 MB upload limit. Upload via a DNS-only host / SSH tunnel to Sandstorm, or trim the bundle further."
|
|
fi
|
|
ls -la "$SPK"
|
|
echo "spk=$SPK" >> "$GITHUB_OUTPUT"
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: ${{ steps.build.outputs.spk }}
|
|
path: ${{ steps.build.outputs.spk }}
|
|
retention-days: 7
|
|
|
|
- name: Attach the .spk to the GitHub Release
|
|
if: ${{ always() && steps.build.outcome == 'success' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
STEP_BUILD_SPK: ${{ steps.build.outputs.spk }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="${STEP_BUILD_SPK}"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
# Retried, bounded, and verified by name AND size from the release
|
|
# side; see releases/github-release-upload.sh.
|
|
bash "$GITHUB_WORKSPACE/releases/github-release-upload.sh" "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark build-sandstorm"
|
|
echo "$mark build-sandstorm" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::build-sandstorm FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 8. Build and push the multi-arch Docker image to all registries ────────
|
|
# Mirrors releases/docker-build.sh step 3 (multi-arch buildx --push).
|
|
# Needs `release` because the Dockerfile downloads wekan-<version>-<arch>.zip
|
|
# from the GitHub Release; building before those assets exist 404s and (without
|
|
# set -e in the Dockerfile) shipped a broken image missing /build/main.js. Also
|
|
# needs `build-extra-arches` because the image now covers ppc64le/s390x/riscv64,
|
|
# whose zips (with FerretDB baked in) are attached by that job after `release`.
|
|
docker:
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
needs: [prepare, release, build-extra-arches]
|
|
# always() + release success: build-extra-arches is a matrix, and if ANY leg
|
|
# fails (e.g. one exotic CPU) the whole matrix job is "failed", which would
|
|
# SKIP this job the moment it appears in `needs`. That is how one failed
|
|
# ppc64le/s390x/... skipped the entire Docker image. Run whenever the release
|
|
# itself succeeded; the "Decide platforms" step below then builds the image
|
|
# for exactly the bundles that DID land, dropping any arch whose build failed
|
|
# rather than taking the whole image down with it. (It still lists
|
|
# build-extra-arches in needs, so it waits for the successful legs to upload
|
|
# their bundles first.)
|
|
if: ${{ !cancelled() && needs.release.result == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# eight platforms under QEMU, each downloading its own ~311 MB bundle.
|
|
timeout-minutes: 300
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
DOCKERHUB_AUTH: ${{ secrets.DOCKERHUB_AUTH }}
|
|
QUAY_AUTH: ${{ secrets.QUAY_AUTH }}
|
|
GHCR_AUTH: ${{ secrets.GHCR_AUTH }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${DOCKERHUB_AUTH:-}" ] || missing="$missing DOCKERHUB_AUTH"
|
|
[ -n "${QUAY_AUTH:-}" ] || missing="$missing QUAY_AUTH"
|
|
[ -n "${GHCR_AUTH:-}" ] || missing="$missing GHCR_AUTH"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::docker: missing repository secret(s):$missing — the image cannot be pushed. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " DOCKERHUB_AUTH - base64 of 'user:token' for docker.io"
|
|
echo " QUAY_AUTH - base64 of 'user:token' for quay.io"
|
|
echo " GHCR_AUTH - base64 of 'user:token' for ghcr.io"
|
|
exit 1
|
|
fi
|
|
# Present is not the same as WORKING. Decode and LOG IN here, at the top:
|
|
# a wrong or expired credential then says which secret it was, before the
|
|
# multi-arch build spends half an hour producing something it cannot push.
|
|
check() {
|
|
# $1 = secret name, $2 = registry host, $3 = base64("user:token")
|
|
local name="$1" host="$2" creds user token
|
|
if ! creds="$(printf '%s' "$3" | base64 -d 2>/dev/null)"; then
|
|
echo "::error::docker: $name is not valid base64. It must be base64 of 'username:token' for $host, e.g. printf '%s' 'user:token' | base64 -w0"
|
|
return 1
|
|
fi
|
|
case "$creds" in
|
|
*:*) ;;
|
|
*) echo "::error::docker: $name decodes to something without a ':' - it must be base64 of 'username:token' for $host."; return 1 ;;
|
|
esac
|
|
user="${creds%%:*}"
|
|
token="${creds#*:}"
|
|
if [ -z "$user" ] || [ -z "$token" ]; then
|
|
echo "::error::docker: $name decodes to an empty username or token for $host."
|
|
return 1
|
|
fi
|
|
if ! printf '%s' "$token" | docker login "$host" -u "$user" --password-stdin; then
|
|
echo "::error::docker: $name was REJECTED by $host (login failed as user '$user'). The token is wrong, expired, or lacks push rights."
|
|
return 1
|
|
fi
|
|
echo "docker: $name works for $host (user '$user')."
|
|
}
|
|
rc=0
|
|
check DOCKERHUB_AUTH docker.io "$DOCKERHUB_AUTH" || rc=1
|
|
check QUAY_AUTH quay.io "$QUAY_AUTH" || rc=1
|
|
check GHCR_AUTH ghcr.io "$GHCR_AUTH" || rc=1
|
|
exit $rc
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
|
|
# (The login to all three registries happens in the secrets check above, so a
|
|
# bad credential names itself before anything is built.)
|
|
|
|
- name: Decide which platforms have a bundle on the release
|
|
# The image is built from the wekan-<version>-<arch>.zip bundles on the
|
|
# release. amd64 and arm64 are REQUIRED - without them there is no image
|
|
# worth pushing, and the release would not have succeeded. The exotic
|
|
# arches are OPTIONAL here: a platform is included only if its bundle
|
|
# actually landed, so one failed extra-arch (ppc64le/s390x/riscv64/i386/
|
|
# armhf) drops only ITSELF from the image instead of failing or skipping
|
|
# the whole Docker job. The chosen set drives the wait loop, the buildx
|
|
# --platform list and the push-verify want= list, so all three always agree.
|
|
run: |
|
|
set -euo pipefail
|
|
base="https://github.com/wekan/wekan/releases/download/v${VERSION}"
|
|
# Three answers, not two: present, absent, or "the server would not
|
|
# say". github.com 503s for minutes at a time, and a 503 read as
|
|
# "that bundle is not on the release" would drop an architecture that
|
|
# is sitting right there - silently, with a ::warning:: nobody reads
|
|
# until somebody on ppc64le asks where their image went. fetch.sh
|
|
# --check retries a 503 and exits 2 when it still cannot tell; that
|
|
# stops the job instead of shipping a quietly smaller image.
|
|
have() {
|
|
bash "$GITHUB_WORKSPACE/releases/fetch.sh" --check "$1"
|
|
case $? in
|
|
0) return 0 ;;
|
|
1) return 1 ;;
|
|
*) echo "::error::Cannot tell whether $1 is on the release: github.com did not answer. Re-run this job rather than ship an image missing a platform."; exit 1 ;;
|
|
esac
|
|
}
|
|
# docker platform : the wekan bundle arch the Dockerfile downloads for it.
|
|
# linux/arm/v6 and linux/arm/v7 are BOTH TARGETARCH=arm and differ only in
|
|
# TARGETVARIANT, which is why the Dockerfile's arch case reads the variant.
|
|
req="linux/amd64:amd64 linux/arm64:arm64"
|
|
opt="linux/ppc64le:ppc64le linux/s390x:s390x linux/riscv64:riscv64 linux/386:i386 linux/arm/v6:armv6 linux/arm/v7:armhf"
|
|
|
|
# A bundle on the release is not enough: the BASE IMAGE has to publish the
|
|
# platform too, and for 32-bit ARM that is not a clean failure when it does
|
|
# not. containerd treats a LOWER arm variant as compatible, so a
|
|
# linux/arm/v6 request against a base that has arm/v5 and arm/v7 silently
|
|
# resolves to arm/v5 - Debian armel, SOFT-float - and the hard-float
|
|
# node-armv6 inside the armv6 bundle cannot run on that userland. Ask the
|
|
# base once, and treat a platform it does not publish exactly like a bundle
|
|
# that did not land. The base is read out of the Dockerfile so there is no
|
|
# second copy of its name here. arm64 is recorded as arm64/v8, which
|
|
# everyone writes as linux/arm64, so the implied /v8 is normalised away -
|
|
# the same normalisation the push-verify does below. It is the LAST FROM:
|
|
# the first is the bundle stage, which runs on the build machine
|
|
# (--platform=$BUILDPLATFORM) and is not what the image is made of.
|
|
base_image="$(awk '/^FROM /{base=$2} END{print base}' Dockerfile)"
|
|
base_plats="$(docker buildx imagetools inspect "$base_image" \
|
|
--format '{{range .Manifest.Manifests}}{{.Platform.OS}}/{{.Platform.Architecture}}{{if .Platform.Variant}}/{{.Platform.Variant}}{{end}} {{end}}' \
|
|
| sed 's#/v8 # #g')" || {
|
|
echo "::error::Cannot read the platform list of the base image ${base_image}."; exit 1; }
|
|
echo "Base image ${base_image} publishes: ${base_plats}"
|
|
base_has() { case " $base_plats " in *" $1 "*) return 0 ;; *) return 1 ;; esac; }
|
|
|
|
platforms=""; want=""; arches=""
|
|
for pair in $req; do
|
|
p="${pair%%:*}"; a="${pair#*:}"
|
|
if ! base_has "$p"; then
|
|
echo "::error::The base image ${base_image} does not publish $p, so the image cannot be built for it - and it is a CORE platform."
|
|
exit 1
|
|
fi
|
|
if have "${base}/wekan-${VERSION}-${a}.zip"; then
|
|
platforms="${platforms:+$platforms,}$p"; want="${want:+$want }$p"; arches="${arches:+$arches }$a"
|
|
else
|
|
echo "::error::Core bundle wekan-${VERSION}-${a}.zip is not on the release; the image needs at least amd64 and arm64."
|
|
exit 1
|
|
fi
|
|
done
|
|
for pair in $opt; do
|
|
p="${pair%%:*}"; a="${pair#*:}"
|
|
if ! base_has "$p"; then
|
|
echo "::warning::$p is dropped from the image: the base image ${base_image} publishes no $p, and a request for it would resolve to a lower-variant base the ${a} bundle cannot run on. The ${a} bundle zip is unaffected."
|
|
continue
|
|
fi
|
|
if have "${base}/wekan-${VERSION}-${a}.zip"; then
|
|
platforms="${platforms},$p"; want="${want} $p"; arches="${arches} $a"
|
|
echo "including $p (wekan-${VERSION}-${a}.zip present)"
|
|
else
|
|
echo "::warning::$p is dropped from the image: wekan-${VERSION}-${a}.zip is not on the release (its build failed, or is best-effort and skipped). The image ships without it and gains it back the next release that builds it."
|
|
fi
|
|
done
|
|
echo "PLATFORMS=$platforms" >> "$GITHUB_ENV"
|
|
echo "WANT=$want" >> "$GITHUB_ENV"
|
|
echo "BUNDLE_ARCHES=$arches" >> "$GITHUB_ENV"
|
|
echo "Image platforms: $platforms"
|
|
|
|
- name: Wait for release bundles to be downloadable
|
|
# The Dockerfile downloads wekan-<version>-<arch>.zip from the GitHub
|
|
# Release for each built platform. Even though this job needs `release`
|
|
# (so the assets are uploaded), GitHub's releases/download/<tag>/<asset>
|
|
# URL can briefly 404 right after upload (CDN/propagation lag), which used
|
|
# to fail the multi-arch build mid-way. Poll here until every arch bundle
|
|
# baked into the image returns 200, so the (expensive, emulated) buildx run
|
|
# only starts once the assets are actually fetchable. Only the arches the
|
|
# step above CHOSE (BUNDLE_ARCHES) are waited for. The Dockerfile also
|
|
# retries per-arch as a second layer of safety.
|
|
run: |
|
|
set -euo pipefail
|
|
base="https://github.com/wekan/wekan/releases/download/v${VERSION}"
|
|
for arch in $BUNDLE_ARCHES; do
|
|
url="${base}/wekan-${VERSION}-${arch}.zip"
|
|
echo "Waiting for ${url} ..."
|
|
ok=0
|
|
for i in $(seq 1 30); do
|
|
code=$(curl -sSL -o /dev/null -w '%{http_code}' --retry 0 -I "$url" || echo 000)
|
|
if [ "$code" = "200" ]; then
|
|
echo " available (HTTP $code) after $((i*10))s"
|
|
ok=1
|
|
break
|
|
fi
|
|
echo " attempt $i/30: HTTP $code, retrying in 10s..."
|
|
sleep 10
|
|
done
|
|
if [ "$ok" -ne 1 ]; then
|
|
echo "::error::Release asset not downloadable after retries: $url"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
- name: Verify the release bundle reports the release version
|
|
# Belt-and-suspenders against the "image tagged vX shows vY in the Admin
|
|
# Panel" bug: the image is just the unzipped wekan-<version>-<arch>.zip
|
|
# bundle (Dockerfile moves it to /build), and the Admin Panel shows that
|
|
# bundle's WeKan version (server/statistics.js reads
|
|
# require('/package.json').version). Check the amd64 bundle's WeKan version
|
|
# equals the release version BEFORE the expensive multi-arch buildx, so a
|
|
# stale/mismatched bundle fails fast instead of shipping (and pushing to
|
|
# three registries) a mislabeled image.
|
|
#
|
|
# Meteor does NOT ship the app package.json as a standalone file — it
|
|
# inlines it into the compiled bundle/programs/server/app/app.js as a JSON
|
|
# module, e.g. {"name":"wekan","version":"v9.63.0",...}. That inlined
|
|
# module (anchored on "name":"wekan") is exactly what require('/package.json')
|
|
# resolves to at runtime, so it is the authoritative thing to check.
|
|
#
|
|
# IMPORTANT: only a CONFIRMED mismatch fails the release. If the version
|
|
# cannot be located (bundle layout changed, app.js minified differently),
|
|
# warn and continue — inability to verify must not block a good release,
|
|
# since --build-arg VERSION below is the actual guarantee. (An earlier
|
|
# version of this guard grepped for a v-prefixed *package.json* and made
|
|
# "not found" fatal, which false-failed the whole v9.63 docker build.)
|
|
run: |
|
|
set -euo pipefail
|
|
url="https://github.com/wekan/wekan/releases/download/v${VERSION}/wekan-${VERSION}-amd64.zip"
|
|
wget -q "$url" -O bundle.zip
|
|
tmp="$(mktemp -d)"
|
|
# Extract only the compiled app program (not the whole multi-hundred-MB
|
|
# bundle); the inlined app package.json lives in app/app.js.
|
|
unzip -o -q bundle.zip 'bundle/programs/server/app/app.js' -d "$tmp" || true
|
|
appjs="$tmp/bundle/programs/server/app/app.js"
|
|
found=""
|
|
if [ -f "$appjs" ]; then
|
|
match="$(grep -aoE '"name":"wekan","version":"v?[0-9][^"]*"' "$appjs" | head -1 || true)"
|
|
if [ -z "$match" ]; then
|
|
# The rspack build keeps only the fields the code reads, and the
|
|
# server reads only require('/package.json').version - so the
|
|
# module is JSON.parse('{"version":"v12.38.0"}') with no "name" to
|
|
# anchor on, and this check was skipped on every release. WeKan's
|
|
# is the only v-prefixed one; use it only when it is unambiguous.
|
|
match="$(grep -aoE "JSON\.parse\('\{\"version\":\"v[0-9][^\"]*\"\}'\)" "$appjs" | sort -u || true)"
|
|
[ "$(printf '%s\n' "$match" | grep -c .)" -eq 1 ] || match=""
|
|
fi
|
|
found="$(printf '%s' "$match" | sed -E 's/.*"version":"([^"]*)".*/\1/')"
|
|
fi
|
|
rm -rf "$tmp" bundle.zip
|
|
if [ -z "$found" ]; then
|
|
echo "::warning::Could not locate the WeKan version in the bundle (app.js layout may have changed); skipping the bundle-version check. --build-arg VERSION still guarantees the correct bundle."
|
|
exit 0
|
|
fi
|
|
norm="${found#v}"
|
|
if [ "$norm" != "${VERSION}.0" ] && [ "$norm" != "${VERSION}" ]; then
|
|
echo "::error::Bundle reports app version ${found} but the release is v${VERSION}. The bundle baked into the image is stale/mismatched — the Admin Panel would show ${norm}. Aborting before build."
|
|
exit 1
|
|
fi
|
|
echo "Bundle app version ${found} matches release v${VERSION}."
|
|
|
|
- name: Check we can PUSH to every repository, before building anything
|
|
env:
|
|
DOCKERHUB_AUTH: ${{ secrets.DOCKERHUB_AUTH }}
|
|
QUAY_AUTH: ${{ secrets.QUAY_AUTH }}
|
|
GHCR_AUTH: ${{ secrets.GHCR_AUTH }}
|
|
# v10.88 built every architecture, emulated, for the best part of an hour,
|
|
# and threw it away on the last line:
|
|
#
|
|
# ERROR: failed to push quay.io/wekan/wekan-ondra:v10.88:
|
|
# unauthorized: access to the requested resource is not authorized
|
|
#
|
|
# The credentials were fine - the login check above passed. Quay grants
|
|
# push per REPOSITORY, and that one had just been created by the release
|
|
# itself. (The variant images are not pushed at all any more, but the
|
|
# lesson is the reason this step exists.) Nothing about a permission
|
|
# needs a BUILD to discover: a registry will say whether it would grant a
|
|
# push token for a repository, in one request, before anything is built.
|
|
run: |
|
|
set -uo pipefail
|
|
rc=0
|
|
can_push() { # <image> <base64 user:token>
|
|
image="$1"; auth="$2"
|
|
case "$image" in
|
|
ghcr.io/*) repo="${image#ghcr.io/}"; token_url="https://ghcr.io/token?service=ghcr.io&scope=repository:${repo}:push,pull" ;;
|
|
quay.io/*) repo="${image#quay.io/}"; token_url="https://quay.io/v2/auth?service=quay.io&scope=repository:${repo}:push,pull" ;;
|
|
*) repo="$image"; token_url="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:push,pull" ;;
|
|
esac
|
|
token="$(curl -sS --max-time 30 -H "Authorization: Basic ${auth}" "$token_url" | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')"
|
|
if [ -z "$token" ]; then
|
|
echo "::warning::${image}: the registry returned no token; skipping this check (that is the network, not the rights)."
|
|
return 0
|
|
fi
|
|
# ONLY AN EXPLICIT REFUSAL FAILS THE JOB, and that is not caution -
|
|
# it is what the registries actually return. Quay and Docker Hub hand
|
|
# back a JWT whose payload lists what was granted:
|
|
#
|
|
# {"access":[{"type":"repository","name":"wekan/wekan","actions":["pull"]}]}
|
|
#
|
|
# so asking for push,pull and being given pull is a refusal, in
|
|
# writing. GHCR does not: its token is opaque and has no payload at
|
|
# all - "v1:wekan/wekan:1786595038984745940", no dots, no claims - so
|
|
# there is nothing to read. Treating that silence as a refusal is
|
|
# what this step did on its first run, and it stopped the v10.89
|
|
# Docker publish with "ghcr.io/wekan/wekan: the registry will NOT
|
|
# grant push" while Docker Hub and Quay were fine. So: a claim that
|
|
# names this repository and omits push is an error; anything else
|
|
# says so and carries on, and the push itself remains the last word.
|
|
payload="$(printf '%s' "$token" | cut -d. -f2 | tr '_-' '/+')"
|
|
case $(( ${#payload} % 4 )) in
|
|
2) payload="${payload}==" ;;
|
|
3) payload="${payload}=" ;;
|
|
esac
|
|
claims="$(printf '%s' "$token" | grep -q '\.' && printf '%s' "$payload" | base64 -d 2>/dev/null || true)"
|
|
case "$claims" in
|
|
*'"access"'*)
|
|
case "$claims" in
|
|
*'"push"'*) echo "OK ${image} can be pushed to" ;;
|
|
*)
|
|
echo "::error::${image}: the registry granted pull and REFUSED push. Give the account these credentials belong to write access to THAT repository - on Quay it is per-repository (Repository Settings -> User and Robot Permissions), and a repository created by an earlier push does not inherit it."
|
|
rc=1 ;;
|
|
esac
|
|
;;
|
|
*)
|
|
echo "${image}: this registry does not say what it granted (GHCR hands back an opaque token), so the push is the check."
|
|
;;
|
|
esac
|
|
}
|
|
for image in ghcr.io/wekan/wekan; do
|
|
can_push "$image" "$GHCR_AUTH"
|
|
done
|
|
# wekanteam/wekan-ondra and wekanteam/wekan-gantt-gpl: not published.
|
|
for image in wekanteam/wekan; do
|
|
can_push "$image" "$DOCKERHUB_AUTH"
|
|
done
|
|
# quay.io/wekan/wekan-ondra and quay.io/wekan/wekan-gantt-gpl: not published.
|
|
for image in quay.io/wekan/wekan; do
|
|
can_push "$image" "$QUAY_AUTH"
|
|
done
|
|
if [ "$rc" -ne 0 ]; then
|
|
echo "::error::Nothing was built. Fix the permissions above and re-run this job - an hour of emulated build is not where this should be found out."
|
|
fi
|
|
exit $rc
|
|
|
|
- name: Build and push multi-arch image
|
|
# Pass VERSION explicitly as a build-arg. The Dockerfile's `ARG VERSION`
|
|
# default is only a fallback for manual builds; the release version is the
|
|
# authoritative source here. Without this the image would build against the
|
|
# Dockerfile default (downloading that version's wekan-<v>-<arch>.zip and
|
|
# baking its package.json), so a v${VERSION}-tagged image could ship — and
|
|
# report in the Admin Panel — a stale, different version.
|
|
run: |
|
|
# $PLATFORMS is decided by the "Decide which platforms" step: amd64 and
|
|
# arm64 always, plus each exotic arch (ppc64le/s390x/riscv64/386/arm/v7)
|
|
# whose wekan-<v>-<arch>.zip actually landed on the release, so a failed
|
|
# extra-arch drops only itself. linux/loong64 is never here: no Docker
|
|
# base image publishes it and the registries do not agree on a loong64
|
|
# manifest yet, so it ships as a .zip bundle only. Every candidate arch
|
|
# is in debian:trixie's manifest AND has a fork Node the Dockerfile can
|
|
# install.
|
|
# --provenance=mode=max: full build provenance (SLSA), not the
|
|
# minimal default - what built this image, from which commit, with
|
|
# which base and build arguments. It rides in the manifest list as an
|
|
# `unknown/unknown` entry per platform, the OCI marker for "not a
|
|
# runnable image" so `docker pull` never selects it, which is why Quay
|
|
# lists one beside each real platform. mode=max makes those entries
|
|
# BIGGER, not fewer; `--provenance=false` is what removes them, at the
|
|
# cost of the evidence.
|
|
#
|
|
# The comment is here and not among the arguments: a `#` after a line
|
|
# continuation comments out the rest of the joined line, leaving
|
|
# `docker buildx build` with no platforms and no tags. This block is a
|
|
# shell script like any other, and it was written the wrong way first.
|
|
# Build once for Docker Hub and GHCR, then copy the published manifest
|
|
# to Quay in the next step. Quay can switch to read-only mode after
|
|
# this expensive build starts; a single --push across all three
|
|
# registries then reports the whole job failed even when the first
|
|
# two received a complete image.
|
|
# ONE IMAGE NAME, on three registries. wekan-ondra and wekan-gantt-gpl
|
|
# are SNAP names - they exist because a snap name cannot be changed once
|
|
# people have installed it - and there is nothing for them to be as
|
|
# Docker images: the image is the same image, and `docker pull
|
|
# wekanteam/wekan` is how you get it. They were tagged here for two
|
|
# releases and are not any more, on purpose: three extra repositories on
|
|
# three registries, each with its own visibility and its own push
|
|
# permission, is a release that can fail in six new ways to publish a
|
|
# copy of something already published.
|
|
#
|
|
# A NEW REPOSITORY IS CREATED BY THE FIRST PUSH, with the registry's
|
|
# default visibility rather than ours - Docker Hub public, QUAY PRIVATE
|
|
# - which is how ghcr.io/wekan/ferretdb shipped private for weeks. That
|
|
# is why the anonymous-pull check below exists, and why adding an image
|
|
# name here is never only a tag.
|
|
docker buildx build \
|
|
--provenance=mode=max \
|
|
--platform "${PLATFORMS}" \
|
|
--build-arg VERSION=${VERSION} \
|
|
-t wekanteam/wekan:v${VERSION} \
|
|
-t wekanteam/wekan:latest \
|
|
-t ghcr.io/wekan/wekan:v${VERSION} \
|
|
-t ghcr.io/wekan/wekan:latest \
|
|
--push \
|
|
.
|
|
|
|
# COMMENTED OUT ON PURPOSE - the variant images are not published:
|
|
#
|
|
# -t wekanteam/wekan-ondra:v${VERSION} -t wekanteam/wekan-ondra:latest
|
|
# -t wekanteam/wekan-gantt-gpl:v${VERSION} -t wekanteam/wekan-gantt-gpl:latest
|
|
# -t quay.io/wekan/wekan-ondra:v${VERSION} -t quay.io/wekan/wekan-ondra:latest
|
|
# -t quay.io/wekan/wekan-gantt-gpl:v${VERSION}
|
|
# -t quay.io/wekan/wekan-gantt-gpl:latest
|
|
# -t ghcr.io/wekan/wekan-ondra:v${VERSION} -t ghcr.io/wekan/wekan-ondra:latest
|
|
# -t ghcr.io/wekan/wekan-gantt-gpl:v${VERSION}
|
|
# -t ghcr.io/wekan/wekan-gantt-gpl:latest
|
|
#
|
|
# They are SNAP names - a snap name cannot be changed once people have
|
|
# it installed - and as Docker images they were only ever a second name
|
|
# for this same image. Six extra repositories across three registries,
|
|
# each with its own visibility and its own push permission, is six new
|
|
# ways for a release to fail in order to publish a copy of something
|
|
# already published. v10.88 did fail that way, an hour into an emulated
|
|
# build, on a Quay repository the release itself had just created.
|
|
#
|
|
# If they are ever wanted again: uncomment the lines above, add the
|
|
# same names to the two verification loops and the push preflight, and
|
|
# make sure each repository exists and is PUBLIC first.
|
|
|
|
# Pushed is not the same as pushed EVERYWHERE. A manifest that is missing a
|
|
# platform, or a tag that never reached one of the three registries, is
|
|
# invisible until somebody on that CPU runs docker pull and is told there is
|
|
# no matching manifest. Ask each registry what it actually has.
|
|
# $WANT is exactly the set that was built (same source as --platform, from
|
|
# the "Decide which platforms" step), so the verify never asks for an arch
|
|
# the image deliberately dropped.
|
|
want="${WANT}"
|
|
rc=0
|
|
for image in "wekanteam/wekan:v${VERSION}" "ghcr.io/wekan/wekan:v${VERSION}"; do
|
|
# The format MUST carry the CPU variant. buildx builds linux/arm/v7,
|
|
# but the registry records that as architecture "arm" with variant
|
|
# "v7" in a SEPARATE field - so an OS/Architecture-only format prints
|
|
# it as bare "linux/arm", which never matches the "linux/arm/v7" in
|
|
# want=, and the verify failed a manifest that was actually correct
|
|
# (the whole image built and pushed fine; only this check was wrong).
|
|
# Emit os/arch/variant when a variant is present so 32-bit ARM reads
|
|
# back as linux/arm/v7. arm64's implied "v8" is then normalised away
|
|
# below, because want= names it linux/arm64, the way everyone writes it.
|
|
if ! got="$(docker buildx imagetools inspect "$image" --format '{{range .Manifest.Manifests}}{{.Platform.OS}}/{{.Platform.Architecture}}{{if .Platform.Variant}}/{{.Platform.Variant}}{{end}} {{end}}' 2>&1)"; then
|
|
echo "::error::$image cannot be inspected after the push: $got - the tag did not reach that registry."
|
|
rc=1
|
|
continue
|
|
fi
|
|
# arm64's default variant v8 is implied and usually written linux/arm64;
|
|
# strip a trailing /v8 so it matches want= (linux/arm/v7 and v6 stay,
|
|
# because for 32-bit ARM the variant is what tells the CPUs apart).
|
|
got="$(printf '%s' "$got" | sed 's#/v8 # #g')"
|
|
for plat in $want; do
|
|
case " $got " in
|
|
*" $plat "*) ;;
|
|
*) echo "::error::$image has no $plat in its manifest (it has:$got). Users on that CPU get 'no matching manifest' from docker pull."; rc=1 ;;
|
|
esac
|
|
done
|
|
echo "OK: $image carries:$got"
|
|
done
|
|
exit $rc
|
|
|
|
- name: Verify bundled UCS migration tools
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p "$GITHUB_WORKSPACE/.tools/tmp"
|
|
export TMPDIR="$GITHUB_WORKSPACE/.tools/tmp"
|
|
python3 releases/ucs-release.py check-image --version "$VERSION"
|
|
|
|
- name: Copy published manifest to Quay
|
|
run: |
|
|
set -uo pipefail
|
|
# imagetools copies the existing multi-platform manifest without
|
|
# rebuilding every architecture. A Quay-wide read-only outage is
|
|
# temporary and affects every user; keep the completed publications
|
|
# on Docker Hub and GHCR. Any other refusal remains a real failure.
|
|
# A dropped connection on the way is retried: v12.44's copy failed on
|
|
# "stream error: ... PROTOCOL_ERROR; received from peer" - an HTTP/2
|
|
# stream reset, not a refusal. Anything else is not retried.
|
|
copied=false
|
|
for attempt in 1 2 3 4; do
|
|
if output="$(docker buildx imagetools create \
|
|
-t "quay.io/wekan/wekan:v${VERSION}" \
|
|
-t "quay.io/wekan/wekan:latest" \
|
|
"ghcr.io/wekan/wekan:v${VERSION}" 2>&1)"; then
|
|
copied=true; break
|
|
fi
|
|
printf '%s\n' "$output" | grep -qiE 'PROTOCOL_ERROR|stream error|connection reset|unexpected EOF|i/o timeout|TLS handshake timeout|502 Bad Gateway|503 Service Unavailable' || break
|
|
echo "::warning::Quay copy attempt $attempt: a transport error; retrying."
|
|
sleep $((attempt * 20))
|
|
done
|
|
if [ "$copied" = true ]; then
|
|
printf '%s\n' "$output"
|
|
echo "QUAY_PUBLISHED=true" >> "$GITHUB_ENV"
|
|
else
|
|
printf '%s\n' "$output"
|
|
if printf '%s' "$output" | grep -qi 'System is currently read-only.*write operations are currently suspended'; then
|
|
echo "::warning::Quay is in read-only mode; Docker Hub and GHCR were published and verified. Re-run this Docker job when Quay resumes writes to copy the same release manifest."
|
|
echo "QUAY_PUBLISHED=false" >> "$GITHUB_ENV"
|
|
else
|
|
echo "::error::Could not copy the published manifest to Quay; this is not the registry's read-only outage."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
- name: Verify Quay manifest platforms
|
|
if: env.QUAY_PUBLISHED == 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
image="quay.io/wekan/wekan:v${VERSION}"
|
|
got="$(docker buildx imagetools inspect "$image" --format '{{range .Manifest.Manifests}}{{.Platform.OS}}/{{.Platform.Architecture}}{{if .Platform.Variant}}/{{.Platform.Variant}}{{end}} {{end}}')"
|
|
got="$(printf '%s' "$got" | sed 's#/v8 # #g')"
|
|
for plat in $WANT; do
|
|
case " $got " in
|
|
*" $plat "*) ;;
|
|
*) echo "::error::$image has no $plat in its manifest (it has:$got)."; exit 1 ;;
|
|
esac
|
|
done
|
|
echo "OK: $image carries:$got"
|
|
|
|
# PUSHED IS NOT THE SAME AS PULLABLE BY ANYONE.
|
|
#
|
|
# The check above asks the registries with the release's own credentials, so
|
|
# a private image passes it. That is how ghcr.io/wekan/ferretdb shipped
|
|
# private and stayed that way until Artifact Hub mailed about it:
|
|
#
|
|
# error scanning image ghcr.io/wekan/ferretdb:latest: image not found
|
|
#
|
|
# For a user that is ImagePullBackOff. And it is one push away from
|
|
# happening again: a repository that does not exist yet is CREATED by the
|
|
# first push with the registry's default visibility - Docker Hub public,
|
|
# QUAY PRIVATE.
|
|
#
|
|
# So ask each registry the way a stranger would: fetch an anonymous pull
|
|
# token and request the manifest. 200 is public. 401/403/404 is not, and the
|
|
# message says which package to make public and where. A registry that
|
|
# cannot be REACHED is a warning, never a failure - the same rule the chart
|
|
# tooling uses, because a network hiccup must not fail a release that is
|
|
# otherwise fine.
|
|
- name: Verify every pushed tag can be pulled ANONYMOUSLY
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
run: |
|
|
set -uo pipefail
|
|
rc=0
|
|
anon_check() {
|
|
image="$1"
|
|
case "$image" in
|
|
ghcr.io/*) reg="https://ghcr.io"; repo="${image#ghcr.io/}"
|
|
token_url="https://ghcr.io/token?service=ghcr.io&scope=repository:${repo%%:*}:pull" ;;
|
|
quay.io/*) reg="https://quay.io"; repo="${image#quay.io/}"
|
|
token_url="https://quay.io/v2/auth?service=quay.io&scope=repository:${repo%%:*}:pull" ;;
|
|
*) reg="https://registry-1.docker.io"; repo="$image"
|
|
token_url="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo%%:*}:pull" ;;
|
|
esac
|
|
name="${repo%%:*}"; tag="${repo##*:}"
|
|
# Two attempts: a single failed HTTPS call is not evidence about a
|
|
# registry, only about the network between here and it.
|
|
for attempt in 1 2; do
|
|
token="$(bash "$GITHUB_WORKSPACE/releases/fetch.sh" --optional -o - "$token_url" 2>/dev/null | jq -r '.token // empty' 2>/dev/null || true)"
|
|
code="$(curl -sS --max-time 30 -o /dev/null -w '%{http_code}' \
|
|
-H "Authorization: Bearer ${token:-}" \
|
|
-H 'Accept: application/vnd.oci.image.index.v1+json' \
|
|
-H 'Accept: application/vnd.docker.distribution.manifest.list.v2+json' \
|
|
"$reg/v2/$name/manifests/$tag" 2>/dev/null || echo 000)"
|
|
[ "$code" = "000" ] || break
|
|
sleep 5
|
|
done
|
|
case "$code" in
|
|
200) echo "OK: $image can be pulled by anyone." ;;
|
|
000) echo "::warning::$image could not be checked ($reg unreachable). Not treated as private." ;;
|
|
401|403|404)
|
|
echo "::error::$image is NOT publicly pullable (HTTP $code). It was pushed, so it exists - it is PRIVATE, which for a user is ImagePullBackOff and for Artifact Hub is 'image not found'."
|
|
case "$image" in
|
|
ghcr.io/*) echo " Fix: github.com/orgs/wekan/packages -> ${name#wekan/} -> Package settings -> Change visibility -> Public. If Public is greyed out, enable it first at https://github.com/organizations/wekan/settings/packages (Package creation -> Public)." ;;
|
|
quay.io/*) echo " Fix: quay.io/repository/${name}?tab=settings -> Repository Visibility -> Make Public."
|
|
echo " EXPECTED THE FIRST TIME a tag is pushed to a repository that did not exist: Quay creates it PRIVATE. Make it public and re-run this job; nothing needs rebuilding, the image is already there." ;;
|
|
*) echo " Fix: hub.docker.com/repository/docker/${name}/settings -> Visibility settings -> Public." ;;
|
|
esac
|
|
rc=1 ;;
|
|
*) echo "::warning::$image answered HTTP $code, which is neither public nor a definite refusal. Not failing on it." ;;
|
|
esac
|
|
}
|
|
# The variant names are commented out with the -t lines they went with;
|
|
# nothing pushes them, so nothing checks them.
|
|
for image in "wekanteam/wekan:v${VERSION}" "ghcr.io/wekan/wekan:v${VERSION}"; do
|
|
anon_check "$image"
|
|
done
|
|
if [ "${QUAY_PUBLISHED:-false}" = true ]; then
|
|
anon_check "quay.io/wekan/wekan:v${VERSION}"
|
|
fi
|
|
exit $rc
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark docker"
|
|
echo "$mark docker" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::docker FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# ─── 9. Build the snap on Launchpad, push to the store, attach to release ────
|
|
# The snap's `wekan` part downloads wekan-<version>-<arch>.zip from the GitHub
|
|
# Release, so these jobs run only after `release` has published those assets.
|
|
#
|
|
# snap-native + snap-launchpad replace the old single `snap` job. The mainstream
|
|
# arches (amd64 + arm64) build NATIVELY on GitHub-hosted runners — fast, no
|
|
# Launchpad queue. The exotic arches (ppc64el, s390x, riscv64) have no native
|
|
# GitHub runners and snapcraft cannot cross-build, so all three build on Launchpad
|
|
# — the only mechanism that supports WeKan's `base: core24` for them — in a
|
|
# NON-BLOCKING, per-arch matrix so a slow/failed arch (Launchpad can queue for
|
|
# hours) never holds up the release or the other arches. Each arch publishes to
|
|
# the Snap Store (stable + candidate + beta + edge) and attaches to the Release the moment
|
|
# it finishes — all 5 arches, published independently.
|
|
# ── Does SNAP_AUTH actually work? Asked ONCE, before anything is built ──────
|
|
#
|
|
# v10.53 built the amd64 snap, the arm64 snap and both variant snaps - forty
|
|
# minutes of runner time - and then every one of them died at the upload with
|
|
# the same red X, because the credential was not usable. Nothing before that
|
|
# point had asked the store anything: the per-job check only tested that the
|
|
# secret is non-empty and longer than 100 characters, which a broken, revoked
|
|
# or long-expired credential also is.
|
|
#
|
|
# `snapcraft whoami` is the question. It costs one runner-minute, answers from
|
|
# the store itself, and its answer distinguishes the causes that the failure at
|
|
# upload time cannot:
|
|
#
|
|
# cannot be parsed -> the secret is not an exported login at all (mangled,
|
|
# truncated, or the terminal OUTPUT of export-login
|
|
# instead of the file it wrote)
|
|
# expired -> it WAS valid. An exported login expires, one year by
|
|
# default, and this is the cause the upload-time error
|
|
# message never mentioned
|
|
# missing a name -> it is valid but not scoped to every snap this release
|
|
# publishes, so some jobs would work and others not
|
|
#
|
|
# It is deliberately a hard failure: a release that cannot publish its snaps is
|
|
# a broken release, and finding out in a minute is the whole point.
|
|
snap-auth-check:
|
|
needs: [prepare]
|
|
runs-on: ubuntu-24.04
|
|
# Room for all five snapcraft install attempts (each at most 3 minutes,
|
|
# 30 s apart) and the whoami after them: at 10 minutes (v13.09) the job
|
|
# was cancelled during the third.
|
|
timeout-minutes: 25
|
|
steps:
|
|
- name: Ask the Snap Store whether SNAP_AUTH is usable
|
|
env:
|
|
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
|
# Every snap name this workflow publishes. snap-native and
|
|
# snap-launchpad publish `wekan`; snap-variants publishes the two
|
|
# older names people still have installed.
|
|
SNAP_NAMES: wekan wekan-ondra wekan-gantt-gpl
|
|
run: |
|
|
set -uo pipefail
|
|
fix="snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl --acls package_access,package_push,package_release,package_update snap-auth.txt && gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
|
|
|
if [ -z "${SNAP_AUTH:-}" ]; then
|
|
echo "::error::SNAP_AUTH is not set, so no snap can be published. Add it in Settings → Secrets and variables → Actions: $fix"
|
|
exit 1
|
|
fi
|
|
case "$SNAP_AUTH" in
|
|
*"Exported login"*|*"export-login"*)
|
|
echo "::error::SNAP_AUTH contains snapcraft's own banner text ('Exported login ...'), so it is the terminal OUTPUT rather than the file contents. Re-set it from the file: gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# The Snap Store has bad minutes - a rate limit, or (v13.07) a refresh
|
|
# that timed out - so the install is retried as the build job's is;
|
|
# an outage is said as one, not as a broken credential. Each attempt
|
|
# is bounded: in v13.09 the third hung silently until the job was
|
|
# cancelled. An attempt cut short leaves snapd's install change
|
|
# running, so it is aborted before the next.
|
|
installed=""
|
|
for i in 1 2 3 4 5; do
|
|
if timeout 180 sudo snap install snapcraft --classic; then installed=1; break; fi
|
|
sudo snap abort --last=install >/dev/null 2>&1 || true
|
|
echo "snapcraft install attempt $i/5 failed (Snap Store unreachable, throttling or hanging); retrying in 30s..."
|
|
sleep 30
|
|
done
|
|
if [ -z "$installed" ]; then
|
|
echo "::error::snapcraft could not be installed after 5 attempts: the Snap Store did not answer. That is the store, not SNAP_AUTH - re-run the job."
|
|
exit 1
|
|
fi
|
|
|
|
# whoami writes its answer to stdout and its complaint to stderr; both
|
|
# matter, so both are captured.
|
|
set +e
|
|
out="$(SNAPCRAFT_STORE_CREDENTIALS="$SNAP_AUTH" snapcraft whoami 2>&1)"
|
|
rc=$?
|
|
set -e
|
|
# The credential is never echoed - only what the store said about it.
|
|
echo "$out"
|
|
|
|
if [ "$rc" -ne 0 ]; then
|
|
case "$out" in
|
|
*"could not be parsed"*|*"not valid"*|*"Cannot parse"*)
|
|
echo "::error::SNAP_AUTH is not a readable exported login - the store was never asked. It is mangled, truncated, or the terminal output of export-login instead of the file it wrote. Fix: $fix"
|
|
;;
|
|
*xpired*)
|
|
echo "::error::SNAP_AUTH has EXPIRED. An exported login lasts one year by default, so this one worked until it did not. Fix: $fix"
|
|
;;
|
|
*401*|*403*|*nauthoriz*|*"not authorized"*)
|
|
echo "::error::The Snap Store refused SNAP_AUTH (401/403). The credential is readable but does not carry the ACL it needs. Fix: $fix"
|
|
;;
|
|
*)
|
|
echo "::error::snapcraft whoami failed (exit $rc); its output is above. Fix, if it is the credential: $fix"
|
|
;;
|
|
esac
|
|
exit 1
|
|
fi
|
|
|
|
# It authenticates. Does it carry every snap name this release
|
|
# publishes? A credential exported for `wekan` alone lets snap-native
|
|
# succeed and snap-variants fail, which reads as two unrelated bugs.
|
|
missing=""
|
|
for name in $SNAP_NAMES; do
|
|
case "$out" in
|
|
*"$name"*) : ;;
|
|
*) missing="$missing $name" ;;
|
|
esac
|
|
done
|
|
# `packages: no restrictions` is a credential scoped to every snap the
|
|
# account owns, which covers all three.
|
|
case "$out" in
|
|
*"no restrictions"*) missing="" ;;
|
|
esac
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::SNAP_AUTH authenticates, but is not scoped to:$missing — those snaps would fail to publish while the others succeeded. Re-export for ALL THREE names: $fix"
|
|
exit 1
|
|
fi
|
|
echo "SNAP_AUTH is usable, and carries every snap name this release publishes."
|
|
|
|
snap-native:
|
|
permissions:
|
|
contents: write
|
|
needs: [prepare, release, snap-auth-check]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: amd64
|
|
runner: ubuntu-24.04
|
|
- arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
runs-on: ${{ matrix.runner }}
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# two natively built snaps.
|
|
timeout-minutes: 120
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${SNAP_AUTH:-}" ] || missing="$missing SNAP_AUTH"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::snap-native: missing repository secret(s):$missing — the snap cannot be uploaded. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " SNAP_AUTH - snapcraft export-login output, with ACL for the wekan snap"
|
|
exit 1
|
|
fi
|
|
# Whether the Snap Store ACCEPTS it can only be answered by the store, at
|
|
# upload time - so the upload step below is followed by one that names this
|
|
# secret when it is refused, instead of leaving a bare "401" in the log.
|
|
#
|
|
# What CAN be checked here is that it is a credential at all. v10.50 built
|
|
# every snap and then died on
|
|
# Credentials could not be parsed. Expected valid Ubuntu One credentials.
|
|
# which is not the store refusing anything - it is snapcraft unable to read
|
|
# the secret. The commonest cause is pasting what `snapcraft export-login`
|
|
# PRINTED instead of the file it WROTE. Only unambiguous breakage is
|
|
# rejected here; the format itself is snapcraft's business.
|
|
chars=$(printf '%s' "$SNAP_AUTH" | wc -c)
|
|
if [ "$chars" -lt 100 ]; then
|
|
echo "::error::snap-native: SNAP_AUTH is only $chars characters, which is far too short for an exported login. Set it to the CONTENTS OF THE FILE that snapcraft wrote: snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl --acls package_access,package_push,package_release,package_update snap-auth.txt && gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
|
exit 1
|
|
fi
|
|
case "$SNAP_AUTH" in
|
|
*"Exported login"*|*"export-login"*)
|
|
echo "::error::snap-native: SNAP_AUTH contains snapcraft's own banner text ('Exported login ...'), so it is the terminal OUTPUT rather than the file contents. Re-set it from the file: gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "snap-native: SNAP_AUTH is set ($chars characters)."
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Verify snapcraft.yaml version matches the release
|
|
# snapcraft.yaml's `version:` names the produced file (wekan_<version>_<arch>.snap).
|
|
# Assert it matches the tag so a stale version fails fast here.
|
|
run: |
|
|
set -euo pipefail
|
|
if ! grep -qxF "version: '${VERSION}'" snapcraft.yaml; then
|
|
echo "::error::snapcraft.yaml is not at version '${VERSION}' ($(grep -m1 '^version:' snapcraft.yaml)). The bump job (releases/version.sh) did not update the tagged commit."
|
|
exit 1
|
|
fi
|
|
echo "snapcraft.yaml is at version '${VERSION}'."
|
|
|
|
- name: Install LXD with Snap Store retries
|
|
# snapcore/action-build installs LXD itself, but that single request has
|
|
# no retry. A transient Store nonce timeout made the amd64 v11.31 build
|
|
# fail before Snapcraft ran. Preinstalling it makes the action's install
|
|
# idempotent and gives Store/network failures bounded retries.
|
|
run: |
|
|
set -euo pipefail
|
|
for attempt in 1 2 3 4 5; do
|
|
if sudo snap install lxd; then
|
|
exit 0
|
|
fi
|
|
if [ "$attempt" -eq 5 ]; then
|
|
echo "::error::Could not install LXD after $attempt attempts."
|
|
exit 1
|
|
fi
|
|
delay=$((attempt * 10))
|
|
echo "Snap Store request failed (attempt $attempt/5); retrying in ${delay}s ..."
|
|
sleep "$delay"
|
|
done
|
|
|
|
- name: Build the ${{ matrix.arch }} snap natively
|
|
# Runs on a native ${{ matrix.arch }} GitHub runner, so snapcraft builds the
|
|
# platform whose `build-on` matches this host — no Launchpad, no emulation.
|
|
id: build-first
|
|
continue-on-error: true
|
|
uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
|
|
with:
|
|
snapcraft-args: pack
|
|
|
|
- name: Refresh managed APT after a package 404 or a failed apt update
|
|
if: steps.build-first.outcome == 'failure'
|
|
run: sudo -u "$(id -un)" -E python3 "$GITHUB_WORKSPACE/releases/snap-refresh-managed-apt.py"
|
|
|
|
- name: Retry Snapcraft once after refreshing its base instance
|
|
id: build-retry
|
|
if: steps.build-first.outcome == 'failure'
|
|
uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
|
|
with:
|
|
snapcraft-args: pack
|
|
|
|
- name: Select the successful Snap artifact
|
|
id: build
|
|
env:
|
|
BUILT_SNAP: ${{ steps.build-first.outputs.snap || steps.build-retry.outputs.snap }}
|
|
run: |
|
|
test -n "$BUILT_SNAP"
|
|
test -f "$BUILT_SNAP"
|
|
echo "snap=$BUILT_SNAP" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Verify the built snap is ${{ matrix.arch }}
|
|
id: verify
|
|
env:
|
|
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
snap="${STEP_BUILD_SNAP}"
|
|
echo "Built: $snap"
|
|
case "$snap" in
|
|
*_${MATRIX_ARCH}.snap) : ;;
|
|
*) echo "::error::Built snap '$snap' is not ${MATRIX_ARCH}."; exit 1 ;;
|
|
esac
|
|
|
|
- id: publish
|
|
name: Push ${{ matrix.arch }} to the Snap Store (stable + candidate + beta + edge)
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_AUTH }}
|
|
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
|
run: |
|
|
set -euo pipefail
|
|
SNAP_UPLOAD_LABEL="${STEP_BUILD_SNAP}" \
|
|
bash releases/snap-upload-retry.sh "${STEP_BUILD_SNAP}" stable,candidate,beta,edge
|
|
|
|
# The upload step above retries only transient store-side processing/server
|
|
# failures. Name the secret when the remaining failure is credentials/ACL.
|
|
- name: Say which secret the Snap Store refused
|
|
if: failure() && steps.publish.outcome == 'failure'
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
# Two different failures wear the same red X here, and the line snapcraft
|
|
# printed just above in the log says which:
|
|
# "Credentials could not be parsed" -> SNAP_AUTH is not a readable
|
|
# exported login: it was mangled, truncated, or is the terminal
|
|
# output instead of the file contents. Nothing to do with the store.
|
|
# 401 / 403 / "not authorized" -> the credential is fine but does
|
|
# not carry the ACL for this snap NAME.
|
|
echo "::error::The ${MATRIX_ARCH} snap was built but not published. Read the snapcraft line above: 'Credentials could not be parsed' means SNAP_AUTH is not a readable exported login (mangled, or the terminal output instead of the file contents); 401/403/not authorized means it lacks the ACL for this snap name. Both are fixed by re-exporting for ALL THREE names: snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl --acls package_access,package_push,package_release,package_update snap-auth.txt && gh secret set SNAP_AUTH --repo wekan/wekan < snap-auth.txt"
|
|
exit 1
|
|
|
|
# always() + the verify step's outcome: a snap that was built and checked
|
|
# goes onto the GitHub Release even when the Snap Store push above failed
|
|
# or the run was cancelled after the build - the release keeps every file
|
|
# that finished building, whatever happened to the rest of the run.
|
|
- name: Attach the ${{ matrix.arch }} snap to the GitHub Release
|
|
if: ${{ always() && steps.verify.outcome == 'success' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
|
run: |
|
|
set -euo pipefail
|
|
asset="${STEP_BUILD_SNAP}"
|
|
if [ ! -f "$asset" ]; then
|
|
echo "::error::$asset does not exist, so there is nothing to attach. The step that builds it failed, or produced a different name."
|
|
exit 1
|
|
fi
|
|
# The checksum goes up with it, so a download can be checked. It is
|
|
# built beside the zip by the step above; older jobs that do not make
|
|
# one still upload cleanly.
|
|
up=("$asset")
|
|
[ -f "${asset}.sha256sum" ] && up+=("${asset}.sha256sum")
|
|
bash releases/github-release-upload.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${up[@]}"
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark snap-native ${MATRIX_ARCH}"
|
|
echo "$mark snap-native ${MATRIX_ARCH}" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::snap-native ${MATRIX_ARCH} FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
snap-launchpad:
|
|
permissions:
|
|
contents: write
|
|
# ENABLED. `continue-on-error: true` below means a failure here can never
|
|
# fail the release or hold up another job - the point of running it is to
|
|
# SEE what it reports. Disable again with `if: ${{ false }}`.
|
|
# The snap downloads its WeKan runtime from the architecture-specific asset
|
|
# attached by build-extra-arches. Waiting only for `release` let Launchpad
|
|
# start while that asset was still being built, so snapcraft retried a
|
|
# deterministic GitHub 404 three times.
|
|
needs: [prepare, release, build-extra-arches, snap-auth-check]
|
|
# ppc64el, s390x and riscv64: none of them has a native GitHub runner, and
|
|
# snapcraft cannot cross-build a snap, so Launchpad remote-build is the only way
|
|
# to build them - QEMU is not. ppc64el and s390x were on a QEMU job
|
|
# (diddlesnaps/snapcraft-multiarch-action) until it turned out that action caps at
|
|
# `base: core22` and is unmaintained, so every leg died the instant snapcraft read
|
|
# WeKan's `base: core24`: "Your build requires a base that this tool does not
|
|
# support (core24)". There is no maintained QEMU multi-arch action that does
|
|
# core24; Canonical's answer for non-native arches on core24 IS remote-build. See
|
|
# docs/Platforms/FOSS/Container/Snap/Snap-Core.md.
|
|
#
|
|
# This job retries the remote build 3x and uploads only when a .snap file is
|
|
# really there - the "is not a valid file" (snapcraft upload, exit 64) failure
|
|
# that prompted the move to QEMU in the first place. It claimed to do that from
|
|
# the start; the test was a literal filename in an array, never a glob, so it was
|
|
# always true and v10.48 uploaded a file that did not exist. It asks the
|
|
# filesystem now.
|
|
#
|
|
# continue-on-error: an exotic Launchpad arch must NOT hold up or fail the
|
|
# release. A Launchpad build can queue for hours / time out; that must not turn
|
|
# the whole release red. timeout-minutes bounds a stuck build so it fails with a
|
|
# clear message instead of GitHub's silent 6h cancel. fail-fast: false so one arch
|
|
# never cancels the others - each publishes the moment it finishes.
|
|
continue-on-error: true
|
|
# GitHub's hosted-job ceiling is six hours. The remote command below stops
|
|
# waiting after five hours across all attempts and leaves the Launchpad build
|
|
# alive, giving log collection and the summary a full hour to finish cleanly
|
|
# instead of having GitHub cancel the job at 360 minutes.
|
|
timeout-minutes: 360
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# The snap architectures Launchpad builds and the store accepts. i386 and
|
|
# armhf join the three that were here: both are real snapd arches and
|
|
# both now have a bundle to build from. loong64 is deliberately absent -
|
|
# it is not a snap architecture at all.
|
|
# No i386: core24 has no i386 port, so an i386 snap is not buildable
|
|
# (snapcraft.yaml has no i386 platform for the same reason).
|
|
arch: [ppc64el, s390x, riscv64, armhf]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
# First step on purpose: a missing secret is then ONE named line at the top of
|
|
# the log, instead of a failure deep inside a tool that only says the login
|
|
# was refused. GITHUB_TOKEN is provided by Actions itself and is never listed.
|
|
- name: Check required secrets are configured
|
|
env:
|
|
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
|
LP_CREDENTIALS: ${{ secrets.LP_CREDENTIALS }}
|
|
run: |
|
|
missing=""
|
|
[ -n "${SNAP_AUTH:-}" ] || missing="$missing SNAP_AUTH"
|
|
[ -n "${LP_CREDENTIALS:-}" ] || missing="$missing LP_CREDENTIALS"
|
|
if [ -n "$missing" ]; then
|
|
echo "::error::snap-launchpad: missing repository secret(s):$missing — the remote build cannot run. Add them in Settings → Secrets and variables → Actions:"
|
|
echo " SNAP_AUTH - snapcraft export-login output, with ACL for the wekan snap"
|
|
echo " LP_CREDENTIALS - base64 of the Launchpad credentials file for snapcraft remote-build"
|
|
exit 1
|
|
fi
|
|
if ! bytes="$(printf '%s' "$LP_CREDENTIALS" | base64 -d 2>/dev/null | wc -c)" || [ "$bytes" -eq 0 ]; then
|
|
echo "::error::snap-launchpad: LP_CREDENTIALS is not valid base64, or decodes to nothing. Set it with: base64 -w0 ~/.local/share/snapcraft/launchpad-credentials"
|
|
exit 1
|
|
fi
|
|
echo "snap-launchpad: SNAP_AUTH is set and LP_CREDENTIALS decodes to $bytes bytes."
|
|
|
|
- name: Check the ${{ matrix.arch }} release bundle exists
|
|
id: bundle
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
case "${MATRIX_ARCH}" in
|
|
ppc64el) bundle_arch=ppc64le ;;
|
|
*) bundle_arch=${MATRIX_ARCH} ;;
|
|
esac
|
|
asset="wekan-${VERSION}-${bundle_arch}.zip"
|
|
echo "asset=$asset" >> "$GITHUB_OUTPUT"
|
|
# The list is read whole BEFORE matching. `gh … | grep -q` lets grep exit
|
|
# at the first match while gh is still writing; gh gets SIGPIPE, pipefail
|
|
# makes the pipeline fail, and a PUBLISHED asset was reported missing - the
|
|
# v12.39 Mac apps were skipped that way, with the bundles already attached.
|
|
assets="$(gh release view "v${VERSION}" --repo "${GITHUB_REPOSITORY}" \
|
|
--json assets --jq '.assets[].name')"
|
|
if grep -qxF "$asset" <<< "$assets"; then
|
|
echo "available=true" >> "$GITHUB_OUTPUT"
|
|
echo "Found $asset; Launchpad can build ${MATRIX_ARCH}."
|
|
else
|
|
echo "available=false" >> "$GITHUB_OUTPUT"
|
|
echo "::warning::$asset is absent after build-extra-arches finished; skipping the ${MATRIX_ARCH} snap instead of retrying a permanent 404 on Launchpad."
|
|
fi
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
if: steps.bundle.outputs.available == 'true'
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
# Shallow is enough: remote-build (Launchpad) rejects a SHALLOW repository,
|
|
# but what it gets is not this checkout - prepare-launchpad-source.sh
|
|
# makes a fresh one-commit repository from git archive HEAD. The full
|
|
# history (447 MB) used to be fetched here and never uploaded.
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- name: Flatten history so the Launchpad push stays small
|
|
if: steps.bundle.outputs.available == 'true'
|
|
# Snapcraft hashes the project files, not only its commit. Use a complete
|
|
# one-commit source tree with Git metadata/logs outside the hashed tree.
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: bash releases/prepare-launchpad-source.sh "${MATRIX_ARCH}"
|
|
|
|
- name: Install snapcraft
|
|
if: steps.bundle.outputs.available == 'true'
|
|
# The Snap Store intermittently rejects the install with a 429-style rate
|
|
# limit; retry so one transient throttle does not fail the build.
|
|
run: |
|
|
set -uo pipefail
|
|
for i in 1 2 3 4 5; do
|
|
# Bounded, as snap-auth-check's: a hanging store is a failed
|
|
# attempt, not a job that waits until it is cancelled.
|
|
timeout 180 sudo snap install snapcraft --classic && exit 0
|
|
sudo snap abort --last=install >/dev/null 2>&1 || true
|
|
echo "snapcraft install attempt $i/5 failed (Snap Store throttle or hang?); retrying in 30s..."
|
|
sleep 30
|
|
done
|
|
echo "::error::snapcraft install failed after 5 attempts (Snap Store rate limit)."
|
|
exit 1
|
|
|
|
- name: Provide Launchpad credentials for remote-build
|
|
if: steps.bundle.outputs.available == 'true'
|
|
env:
|
|
LP_CREDENTIALS: ${{ secrets.LP_CREDENTIALS }}
|
|
run: |
|
|
mkdir -p ~/.local/share/snapcraft
|
|
printf '%s' "$LP_CREDENTIALS" | base64 -d > ~/.local/share/snapcraft/launchpad-credentials
|
|
chmod 600 ~/.local/share/snapcraft/launchpad-credentials
|
|
|
|
- name: Verify snapcraft.yaml version matches the release
|
|
if: steps.bundle.outputs.available == 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
if ! grep -qxF "version: '${VERSION}'" snapcraft.yaml; then
|
|
echo "::error::snapcraft.yaml is not at version '${VERSION}' ($(grep -m1 '^version:' snapcraft.yaml)). The bump job (releases/version.sh) did not update the tagged commit."
|
|
exit 1
|
|
fi
|
|
echo "snapcraft.yaml is at version '${VERSION}'."
|
|
|
|
- name: Build the ${{ matrix.arch }} snap on Launchpad
|
|
id: launchpad
|
|
if: steps.bundle.outputs.available == 'true'
|
|
# --build-for ${{ matrix.arch }}: build ONLY this leg's arch so a slow/failed
|
|
# arch never blocks the others. remote-build can exit 0 without producing a
|
|
# .snap (it just downloads logs), so require the file. Retry a few times to
|
|
# survive transient TLS drops to Launchpad.
|
|
#
|
|
# The file test used to be `snaps=( wekan_${VERSION}_<arch>.snap )` and then
|
|
# `[ ${#snaps[@]} -gt 0 ]`. That string has no wildcard in it, so it is not a
|
|
# glob - it is a literal filename, `shopt -s nullglob` cannot empty a literal,
|
|
# and the count was ALWAYS 1 whether or not the file existed. v10.48 s390x
|
|
# therefore reported "succeeded" over an empty `Artifacts:` list and walked
|
|
# into `'wekan_10.48_s390x.snap' is not a valid file` in the upload step - a
|
|
# missing file, blamed on SNAP_AUTH. Ask the filesystem instead.
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -uo pipefail
|
|
shopt -s nullglob
|
|
# A .snap is a squashfs image, and squashfs starts with the four bytes
|
|
# "hsqs". That is the difference between "a file arrived" and "the file
|
|
# arrived": v10.89 armhf, ppc64el and s390x all downloaded a snap that
|
|
# existed and was not one, and the first thing that noticed was the
|
|
# Snap Store, at the end of the job -
|
|
#
|
|
# Unsquashing snap file 'wekan_10.89_armhf.snap'.
|
|
# could not unsquash snap file 'wekan_10.89_armhf.snap'
|
|
#
|
|
# - which reads like the build was bad when it was the transfer. The
|
|
# size floor is the same test in the other direction: the smallest
|
|
# WeKan snap is a few hundred megabytes, so anything under 50 MB is a
|
|
# truncated download or an error page, whatever its first four bytes.
|
|
snap_ok() { # <file>
|
|
[ -f "$1" ] || return 1
|
|
[ "$(wc -c < "$1" | tr -d '[:space:]')" -ge 52428800 ] || {
|
|
echo "$1 is only $(wc -c < "$1" | tr -d '[:space:]') bytes - truncated."; return 1; }
|
|
[ "$(head -c4 "$1")" = "hsqs" ] || {
|
|
echo "$1 does not start with the squashfs magic 'hsqs' - it is not a snap."; return 1; }
|
|
}
|
|
echo "built=false" >> "$GITHUB_OUTPUT"
|
|
echo "pending=false" >> "$GITHUB_OUTPUT"
|
|
# A shared deadline, not five hours PER retry. Every architecture can
|
|
# queue (v11.85 ppc64el/s390x), and TLS recovery must not reset the budget.
|
|
deadline=$((SECONDS + 18000))
|
|
last_remaining=18001
|
|
export TMPDIR="$PWD/.tools/tmp"
|
|
remote_wrapper="$PWD/releases/snapcraft-remote-compat.sh"
|
|
remote_source="$PWD/.tools/tmp/snap-launchpad-source"
|
|
remote_log="$PWD/.tools/tmp/remote-build-attempt.log"
|
|
run_remote_build() {
|
|
local remaining=$((deadline - SECONDS))
|
|
# Bash SECONDS has one-second resolution. Consecutive retries can
|
|
# otherwise receive the same timeout despite consuming time.
|
|
if [ "$remaining" -ge "$last_remaining" ]; then
|
|
remaining=$((last_remaining - 1))
|
|
fi
|
|
last_remaining=$remaining
|
|
[ "$remaining" -gt 0 ] || return 124
|
|
# Isolate the local waiter, and kill it if it ignores TERM. Never
|
|
# cancel the remote build; a later run can recover the same recipe.
|
|
(
|
|
cd "$remote_source" || { echo "::error::Prepared Launchpad source is missing: $remote_source" >&2; exit 1; }
|
|
timeout --kill-after=30s "${remaining}s" bash "$remote_wrapper" remote-build --launchpad-accept-public-upload \
|
|
--build-for "${MATRIX_ARCH}" "$@"
|
|
) 2>&1 | tee "$remote_log"
|
|
local remote_rc=${PIPESTATUS[0]}
|
|
# Downloaded artifacts and build logs also change the project hash.
|
|
# Move them out before the next recovery attempt, keeping the logs
|
|
# where the existing diagnostics/artifact collection expect them.
|
|
local download
|
|
for download in "$remote_source"/*.snap "$remote_source"/snapcraft-wekan-*.txt; do
|
|
mv "$download" .
|
|
done
|
|
return "$remote_rc"
|
|
}
|
|
|
|
attempts=3
|
|
# Launchpad being down is not three strikes. v12.56 ppc64el: attempt
|
|
# 1's builder lost its TLS connection cloning our source ("RPC failed;
|
|
# curl 56 GnuTLS recv error ... early EOF"), and attempts 2 and 3, a
|
|
# minute apart each, both met Launchpad's own "HTTP Error 503: Service
|
|
# Unavailable" / "Error: Timeout" - the job gave up after 20 minutes
|
|
# of a five-hour budget. An attempt that failed on Launchpad
|
|
# infrastructure earns another one, up to this many, after a pause
|
|
# that grows each time.
|
|
max_attempts=6
|
|
# A Launchpad build log is THIS attempt's when its name did not exist
|
|
# before the attempt, or it was rewritten after the marker. The name
|
|
# alone decides it where -nt compares whole seconds (bash 3.2): a log
|
|
# written in the marker's second was not "newer", and was missed.
|
|
logs_before=" "
|
|
this_attempts_log() {
|
|
[ -e "$1" ] || return 1
|
|
case "$logs_before" in *" $1 "*) [ "$1" -nt "$attempt_marker" ] ;; *) return 0 ;; esac
|
|
}
|
|
# snapcraft's execution logs. v12.96 s390x: every attempt printed only
|
|
# "Could not find repository at path ...", because snapcraft reports
|
|
# the LAST exception; the cause before it - "HTTP Error 503: Service
|
|
# Unavailable" / "Error: Timeout" creating that repository - was in
|
|
# the "Full execution log" alone. Unread, three Launchpad outages
|
|
# counted as three WeKan failures and the arch was not published.
|
|
snapcraft_log_dir="$HOME/.local/state/snapcraft/log"
|
|
infra_failure() { # did THIS attempt fail on Launchpad, not on WeKan?
|
|
grep -qsE 'HTTP Error 5[0-9][0-9]|Error: Timeout|Service Unavailable' "$remote_log" && return 0
|
|
# The same v12.96 s390x run's last attempt: the repository the
|
|
# timed-out requests had half-created refused our push with
|
|
# "You do not have permission to create refs/heads/main" - the
|
|
# same credentials pushed every other architecture in that run.
|
|
grep -qsE 'remote: You do not have permission to create refs/' "$remote_log" && return 0
|
|
local log
|
|
for log in snapcraft-wekan-*.txt; do
|
|
this_attempts_log "$log" || continue
|
|
grep -qsE 'RPC failed;|GnuTLS recv error|fatal: early EOF|Gateway error \[IP: ' "$log" && return 0
|
|
done
|
|
for log in "$snapcraft_log_dir"/*.log; do
|
|
this_attempts_log "$log" || continue
|
|
grep -qsE 'HTTP Error 5[0-9][0-9]|Error: Timeout|Service Unavailable' "$log" && return 0
|
|
done
|
|
return 1
|
|
}
|
|
# Set once an attempt ends with Launchpad reporting the build as
|
|
# finished without a snap ("Stopped:" / "Failed:" for this arch).
|
|
# Recovery reconnects to that SAME build, so it can only download the
|
|
# same failure again: v12.21 s390x attempt 3 "recovered" attempt 2's
|
|
# stopped build and was over in eight seconds. A finished build is
|
|
# retried by submitting a fresh one.
|
|
fresh_next=0
|
|
attempt_marker="$PWD/.tools/tmp/remote-build-attempt.start"
|
|
i=0
|
|
while [ "$i" -lt "$attempts" ]; do
|
|
i=$((i + 1))
|
|
# A partial file from a previous attempt must not be mistaken for
|
|
# this attempt's artifact: snapcraft does not re-download a name it
|
|
# already has, so the truncated one would be uploaded again.
|
|
rm -f "wekan_${VERSION}_${MATRIX_ARCH}"*.snap ./*_"${MATRIX_ARCH}".snap
|
|
echo "::group::Remote build ${MATRIX_ARCH} attempt $i/$attempts"
|
|
# Build logs this attempt downloads are newer than this marker; the
|
|
# earlier attempts' logs stay in the directory for the diagnostics
|
|
# below, but must not be printed again as if they were this one's.
|
|
touch "$attempt_marker"
|
|
logs_before=" $(ls snapcraft-wekan-*.txt "$snapcraft_log_dir"/*.log 2>/dev/null | tr '\n' ' ')"
|
|
if [ "$fresh_next" = 1 ]; then
|
|
echo "The previous attempt's Launchpad build finished without a snap; submitting a new build instead of recovering it."
|
|
run_remote_build && rc=0 || rc=$?
|
|
else
|
|
# Otherwise try recovery first, including a re-run of this matrix
|
|
# job. start_builds replaces the recipe; it does NOT resume polling
|
|
# after an SSL EOF. Only an explicitly absent recipe/repository
|
|
# permits a new submission. Authentication/network failures are not
|
|
# absence.
|
|
run_remote_build --recover && rc=0 || rc=$?
|
|
if [ "$rc" -ne 0 ] && grep -qE 'Could not find (snap recipe|repository at path)' "$remote_log"; then
|
|
run_remote_build && rc=0 || rc=$?
|
|
fi
|
|
fi
|
|
fresh_next=0
|
|
if grep -qE "^(Stopped|Failed|Cancelled): ${MATRIX_ARCH}\$" "$remote_log"; then
|
|
fresh_next=1
|
|
fi
|
|
echo "::endgroup::"
|
|
# A real glob, so nullglob can empty it, plus any name Launchpad chose -
|
|
# deduplicated, because the two patterns match the same file and it was
|
|
# printed (and would be uploaded) twice.
|
|
snaps=( $(printf '%s\n' "wekan_${VERSION}_${MATRIX_ARCH}"*.snap *_"${MATRIX_ARCH}".snap | sort -u) )
|
|
# snapcraft can download a complete snap and then fail while cleaning
|
|
# up its Launchpad session (for example an SSL EOF while revoking the
|
|
# proxy token). The validated artifact is the build result; do not
|
|
# throw it away and spend hours rebuilding because cleanup returned
|
|
# a non-zero status after the download completed.
|
|
if [ "${#snaps[@]}" -gt 0 ] && snap_ok "${snaps[0]}"; then
|
|
if [ "$rc" -ne 0 ]; then
|
|
echo "::warning::snapcraft exited $rc during post-download cleanup, but ${snaps[0]} is a complete squashfs snap; keeping it."
|
|
fi
|
|
echo "Remote build ${MATRIX_ARCH} succeeded on attempt $i: ${snaps[*]} ($(wc -c < "${snaps[0]}" | tr -d '[:space:]') bytes, squashfs)"
|
|
echo "built=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
if [ "$rc" -eq 124 ] || [ "$SECONDS" -ge "$deadline" ]; then
|
|
echo "pending=true" >> "$GITHUB_OUTPUT"
|
|
echo "::warning::Launchpad ${MATRIX_ARCH} has not produced a snap within the five-hour wait budget. Ending the local wait cleanly; re-run this matrix job later to reconnect to the same build and publish its snap."
|
|
exit 0
|
|
fi
|
|
if [ "$rc" -eq 0 ] && [ "${#snaps[@]}" -gt 0 ]; then
|
|
echo "::warning::Attempt $i produced ${snaps[0]}, but it is not a usable snap (see above). Refusing to publish it; recovery must retrieve a valid artifact."
|
|
fi
|
|
if [ "$rc" -eq 0 ]; then
|
|
echo "Attempt $i: snapcraft exited 0 but produced NO .snap for ${MATRIX_ARCH} - the Launchpad build did not finish (a 'Stopped' build downloads logs and no artifact). Everything in the directory:"
|
|
else
|
|
echo "Attempt $i: snapcraft exit=$rc, .snap files produced=${#snaps[@]}."
|
|
fi
|
|
ls -la
|
|
# The Launchpad build log is the only thing that says WHY a build stopped,
|
|
# and it is downloaded here. Print it whenever there is no snap - not only
|
|
# when snapcraft's exit code is non-zero, which is how v10.48 fetched it
|
|
# and threw it away.
|
|
new_logs=0
|
|
for log in snapcraft-wekan-*.txt; do
|
|
this_attempts_log "$log" || continue
|
|
new_logs=1
|
|
echo "::group::Launchpad build log: $log (what failed, then the last 150 lines)"
|
|
# The tail alone is not where the cause is. snapcraft's own error is
|
|
# followed by lpbuildd's Python traceback, the proxy-token revocation
|
|
# and the process scan, so on v10.71 the 150 lines held the
|
|
# IsADirectoryError but NOT the mongodb part's build output that
|
|
# would have said what `bin` actually was. Print the lines around
|
|
# every failure marker first, and keep the tail after it.
|
|
grep -n -E -B 5 -A 20 'Build failed|failed with code|Detailed information|Stage package not found|Failed to run snapcraft|error:' "$log" | tail -n 250 || true
|
|
echo "--- last 150 lines ---"
|
|
tail -n 150 "$log"
|
|
echo "::endgroup::"
|
|
done
|
|
if [ "$new_logs" = 0 ] && ls snapcraft-wekan-*.txt >/dev/null 2>&1; then
|
|
# v12.21 s390x: snapcraft crashed fetching attempt 2's log
|
|
# (MissingSchema "Invalid URL 'None'"), and attempt 1's log was
|
|
# printed in its place, reading as the same failure twice.
|
|
echo "Attempt $i downloaded no Launchpad build log of its own; the logs printed earlier belong to earlier attempts."
|
|
fi
|
|
# ...and there is no Launchpad build log at all when the build never
|
|
# STARTED. v10.55 riscv64 failed three times on
|
|
# "Git operation failed with: Could not push 'HEAD' to
|
|
# git.launchpad.net/.../+git/snapcraft-wekan-<hash>"
|
|
# and that one line was everything the job printed: snapcraft
|
|
# swallows git's own message and writes it to its execution log,
|
|
# whose path it names and nobody reads. Read it.
|
|
for sclog in "$HOME"/.local/state/snapcraft/log/*.log; do
|
|
[ -e "$sclog" ] || continue
|
|
echo "::group::snapcraft execution log: $(basename "$sclog") (last 120 lines)"
|
|
tail -n 120 "$sclog"
|
|
echo "::endgroup::"
|
|
done
|
|
pause=60
|
|
if infra_failure; then
|
|
[ "$attempts" -lt "$max_attempts" ] && [ "$i" -ge "$attempts" ] && attempts=$((attempts + 1))
|
|
# 5, 10, 15... minutes, never past the shared deadline.
|
|
pause=$((300 * i))
|
|
[ "$pause" -le $((deadline - SECONDS - 600)) ] || pause=$(( deadline - SECONDS - 600 > 60 ? deadline - SECONDS - 600 : 60 ))
|
|
echo "::warning::Attempt $i failed on Launchpad infrastructure (an HTTP 5xx, a timeout or a dropped git/TLS transfer), not on WeKan; allowing up to $attempts attempts."
|
|
fi
|
|
if [ "$i" -lt "$attempts" ]; then
|
|
# Clear a half-pushed clone only when submission never reached
|
|
# monitoring. A failed poll must keep the running build intact.
|
|
if ! grep -qE 'Monitoring build|Recovering build' "$remote_log"; then
|
|
echo "Clearing snapcraft's remote-build cache before retrying submission."
|
|
rm -rf "$HOME/.cache/snapcraft/remote-build"
|
|
fi
|
|
echo "Retrying in ${pause}s..."
|
|
sleep "$pause"
|
|
fi
|
|
done
|
|
echo "::error::Remote build ${MATRIX_ARCH} failed after $attempts attempts (no wekan_${VERSION}_${MATRIX_ARCH}.snap produced). The Launchpad build log printed above says why; the builds are also at https://launchpad.net/~xet7/+snaps" >&2
|
|
# A DETERMINISTIC failure, named before the guesses below. Three
|
|
# identical attempts on ONE architecture while the others build on
|
|
# attempt 1 is not the build farm having a bad day - and the guidance
|
|
# below ("often an OOM, or a transient reset; re-run") sent v10.77's
|
|
# armhf failure down exactly that path. snapcraft ends a missing
|
|
# stage-package as a "Stopped" build with no artifact, which looks
|
|
# identical to a cancelled one from the outside; the difference is one
|
|
# line in the log, so say it here rather than leave it to be found.
|
|
# The build farm's own package proxy failing is infrastructure, not
|
|
# WeKan: v12.21 s390x stopped on
|
|
# GET http://ftpmaster.internal/.../libyaml-cpp0.8_..._s390x.deb ... 501
|
|
# Failed to fetch package: ... 501 Gateway error [IP: 10.10.10.1 8222]
|
|
# while every neighbouring package downloaded. Name it, so the next
|
|
# step is waiting and re-running rather than editing snapcraft.yaml.
|
|
if grep -qsE 'could not be fetched: 5[0-9][0-9] |Gateway error \[IP: ' snapcraft-wekan-*.txt; then
|
|
proxypkg="$(grep -hs -oE "could not be fetched: 5[0-9][0-9] [^[]*|/download/[^ ']*\.deb" snapcraft-wekan-*.txt | sed 's#^/download/##' | sort -u | tr '\n' ' ')"
|
|
echo "::error::Launchpad's build-farm package proxy failed (HTTP 5xx) while the ${MATRIX_ARCH} build downloaded its stage-packages: ${proxypkg}. That is Launchpad infrastructure, not WeKan, and snapcraft.yaml needs no change; re-run this job (or Release All Missing) later. Builder status: https://launchpad.net/builders" >&2
|
|
fi
|
|
if grep -qs 'Stage package not found' snapcraft-wekan-*.txt; then
|
|
missingpkg="$(grep -hs -o "Stage package not found in part '[^']*': [^ ]*" snapcraft-wekan-*.txt | sort -u | tr '\n' ' ')"
|
|
echo "::error::This is NOT a transient failure and re-running will not fix it: ${missingpkg}. A stage-package that resolves on the 64-bit architectures can be missing on ${MATRIX_ARCH} - Ubuntu 24.04's 64-bit time_t transition renamed libraries to a t64 suffix, and the renamed package carries 'Provides: <old name>' on amd64/arm64 but NOT on armhf, where the ABI really changed. Name the real package in snapcraft.yaml (libssl3 -> libssl3t64, libcurl4 -> libcurl4t64, libgoogle-perftools4 -> libgoogle-perftools4t64). Check a name against the archive: curl -fsSL http://ports.ubuntu.com/ubuntu-ports/dists/noble/main/binary-armhf/Packages.gz | gunzip -c | grep '^Package: <name>$'" >&2
|
|
exit 1
|
|
fi
|
|
# A "Stopped" build with no artifact is Launchpad ENDING the build
|
|
# itself, not a compile error in it. Two causes, in the order to check:
|
|
# 1. The auto-generated Launchpad PROJECT (xet7-craft-remote-build)
|
|
# needs a licence: "None specified" does not qualify for free
|
|
# hosting and Launchpad stops its builds (this is what v10.48 hit).
|
|
# It is now set to MIT / X/Expat (WeKan's licence), so this should
|
|
# already be fine - only re-set it if the page shows "None
|
|
# specified" again.
|
|
# 2. With the licence set, a "Stopped" is Launchpad cancelling the
|
|
# build as it RUNS - and the giveaway is a BUILDING (not FAILED)
|
|
# build log that ends mid-step. The Meteor `npm install` that
|
|
# rebuilds the native modules is memory-heavy and can be OOM-killed
|
|
# on a builder, and the build farm occasionally resets one; both are
|
|
# usually transient, so the three attempts above cover a one-off.
|
|
# (The large-history push that also broke these builds is fixed
|
|
# separately, by flattening the repo before the push.)
|
|
# THE BUILD LOG IS PRINTED ABOVE AND IT SAYS WHY. Read it before
|
|
# believing any guess in this message - the guess has been wrong. For
|
|
# four releases this line said "often an OOM in the Meteor npm install,
|
|
# or a transient build-farm reset", and every one of the four
|
|
# architectures was in fact failing on one deterministic line:
|
|
# Failed to copy '.../parts/mongo42/install/mongo42':
|
|
# no such file or directory
|
|
# a `stage:` filter naming a path that an amd64/arm64-only part does not
|
|
# produce anywhere else. Nothing transient about it, and "re-run" was
|
|
# the one thing that could not help. So these are named as the things to
|
|
# LOOK FOR in the log above, not as what probably happened.
|
|
echo "::error::snap-launchpad ${MATRIX_ARCH}: the Launchpad build log is printed above - read it first; it names the part and the line that failed. Common causes, in the order they are worth checking: (1) a 'Failed to copy .../parts/<part>/install/<path>' - a stage:/prime: filter naming something the part did not produce on THIS architecture, which is deterministic and will not pass on a re-run; (2) an npm/network error inside a part's override-build, which is transient and is retried; (3) 'Stopped' with no artifact and no error - then check that https://launchpad.net/xet7-craft-remote-build still has a licence set (MIT / X/Expat), and otherwise Launchpad ended the build itself. Builds: https://launchpad.net/~xet7/+snaps" >&2
|
|
# A wrong or expired LP_CREDENTIALS makes Launchpad answer 401/403, which
|
|
# reads as an ordinary build failure unless the log is checked. But the
|
|
# pattern must be SPECIFIC: a bare `401`/`403` matches any three digits in
|
|
# the build log - a package size, a hash, "attempt 4/6" - so the old
|
|
# `401|403` fired on almost every large log and told the maintainer to
|
|
# re-create working credentials on every Stopped build. A build that
|
|
# reached "Building:" authenticated fine; the giveaway of a real auth
|
|
# failure is those codes in an HTTP-error context, or an explicit phrase.
|
|
if grep -qiE 'HTTP Error 40[13]|(^|[^0-9])40[13] (Unauthorized|Forbidden)|\bunauthoriz(ed|ation)\b|invalid credentials|bad credentials|not logged in|need to (log|sign) in|macaroon' snapcraft-wekan-*.txt 2>/dev/null; then
|
|
echo "::error::LP_CREDENTIALS may not work: the Launchpad build log shows an authorization failure. Re-create it (snapcraft remote-build once locally) and set: base64 -w0 ~/.local/share/snapcraft/launchpad-credentials" >&2
|
|
fi
|
|
exit 1
|
|
|
|
- name: Collect the FULL build logs for ${{ matrix.arch }}
|
|
# An excerpt in the job log answers "what failed"; it does not answer
|
|
# "what did the mongodb part print an hour earlier", which is what the
|
|
# v10.71 staging failure needed and nobody could get afterwards - the
|
|
# Launchpad build log is deleted with the temporary snap recipe, so once
|
|
# the job is over the only copy is the one kept here. always(), not
|
|
# failure(): a build that succeeded on attempt 2 hides why attempt 1 did
|
|
# not, and these are a few hundred KB of text.
|
|
if: always() && steps.bundle.outputs.available == 'true'
|
|
run: |
|
|
set -uo pipefail
|
|
mkdir -p snap-logs
|
|
# RENAMED, not just copied. snapcraft names a remote-build log after the
|
|
# recipe and an ISO timestamp:
|
|
# snapcraft-wekan-f82a93c2…_s390x_2026-08-09T11:39:05.txt
|
|
# and upload-artifact REFUSES a colon - "Invalid characters include:
|
|
# Double quote, Colon, Less than, ..." - because NTFS cannot hold one.
|
|
# That failed the whole job for s390x, ppc64el and riscv64 in v10.77
|
|
# AFTER all three snaps had built and downloaded on attempt 1, so three
|
|
# good builds were reported as FAILED by the step that saves their logs.
|
|
# The timestamp is worth keeping, so the colons become dashes rather
|
|
# than the name being thrown away.
|
|
for f in snapcraft-wekan-*.txt .tools/tmp/remote-build-attempt.log "$HOME"/.local/state/snapcraft/log/*.log; do
|
|
[ -f "$f" ] || continue
|
|
base="$(basename "$f")"
|
|
cp -f "$f" "snap-logs/${base//:/-}" || true
|
|
done
|
|
ls -la snap-logs || true
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
# A DIAGNOSTIC upload can never fail the build it is diagnosing. The snap
|
|
# is the deliverable; these logs are here so a failure can be read
|
|
# afterwards, and the renaming above is not the last thing that could
|
|
# ever make one of them unuploadable.
|
|
continue-on-error: true
|
|
if: always() && steps.bundle.outputs.available == 'true'
|
|
with:
|
|
name: snap-launchpad-logs-${{ matrix.arch }}
|
|
path: snap-logs/
|
|
if-no-files-found: ignore
|
|
retention-days: 30
|
|
|
|
- name: Push ${{ matrix.arch }} to the Snap Store (stable + candidate + beta + edge)
|
|
if: steps.bundle.outputs.available == 'true' && steps.launchpad.outputs.built == 'true'
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_AUTH }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
shopt -s nullglob
|
|
# Deduplicated: the two patterns match the same file, and uploading it
|
|
# twice is how one build became two Snap Store revisions.
|
|
snaps=( $(printf '%s\n' "wekan_${VERSION}_${MATRIX_ARCH}"*.snap *_"${MATRIX_ARCH}".snap | sort -u) )
|
|
# "No file", "not a snap" and "the store said no" are three different
|
|
# problems with three different owners, so they get three messages.
|
|
# v10.48 printed the SNAP_AUTH one for a file that was never built, and
|
|
# v10.89 let the store be the first to notice a truncated download.
|
|
if [ "${#snaps[@]}" -eq 0 ] || [ ! -s "${snaps[0]}" ]; then
|
|
echo "::error::No wekan_${VERSION}_${MATRIX_ARCH}.snap to upload - the Launchpad build produced no artifact. This is NOT a SNAP_AUTH problem; see the build step above."
|
|
exit 1
|
|
fi
|
|
if [ "$(head -c4 "${snaps[0]}")" != "hsqs" ]; then
|
|
echo "::error::${snaps[0]} is $(stat -c%s "${snaps[0]}") bytes but does not start with the squashfs magic 'hsqs', so it is not a snap - the download from Launchpad was truncated or replaced by an error page. NOT a SNAP_AUTH problem and not a bad build: re-run this job."
|
|
exit 1
|
|
fi
|
|
# base: core24 allows publishing to stable and candidate (core26 does not).
|
|
for f in "${snaps[@]}"; do
|
|
# RETRIED, because the upload can fail for a reason that has nothing
|
|
# to do with the snap. The store accepts the file, scans it, and can
|
|
# then answer:
|
|
# Status: error while processing
|
|
# Issues while processing snap:
|
|
# - binary_sha3_384: Error checking upload uniqueness.
|
|
# which is the store failing its OWN duplicate check on the digest
|
|
# it just computed - a server-side hiccup, not a bad snap. It hit
|
|
# riscv64, ppc64el and s390x in the same v10.78 run, each after a
|
|
# Launchpad build that had succeeded, so three good snaps were lost
|
|
# to it at once. Re-uploading the identical file is what fixes it.
|
|
# Only the store's own processing errors are worth retrying. A rejected
|
|
# file, or credentials the store will not accept, will be rejected the
|
|
# same way every time - and retrying those only buries the message that
|
|
# says what to fix.
|
|
set +e
|
|
SNAP_UPLOAD_LABEL="$f" bash releases/snap-upload-retry.sh "$f" stable,candidate,beta,edge
|
|
rc=$?
|
|
set -e
|
|
case "$rc" in
|
|
0)
|
|
;;
|
|
10)
|
|
echo "::error::The Snap Store failed while processing $f on every one of 3 attempts. This is the store's own upload-uniqueness/processing check failing on a snap it accepted - the file itself built and downloaded fine, so re-running this job later usually publishes it unchanged. Nothing in this repository needs to change." >&2
|
|
exit 1
|
|
;;
|
|
*)
|
|
echo "::error::The Snap Store refused the upload of $f. The snapcraft line above says which: 'is not a valid file' means the build produced nothing usable; 'Credentials could not be parsed' means SNAP_AUTH is not a readable exported login; 401/403 means it lacks the ACL for this snap name. The last two are fixed by re-exporting for all three names: snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl --acls package_access,package_push,package_release,package_update snap-auth.txt" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# always(): a snap Launchpad built and this job downloaded goes onto the
|
|
# GitHub Release even when the Snap Store push above failed or the run was
|
|
# cancelled after the build.
|
|
- name: Attach the ${{ matrix.arch }} snap to the GitHub Release
|
|
if: ${{ always() && steps.bundle.outputs.available == 'true' && steps.launchpad.outputs.built == 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
shopt -s nullglob
|
|
# DEDUPLICATED, like the two places above that build this same list. The
|
|
# two patterns match the SAME file - `wekan_10.91_s390x.snap` matches
|
|
# both - so the array held one path twice, and `gh release upload
|
|
# --clobber` was asked to attach one name twice: it deleted the asset it
|
|
# had just uploaded and then 404'd on it.
|
|
#
|
|
# HTTP 404: Not Found (https://uploads.github.com/repos/wekan/wekan/
|
|
# releases/370103352/assets?label=&name=wekan_10.91_s390x.snap)
|
|
#
|
|
# v10.91 lost s390x, ppc64el and riscv64 from the GitHub Release that
|
|
# way. All three had BUILT, and all three were already published to the
|
|
# Snap Store by the step above - so the failure was only ever in the
|
|
# attaching, which is the half people download from.
|
|
snaps=( $(printf '%s\n' "wekan_${VERSION}_${MATRIX_ARCH}"*.snap *_"${MATRIX_ARCH}".snap | sort -u) )
|
|
if [ "${#snaps[@]}" -gt 0 ] && [ -s "${snaps[0]}" ]; then
|
|
bash releases/github-release-upload.sh "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" "${snaps[@]}"
|
|
else
|
|
echo "No ${MATRIX_ARCH} snap to attach - the build produced none."
|
|
fi
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Say what an unfinished ${{ matrix.arch }} build leaves behind
|
|
if: steps.launchpad.outputs.pending == 'true'
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
echo "::warning::snap-launchpad ${MATRIX_ARCH} is unfinished on Launchpad; this Actions job stopped waiting cleanly before GitHub's cap."
|
|
echo "Re-run this matrix job after Launchpad finishes. Its deterministic snapshot reconnects to the same build, downloads the snap, and publishes it."
|
|
|
|
# An unexpected job-level cancellation is distinct from the deliberate,
|
|
# clean waiter timeout above. It is not necessarily the time cap: in the
|
|
# v12.38 run all four jobs were cancelled at 1h49m of a 360-minute cap,
|
|
# while Launchpad sat in "Uploading", and said "ran out of time".
|
|
- name: Say what a cancelled ${{ matrix.arch }} job leaves behind
|
|
if: cancelled()
|
|
env:
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
echo "::warning::snap-launchpad ${MATRIX_ARCH} was cancelled (by hand, or at the job time cap), but the Launchpad build was NOT cancelled - it may still be building there."
|
|
echo "Re-run THIS job when it has finished: snapcraft remote-build reconnects to the same Launchpad build and downloads the snap; nothing is rebuilt."
|
|
for log in snapcraft-wekan-*.txt; do
|
|
[ -e "$log" ] || continue
|
|
echo "Launchpad build log left by this attempt: $log"
|
|
done
|
|
grep -ho 'https://launchpad.net/[^ ]*' "$HOME/.local/state/snapcraft/log/"*.log 2>/dev/null | sort -u | head -5 || true
|
|
|
|
- name: Job result
|
|
if: always()
|
|
# bash explicitly: this same step runs on the Windows and macOS runners too,
|
|
# where the default shell is PowerShell / not necessarily this bash.
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark snap-launchpad ${MATRIX_ARCH}"
|
|
echo "$mark snap-launchpad ${MATRIX_ARCH}" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::snap-launchpad ${MATRIX_ARCH} FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Repository synchronization is a required, separately visible release job.
|
|
# It used to be an optional step inside snap-variants, so continue-on-error and
|
|
# a receive-pack pre-flight could skip it while the snaps still published.
|
|
update-ondra-gantt-repos:
|
|
needs: [prepare, release]
|
|
if: ${{ !cancelled() && needs.prepare.result == 'success' && needs.release.result == 'success' }}
|
|
uses: ./.github/workflows/update-ondra-gantt-repos.yml
|
|
with:
|
|
source_ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
secrets:
|
|
WEKAN_REPO_TOKEN: ${{ secrets.WEKAN_REPO_TOKEN }}
|
|
|
|
# ─── Variant snaps: wekan-ondra, wekan-gantt-gpl ────────────────────────────
|
|
# Publish two extra snaps that are the newest wekan code under a different snap
|
|
# name. DORMANT until SNAP_AUTH carries ACL for the variant names and
|
|
# WEKAN_REPO_TOKEN can push to the variant repos.
|
|
# See docs/Platforms/FOSS/Container/Snap/Snap-Ondra-Gantt.md.
|
|
snap-variants:
|
|
# The SAME WeKan snap, published under the two older names people still have
|
|
# installed: wekan-ondra and wekan-gantt-gpl. One release publishes all three
|
|
# snaps - wekan from snap-native (and snap-launchpad for the exotic arches),
|
|
# these two from here - so nobody is left on a stale package because their
|
|
# snap has a different name.
|
|
#
|
|
# Building and publishing the snap needs SNAP_AUTH and NOTHING ELSE. The
|
|
# repositories are updated once by update-ondra-gantt-repos above, instead
|
|
# of redundantly from one architecture leg in this matrix.
|
|
#
|
|
# `continue-on-error: true`: a variant must never fail or hold up the release.
|
|
needs: [prepare, release, snap-auth-check]
|
|
continue-on-error: true
|
|
timeout-minutes: 90
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- repo: wekan-ondra
|
|
snapname: wekan-ondra
|
|
title: "Wekan Ondra"
|
|
arch: amd64
|
|
runner: ubuntu-24.04
|
|
- repo: wekan-ondra
|
|
snapname: wekan-ondra
|
|
title: "Wekan Ondra"
|
|
arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
- repo: wekan-gantt-gpl
|
|
snapname: wekan-gantt-gpl
|
|
title: "Wekan Gantt GPL"
|
|
arch: amd64
|
|
runner: ubuntu-24.04
|
|
- repo: wekan-gantt-gpl
|
|
snapname: wekan-gantt-gpl
|
|
title: "Wekan Gantt GPL"
|
|
arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
runs-on: ${{ matrix.runner }}
|
|
env:
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
steps:
|
|
- name: Check required secrets are configured
|
|
id: guard
|
|
env:
|
|
SNAP_AUTH: ${{ secrets.SNAP_AUTH }}
|
|
MATRIX_SNAPNAME: ${{ matrix.snapname }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
# SNAP_AUTH decides whether this job can do its job at all. It must carry
|
|
# the ACL for THIS snap name as well as for `wekan`:
|
|
# snapcraft export-login --snaps wekan,wekan-ondra,wekan-gantt-gpl \
|
|
# --acls package_access,package_push,package_release,package_update \
|
|
# snap-auth.txt
|
|
if [ -z "$SNAP_AUTH" ]; then
|
|
echo "snap=false" >> "$GITHUB_OUTPUT"
|
|
echo "::warning::snap-variants (${MATRIX_SNAPNAME} ${MATRIX_ARCH}) skipped — SNAP_AUTH is not set, so the snap cannot be published. See docs/Platforms/FOSS/Container/Snap/Snap-Ondra-Gantt.md."
|
|
exit 0
|
|
fi
|
|
echo "snap=true" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout wekan at the release tag
|
|
if: steps.guard.outputs.snap == 'true'
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/tags/v${{ needs.prepare.outputs.version }}
|
|
path: wekan
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 wekan/releases/check-telemetry.py --source wekan
|
|
|
|
- name: Build the ${{ matrix.snapname }} tree from wekan
|
|
id: tree
|
|
if: steps.guard.outputs.snap == 'true'
|
|
env:
|
|
MATRIX_SNAPNAME: ${{ matrix.snapname }}
|
|
MATRIX_TITLE: ${{ matrix.title }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
set -euo pipefail
|
|
# The variant IS wekan, with a different snap name - so it is built from
|
|
# the release tag that was just checked out, not from whatever the
|
|
# variant repository happens to contain. No clone is needed for this,
|
|
# which is what makes the snap independent of the repository sync.
|
|
rsync -a --exclude='.git' wekan/ variant/
|
|
cd variant
|
|
# BOTH snapcraft files: snapcraft.yaml is what this job builds, and
|
|
# snapcraft-core26.yaml is the same snap on the next base. Renaming only
|
|
# the first left the core26 file saying `name: wekan`, so a core26 build
|
|
# from the variant repository would try to publish itself as the DEFAULT
|
|
# WeKan snap.
|
|
for f in snapcraft.yaml snapcraft-core26.yaml; do
|
|
[ -f "$f" ] || continue
|
|
sed -i "s/^name: wekan$/name: ${MATRIX_SNAPNAME}/" "$f"
|
|
sed -i "s/^title: .*/title: ${MATRIX_TITLE}/" "$f"
|
|
done
|
|
if ! grep -qxF "name: ${MATRIX_SNAPNAME}" snapcraft.yaml; then
|
|
echo "::error::snapcraft.yaml was not renamed to ${MATRIX_SNAPNAME} ($(grep -m1 '^name:' snapcraft.yaml)) - it would publish itself as the default wekan snap."
|
|
exit 1
|
|
fi
|
|
if ! grep -qxF "version: '${VERSION}'" snapcraft.yaml; then
|
|
echo "::error::snapcraft.yaml is not at version '${VERSION}' ($(grep -m1 '^version:' snapcraft.yaml)). The bump job (releases/version.sh) did not update the tagged commit."
|
|
exit 1
|
|
fi
|
|
echo "${MATRIX_SNAPNAME} ${MATRIX_ARCH}: snapcraft.yaml is $(grep -m1 '^name:' snapcraft.yaml), $(grep -m1 '^version:' snapcraft.yaml), $(grep -m1 '^base:' snapcraft.yaml)."
|
|
|
|
- name: Build the ${{ matrix.snapname }} snap (${{ matrix.arch }})
|
|
id: build-first
|
|
continue-on-error: true
|
|
if: steps.guard.outputs.snap == 'true'
|
|
uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
|
|
with:
|
|
snapcraft-args: pack
|
|
path: variant
|
|
|
|
- name: Refresh managed APT after a package 404 or a failed apt update
|
|
if: steps.build-first.outcome == 'failure'
|
|
run: sudo -u "$(id -un)" -E python3 "$GITHUB_WORKSPACE/wekan/releases/snap-refresh-managed-apt.py"
|
|
|
|
- name: Retry Snapcraft once after refreshing its base instance
|
|
id: build-retry
|
|
if: steps.build-first.outcome == 'failure'
|
|
uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
|
|
with:
|
|
snapcraft-args: pack
|
|
path: variant
|
|
|
|
- name: Select the successful Snap artifact
|
|
id: build
|
|
if: steps.guard.outputs.snap == 'true'
|
|
env:
|
|
BUILT_SNAP: ${{ steps.build-first.outputs.snap || steps.build-retry.outputs.snap }}
|
|
run: |
|
|
test -n "$BUILT_SNAP"
|
|
test -f "$BUILT_SNAP"
|
|
echo "snap=$BUILT_SNAP" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Verify the built snap is ${{ matrix.snapname }}
|
|
if: steps.guard.outputs.snap == 'true'
|
|
env:
|
|
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
|
MATRIX_SNAPNAME: ${{ matrix.snapname }}
|
|
run: |
|
|
set -euo pipefail
|
|
snap="${STEP_BUILD_SNAP}"
|
|
base="$(basename "$snap")"
|
|
case "$base" in
|
|
${MATRIX_SNAPNAME}_*) ;;
|
|
*)
|
|
echo "::error::the build produced $base, which is not a ${MATRIX_SNAPNAME} snap - publishing it would overwrite another snap in the store."
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "OK: $base"
|
|
|
|
- name: Publish ${{ matrix.snapname }} to the Snap Store (all channels)
|
|
if: steps.guard.outputs.snap == 'true'
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_AUTH }}
|
|
STEP_BUILD_SNAP: ${{ steps.build.outputs.snap }}
|
|
run: |
|
|
set -euo pipefail
|
|
# base: core24, grade: stable - so all four channels accept it, exactly
|
|
# as they do for the default wekan snap.
|
|
SNAP_UPLOAD_LABEL="${STEP_BUILD_SNAP}" \
|
|
bash "$GITHUB_WORKSPACE/wekan/releases/snap-upload-retry.sh" "${STEP_BUILD_SNAP}" stable,candidate,beta,edge
|
|
|
|
# Always, as the last step: the run summary then answers "what worked and what
|
|
# did not" for the whole release at a glance, instead of eighteen job logs. A
|
|
# step that failed has already printed an ::error:: saying why; this names the
|
|
# job it was in.
|
|
- name: Job result
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
MATRIX_SNAPNAME: ${{ matrix.snapname }}
|
|
MATRIX_ARCH: ${{ matrix.arch }}
|
|
run: |
|
|
case "${JOB_STATUS}" in
|
|
success) mark='OK ' ;;
|
|
failure) mark='FAILED ' ;;
|
|
cancelled) mark='CANCELLED' ;;
|
|
*) mark="${JOB_STATUS}" ;;
|
|
esac
|
|
echo "$mark snap-variants ${MATRIX_SNAPNAME} ${MATRIX_ARCH}"
|
|
echo "$mark snap-variants ${MATRIX_SNAPNAME} ${MATRIX_ARCH}" >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "::error::snap-variants ${MATRIX_SNAPNAME} ${MATRIX_ARCH} FAILED. The ::error:: line in this job's log, above, says which step and why."
|
|
fi
|
|
|
|
# Refresh the selected changelog notes after builds. Binary provenance remains
|
|
# in build artifacts and is never appended to release notes.
|
|
release-notes:
|
|
permissions:
|
|
contents: write
|
|
name: complete the release notes
|
|
needs:
|
|
- prepare
|
|
- release
|
|
- build-amd64
|
|
- build-arm64
|
|
- build-win64
|
|
- build-win-arm64
|
|
- build-win32
|
|
- build-mac-arm64
|
|
- build-mac-x64
|
|
- build-extra-arches
|
|
# always(), not !cancelled(): a cancelled run still has a release (created
|
|
# by build-amd64 together with its first file) carrying every file that
|
|
# finished building before the cancel, and its notes are still refreshed.
|
|
# What it requires is that release to EXIST, which build-amd64 succeeding
|
|
# guarantees - not the `release` job, which a cancel may have skipped.
|
|
if: ${{ always() && needs.prepare.result == 'success' && needs.build-amd64.result == 'success' }}
|
|
runs-on: ubuntu-24.04
|
|
# A hung job must FAIL on its own rather than wait for somebody to cancel it:
|
|
# cancelling is what skipped the post-release jobs in v10.80, and the jobs below
|
|
# run on !cancelled(), which a timeout satisfies and a cancellation does not.
|
|
# rewrites the notes of a release that is already published.
|
|
timeout-minutes: 15
|
|
steps:
|
|
# ref: main, so this job reads the same CHANGELOG-big.md the release job did.
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: main
|
|
persist-credentials: false
|
|
|
|
- name: Audit telemetry source before release work
|
|
shell: bash
|
|
run: python3 ./releases/check-telemetry.py --source .
|
|
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
continue-on-error: true
|
|
with:
|
|
pattern: provenance-*
|
|
path: provenance
|
|
merge-multiple: true
|
|
|
|
- name: Refresh release notes from the changelog only
|
|
# File to file, never a shell value: see the "Compose the release notes"
|
|
# step for the two ways that broke a release.
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
VERSION: ${{ needs.prepare.outputs.version }}
|
|
run: |
|
|
set -euo pipefail
|
|
bash releases/release-notes.sh "$VERSION" > release-notes.md
|
|
gh release edit --repo "${GITHUB_REPOSITORY:-wekan/wekan}" "v${VERSION}" --notes-file release-notes.md
|
|
echo "Release notes updated from the changelog; binary provenance stays in build artifacts."
|
|
head -40 release-notes.md
|