Files
doona/.github/workflows/release.yml
T
Zakk 70d27588bf chore(deps): bump github actions to their current majors
Apply the adjacent Dependabot updates together to avoid workflow conflicts:
- actions/upload-artifact v4 -> v7.0.1
- actions/setup-node v4 -> v7.0.0
- actions/checkout v4 -> v7.0.1
- pnpm/action-setup v4 -> v6.1.0
- softprops/action-gh-release v2.5.0 -> v3.0.3
- actions/download-artifact v4 -> v8.0.1 for upload-artifact v7 compatibility
- actions/github-script v7 -> v9.0.0 for the Node 24 runtime

Pin every action to its release SHA and retain exact version comments.
Keep pnpm sourced from packageManager, explicit pnpm caching, unique shard
artifact names, zipped uploads and merge-multiple report extraction.
Keep gh-release's draft, prerelease, files and unmatched-file inputs.
Group release environment writes and separate SOURCE_DATE_EPOCH assignment
from export so shellcheck passes without masking git failures.
2026-10-02 04:02:11 +10:00

133 lines
6.5 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
NFPM_VERSION: 2.47.0
NFPM_SHA256: 0660ca602b2d2d2ae4781a06c692b3eeb9d437ffea05b831d76e41f4a3188783
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: pnpm
# The tag names the version; package.json has to agree before anything is built.
- name: Check the tag against package.json
run: |
eval "$(tools/version.sh "${GITHUB_REF_NAME}")"
declared=$(node -p 'require("./package.json").version')
[ "$NPM" = "$declared" ] || { echo "tag ${GITHUB_REF_NAME} is version $NPM, package.json says $declared" >&2; exit 1; }
{
echo "VERSION=$VERSION"
echo "PRERELEASE=$PRERELEASE"
echo "ARCH_PRERELEASE=$ARCH_PRERELEASE"
echo "NPM=$NPM"
echo "PACKAGE_RELEASE=$PACKAGE_RELEASE"
} >> "$GITHUB_ENV"
- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm build
- run: pnpm check:size
- run: pnpm e2e:install --with-deps
- run: pnpm e2e
env:
DOONA_E2E_WEBKIT: '1'
- run: tools/package.sh --git-version
- name: Install nfpm
run: |
curl -fsSL --retry 3 -o "$RUNNER_TEMP/nfpm.tar.gz" \
"https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz"
echo "${NFPM_SHA256} $RUNNER_TEMP/nfpm.tar.gz" | sha256sum -c -
tar -xzf "$RUNNER_TEMP/nfpm.tar.gz" -C "$RUNNER_TEMP" nfpm
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
# SOURCE_DATE_EPOCH makes the packages reproducible. Alpine is served by install/alpine/APKBUILD instead:
# nfpm's apk output carries a directory mode apk-tools rejects.
- name: Build the distribution packages
run: |
SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
export SOURCE_DATE_EPOCH
program=build/stage/doona/usr/share/doona
fonts=build/stage/doona-fonts/usr/share/doona
mkdir -p "$program" "$fonts"
tar -xzf "release/doona-${NPM}.tar.gz" -C "$program"
tar -xzf "release/doona-fonts-${NPM}.tar.gz" -C "$fonts"
doc=build/stage/doona/usr/share/doc/doona
mkdir -p "$doc" build/stage/doona-fonts/usr/share/doc/doona
mv "$program"/LICENSE "$program"/LICENSES "$program"/NOTICE "$program"/THIRD-PARTY-NOTICES.txt \
"$program"/README.md "$program"/CHANGELOG.md "$doc"/
# rpm takes the documentation files one by one from doona.yaml; a file it does not list would be missing.
(cd "$doc" && find . -type f) | sort | while read -r file; do
grep -qxF " dst: /usr/share/doc/doona/${file#./}" install/nfpm/doona.yaml ||
{ echo "install/nfpm/doona.yaml does not list ${file#./} for rpm" >&2; exit 1; }
done
cp "$fonts"/fonts/OFL.txt build/stage/doona-fonts/usr/share/doc/doona/OFL.txt
for packager in deb rpm ipk archlinux; do
for config in install/nfpm/doona.yaml install/nfpm/doona-fonts.yaml; do
if [ "$packager" = archlinux ]; then
# nfpm 2.47 needs an explicit default epoch to retain Arch's prerelease in .PKGINFO.
arch_config="$RUNNER_TEMP/$(basename "$config")"
sed "/^version_schema: semver$/a epoch: '0'" "$config" > "$arch_config"
PRERELEASE="$ARCH_PRERELEASE" nfpm package --config "$arch_config" --packager "$packager" --target release/
else
nfpm package --config "$config" --packager "$packager" --target release/
fi
done
done
# Keep upstream SemVer in asset names; package metadata retains each format's own version.
- name: Sum every asset
run: |
cd release
if [ -n "$PRERELEASE" ]; then
for name in doona doona-fonts; do
mv "${name}_${VERSION}~${PRERELEASE}-${PACKAGE_RELEASE}_all.deb" "${name}_${NPM}-${PACKAGE_RELEASE}_all.deb"
mv "${name}-${VERSION}~${PRERELEASE}-${PACKAGE_RELEASE}.noarch.rpm" "${name}-${NPM}-${PACKAGE_RELEASE}.noarch.rpm"
mv "${name}_${VERSION}~${PRERELEASE}-${PACKAGE_RELEASE}_all.ipk" "${name}_${NPM}-${PACKAGE_RELEASE}_all.ipk"
done
fi
set -- "doona-${NPM}.tar.gz" "doona-fonts-${NPM}.tar.gz"
for name in doona doona-fonts; do
set -- "$@" "${name}_${NPM}-${PACKAGE_RELEASE}_all.deb" "${name}-${NPM}-${PACKAGE_RELEASE}.noarch.rpm" \
"${name}_${NPM}-${PACKAGE_RELEASE}_all.ipk" "${name}-${VERSION}${ARCH_PRERELEASE}-${PACKAGE_RELEASE}-any.pkg.tar.zst"
done
sha256sum "$@" > SHA256SUMS
# Temporary: honk has no release with the native API yet, so every doona release carries honk's rolling debug builds,
# the source archive of their commit and a note naming it. fetch-honk.mjs fails unless that release still holds the
# commit pinned in tools/honk-commit.txt. Remove this step, that file and the three honk lines in `files` below once
# honk ships one.
- name: Bundle the honk-core debug builds
env:
GH_TOKEN: ${{ github.token }}
run: |
node tools/fetch-honk.mjs release
cd release
sha256sum honk-core-debug-*.tar.gz honk-source-*.tar.gz HONK-SOURCE.txt >> SHA256SUMS
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
draft: true
prerelease: ${{ env.PRERELEASE != '' }}
fail_on_unmatched_files: true
# The last three lines belong to the temporary honk-core step above.
files: |
release/*-${{ env.NPM }}.tar.gz
release/*_${{ env.NPM }}-${{ env.PACKAGE_RELEASE }}_all.deb
release/*-${{ env.NPM }}-${{ env.PACKAGE_RELEASE }}.noarch.rpm
release/*_${{ env.NPM }}-${{ env.PACKAGE_RELEASE }}_all.ipk
release/*-${{ env.VERSION }}${{ env.ARCH_PRERELEASE }}-${{ env.PACKAGE_RELEASE }}-any.pkg.tar.zst
release/SHA256SUMS
release/honk-core-debug-*.tar.gz
release/honk-source-*.tar.gz
release/HONK-SOURCE.txt