Releases are mostly automated. Tag a commit with vX.Y.Z and push the tag — .github/workflows/release.yml builds prebuilt binaries for Linux, macOS Intel, macOS arm64, and Windows; publishes to crates.io, the Snap Store, and the AUR; and creates a GitHub Release with checksums.
This document covers the one-time setup for each channel and the per-release checklist at the bottom.
-
Add topics (Settings → About → Topics):
markdown,markdown-viewer,egui,rust,linux,desktop-appsyntax-highlighting,file-explorer,tabs,wayland,x11
-
Add description:
Fast, lightweight markdown viewer with LaTeX math, mermaid diagrams, tabs, file explorer and live reload
-
Enable features:
- Releases
- Discussions (optional)
Every v* tag auto-publishes via the publish-crates job in release.yml. The job is gated on CARGO_REGISTRY_TOKEN — if the secret isn't set, the job no-ops with a notice and the rest of the release still ships.
The vendored fork at crates/egui_commonmark/ is published to crates.io under renamed identifiers (egui_commonmark_extended, egui_commonmark_backend_extended, egui_commonmark_macros_extended) so the consumer can resolve features like math that don't exist upstream in lampsitter/egui_commonmark. scripts/publish-crates.sh publishes in dep order (backend → macros → extended → md-viewer) with a 45 s settle delay between each, and treats "already uploaded" as success so re-tagging the same version doesn't fail.
- Generate a crates.io token at https://crates.io/settings/tokens with scope
publish-update(coverspublish-new+ version updates). Optionally restrict to the four crates listed above. - Add it as a GitHub repo secret named
CARGO_REGISTRY_TOKEN(Settings → Secrets and variables → Actions → New repository secret).
When the vendored fork at crates/egui_commonmark/ changes:
- Bump the workspace version in
crates/egui_commonmark/Cargo.toml:[workspace.package] version = "0.NEW.0" [workspace.dependencies] egui_commonmark_backend_extended = { version = "0.NEW.0", path = "...", ... } egui_commonmark_macros_extended = { version = "0.NEW.0", path = "...", ... }
- Update the root
Cargo.tomlconsumer line:egui_commonmark_extended = { version = "0.NEW.0", ... }. - Push the next
v*tag. CI publishes the fork crates at the new version, then md-viewer.
The root [patch.crates-io] block stays — it's neutral for cargo publish (which ignores patches) and useful locally between fork bumps.
If you need to publish manually (e.g., the CI job is unavailable):
export CARGO_REGISTRY_TOKEN=<your token>
bash scripts/publish-crates.shThe AUR md-viewer-git package is now published automatically by CI on every v* tag (see the publish-aur job in .github/workflows/release.yml).
- Create an SSH keypair dedicated to AUR pushes (no passphrase):
ssh-keygen -t ed25519 -f aur-key -C "aur-md-viewer" -N ""
- Register the public key on your AUR account → SSH Public Key:
https://aur.archlinux.org/account/aydiler/edit
(paste the contents of
aur-key.pub). - Add the private key as a GitHub repo secret named
AUR_SSH_PRIVATE_KEY(Settings → Secrets and variables → Actions → New repository secret). Value: entire contents of theaur-keyfile (including BEGIN/END lines). - Delete the local keypair:
rm aur-key aur-key.pub.
After this, every git push origin v0.X.Y triggers publish-aur, which:
- Bumps the literal
pkgver=inaur/PKGBUILDto the tag version. - Regenerates
.SRCINFOvia anarchlinux/archlinux:base-develcontainer. - Commits and pushes to
ssh://aur@aur.archlinux.org/md-viewer-git.git.
The job is gated on the secret existing (if: secrets.AUR_SSH_PRIVATE_KEY != ''), so the rest of the release pipeline still runs if you skip this setup.
git clone ssh://aur@aur.archlinux.org/md-viewer-git.git
cd md-viewer-git
cp /path/to/repo/aur/PKGBUILD .
sed -i "s/^pkgver=.*/pkgver=$NEW_VERSION/" PKGBUILD
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO && git commit -m "Update to $NEW_VERSION" && git pushTest locally: makepkg -si.
A second AUR package, md-viewer-bin, ships the GitHub Releases prebuilt binary instead of compiling from source. Arch users pick one:
md-viewer-bin— fast install (~5 s), no Rust toolchain needed, x86_64 only.md-viewer-git— compiles from git HEAD, picks up unreleased changes.
The two packages conflict with each other; pacman won't allow both.
Maintained by the publish-aur-bin job in release.yml, mirroring publish-aur with three differences:
- Pushes to
ssh://aur@aur.archlinux.org/md-viewer-bin.git. - Rewrites both
pkgver=and the five-elementsha256sums=( ... )array (Python inline, since multi-linesedis fragile). The tarball checksum comes from the build job's<asset>.sha256artifact; the four aux-file checksums (.desktop, icon,LICENSE,THIRD_PARTY_NOTICES) are computed from raw GitHub at the tag. - First push to the brand-new AUR repo uses
git push -u origin HEAD:refs/heads/master.
Same AUR_SSH_PRIVATE_KEY secret powers both jobs; no separate setup. The job is independently gated, so a -git-only or -bin-only failure doesn't block the other.
The PKGBUILD pulls the .desktop, icon, LICENSE and THIRD_PARTY_NOTICES from raw GitHub URLs pinned to v${pkgver}. The release tarball has contained LICENSE and THIRD_PARTY_NOTICES since 0.1.14, so those two entries could be dropped and the files read from ${srcdir}/; the .desktop file and icon are not in the tarball.
Every source's local name carries ${pkgver} (md-viewer-${pkgver}.desktop::…, THIRD_PARTY_NOTICES-${pkgver}::…). makepkg does not download a source whose file already exists in the build directory, and AUR helpers keep that directory between upgrades. With a fixed name, the first release that changes the file fails its checksum for everyone whose build directory still holds an older copy (#282, devlog 116).
git clone ssh://aur@aur.archlinux.org/md-viewer-bin.git
cd md-viewer-bin
cp /path/to/repo/aur-bin/PKGBUILD .
# Edit PKGBUILD: bump pkgver= (or pkgrel= for a packaging-only fix), then refresh all five sha256sums via
# `updpkgsums` (from pacman-contrib) — it downloads each source and rewrites
# the array in place.
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO && git commit -m "Update to $NEW_VERSION" && git push-
Create Snapcraft account: https://snapcraft.io/account
-
Login:
snapcraft login- Build the snap:
cd /path/to/repo
snapcraft- Register the name (one-time):
snapcraft register md-viewer- Upload and release:
snapcraft upload --release=stable md-viewer_0.1.0_amd64.snapReleases go through CI, not these steps: the publish-snap job in release.yml (and snap-publish.yml for a re-publish) builds the snap in LXD, checks its file list (scripts/snap-ci.sh, check_contents) and then starts it (scripts/snap-smoke.sh): the snap's binary runs under bubblewrap with the core22 base as / and the environment from its own meta/snap.yaml, on a private Xvfb, once with the runner's fonts and once with none. A snap that exits, panics or leaves the screen blank is not uploaded; the run keeps its logs and screenshots as the snap-smoke artifact. To check a snap locally, run bash scripts/snap-smoke.sh <file.snap> (it downloads core22 unless SNAP_SMOKE_BASE points at one). Devlog 117.
A Flatpak manifest lives at flatpak/io.github.aydiler.md-viewer.yaml. Submitting to Flathub is manual (one-time PR to the Flathub org).
- Replace the placeholder icon at
data/io.github.aydiler.md-viewer.pngwith a designed 256×256 PNG (or scalable SVG). Flathub reviewers will reject submissions whose icon is a generic placeholder. - Bump
tag:andcommit:in the manifest to the latest release before opening the PR. Thex-checker-datablock will auto-bump them on subsequent releases after the first submission is accepted. - Regenerate Cargo sources when
Cargo.lockchanges its transitive deps (Flathub builds offline):Commit the updated# one-time tool setup git clone https://github.com/flatpak/flatpak-builder-tools.git /tmp/fbt uv run --with aiohttp --with PyYAML --with tomlkit \ /tmp/fbt/cargo/flatpak-cargo-generator.py Cargo.lock \ -o flatpak/cargo-sources.jsonflatpak/cargo-sources.json. Pure version bumps (without dep changes) don't require regeneration. - Run the Flathub linter and fix all error-level findings:
Warnings are non-fatal but worth addressing. One known lint error is intentional:
# one-time tool install (Arch Linux): sudo pacman -S flatpak-builder flatpak install --user flathub org.flatpak.Builder # then: flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest \ flatpak/io.github.aydiler.md-viewer.yaml
finish-args-home-ro-filesystem-accessflags the--filesystem=home:ropermission. The viewer needs this to read markdown files at arbitrary paths under$HOMEfor CLI invocation (md-viewer ~/anywhere/foo.md) and live reload via the notify watcher. Flathub permits read-only home access with reviewer justification — include a note in the PR description explaining the use case. If reviewers reject it, fall back to--filesystem=xdg-documentsonly and document the CLI/live-reload limitation in the README.
flatpak install --user flathub \
org.freedesktop.Platform//24.08 \
org.freedesktop.Sdk//24.08 \
org.freedesktop.Sdk.Extension.rust-stable//24.08
flatpak-builder --user --install --force-clean build-dir \
flatpak/io.github.aydiler.md-viewer.yaml
flatpak run io.github.aydiler.md-viewer README.md- Fork https://github.com/flathub/flathub on GitHub.
- Create a branch
io.github.aydiler.md-viewerin your fork. - Add
io.github.aydiler.md-viewer.yaml(copied from this repo'sflatpak/) plus thecargo-sources.jsonto the branch root. - Open a PR against
flathub/flathub:new-pr. Flathub's bot will validate the build. - Iterate with reviewers (typical asks: icon variants, screenshot improvements, sandbox tightening).
- After merge, Flathub builds and serves updates on every
v*tag if you wirex-checker-datainto the manifest.
The repo currently ships a placeholder icon at data/io.github.aydiler.md-viewer.png (256×256 "md" on dark blue, generated by ImageMagick). Replace this with a designed icon before opening the Flathub PR. The icon is also referenced by the Flatpak manifest and AppStream metainfo.
- Update version in
Cargo.toml(version = "X.Y.Z") - Update version in
snap/snapcraft.yaml(version: 'X.Y.Z') —version-syncCI check enforces parity - If the vendored renderer changed, bump
[workspace.package] versionincrates/egui_commonmark/Cargo.tomland every reference to it — theVendored fork is publishable to crates.iorelease step fails otherwise - Bump
Cargo.locksurgically, anchored onname = "md-viewer". Neversedthe version line: the fork lockfile carriesglamin sixteen versions and a substitution rewrites unrelated crates - Append a
<release>entry todata/io.github.aydiler.md-viewer.metainfo.xml - Write the
## [X.Y.Z] - YYYY-MM-DDsection inCHANGELOG.mdby hand. Do not rungit-cliff -o CHANGELOG.md— this history is not conventional-commit shaped, and-oreplaces the hand-written prose with a sparse file that drops whole versions (seedocs/LESSONS.md) - Commit:
git commit -am "Release X.Y.Z" - Tag:
git tag vX.Y.Z && git push origin main vX.Y.Z - Watch
release.yml. Expected outputs:- 3 prebuilt binaries (Linux x86_64, macOS arm64, Windows x86_64) + matching
.sha256. Intel Mac was dropped from the matrix — its runner pool queued for 24+ minutes on v0.1.3; those users build viacargo install - GitHub Release with
RELEASE_NOTES.mdbody - crates.io publish (gated on
CARGO_REGISTRY_TOKEN; idempotent on re-tag) - Snap Store stable channel publish
- AUR push (gated on
AUR_SSH_PRIVATE_KEY)
- 3 prebuilt binaries (Linux x86_64, macOS arm64, Windows x86_64) + matching