mirror of
https://github.com/Zakkaus/doona.git
synced 2026-12-05 16:02:03 +00:00
The release workflow bundled whatever honk's rolling debug pre-release held when it ran. honk overwrites that release on every debug tag, so a debug build published between the honk tag and the doona tag slipped into the doona release unnoticed. tools/honk-commit.txt now names the honk commit a doona release ships, and the release pull request bumps it. fetch-honk.mjs reads it by default (--commit overrides it) and fails unless the release body, the release target when it is a commit, and the source tag all name that commit. It is pinned to 7449f4e2, tag debug.2026.9.28.native-api.2.
125 lines
6.0 KiB
YAML
125 lines
6.0 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@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: pnpm/action-setup@v4
|
|
- uses: actions/setup-node@v4
|
|
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" >> "$GITHUB_ENV"
|
|
echo "PRERELEASE=$PRERELEASE" >> "$GITHUB_ENV"
|
|
echo "ARCH_PRERELEASE=$ARCH_PRERELEASE" >> "$GITHUB_ENV"
|
|
echo "NPM=$NPM" >> "$GITHUB_ENV"
|
|
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: |
|
|
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
|
|
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"
|
|
mkdir -p build/stage/doona/usr/share/doc/doona/LICENSES build/stage/doona-fonts/usr/share/doc/doona
|
|
mv "$program"/LICENSE "$program"/NOTICE "$program"/README.md "$program"/CHANGELOG.md build/stage/doona/usr/share/doc/doona/
|
|
mv "$program"/LICENSES/Apache-2.0.txt build/stage/doona/usr/share/doc/doona/LICENSES/
|
|
rmdir "$program"/LICENSES
|
|
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@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
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
|