Skip to content

chore(ci): auto-submit altacv to Typst Universe on release#6

Merged
smur89 merged 4 commits into
mainfrom
feat/auto-submit-typst-universe
Jun 11, 2026
Merged

chore(ci): auto-submit altacv to Typst Universe on release#6
smur89 merged 4 commits into
mainfrom
feat/auto-submit-typst-universe

Conversation

@smur89

@smur89 smur89 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a submit-to-typst-universe job to .github/workflows/build.yml that runs after each release-please tag is cut. It opens a PR on typst/packages submitting altacv:<version> to Typst Universe — replacing the manual fork-and-PR ritual we just did by hand for 0.3.0.

How it works

  • Gated on release-please.outputs.release_created == 'true', downstream of attach-release-artifacts so the tarball is guaranteed to exist on the release before the submission runs.
  • Idempotent: if an open PR for the current version already exists upstream (matched by title altacv:<version>), the job exits cleanly. A re-run from the Actions UI won't double-submit.
  • Branches off upstream/main (not the fork's main), so the cross-repo diff is just the new packages/preview/altacv/<version>/ directory — no stale fork commits leaking in.
  • The PR body matches the shape of the PR I opened manually for 0.3.0: metadata + submission checklist with links to the release.

One-time setup before this can run

  1. Fork typst/packagessmur89/packages (already done for the 0.3.0 manual submission).
  2. Create a fine-grained PAT scoped to smur89/packages with Contents: read+write and Pull requests: read+write.
  3. Store the PAT as a repository secret named TYPST_UNIVERSE_TOKEN here on smur89/alta-typst.

These prerequisites are also documented as a comment block above the new job for future reference.

Edge cases not covered

  • Re-submission after maintainer rejection: if Typst maintainers ask for changes, the workflow will still try to open a fresh PR on the next release. The user closes the previous PR first, or amends manually. Acceptable for now — re-submissions are rare and intentional.
  • Patch releases of an already-merged version: shouldn't happen with our release-please setup (each release gets a unique version), but if it did, upstream typst/packages would reject the duplicate directory.

Test plan

  • CI passes (no syntax errors in the workflow itself).
  • After this merges and TYPST_UNIVERSE_TOKEN is added as a secret, the next release of altacv automatically opens a PR on typst/packages.
  • If a release is cut while the upstream typst/packages PR #5037 is still open, the job's idempotency check kicks in and skips cleanly (PR titles match: altacv:0.3.0).

Shane Murphy added 3 commits June 11, 2026 19:51
Append a `submit-to-typst-universe` job that fires whenever
release-please cuts a new tag (gated on
`release-please.outputs.release_created == 'true'`, downstream of
`attach-release-artifacts` so the tarball exists). It opens a PR on
typst/packages from a maintainer-owned fork (smur89/packages),
branched off the current upstream main so the diff is exactly the
new `packages/preview/altacv/<version>/` directory.

The job is idempotent — a re-run for an already-submitted version
detects the existing open PR and exits cleanly. The PR body mirrors
the manual submission template (metadata + submission checklist).

Prerequisites — documented in the workflow comment block — are a
fork of typst/packages owned by the same account, plus a
fine-grained PAT (TYPST_UNIVERSE_TOKEN secret) scoped to the fork
with contents + pull-requests write.
The `--search "altacv:${VERSION} in:title is:open"` form treats
`altacv:` as a GitHub-search filter qualifier (not a title
substring), returning zero results and breaking the intended
skip-on-existing-PR behaviour. Replaced with `--head <fork>:altacv-${VERSION}`
which matches PRs by branch name — one branch per version, reliable.

Also dropped the job's `contents: read` permission. The submission
job writes only to external repos (smur89/packages + typst/packages)
via the TYPST_UNIVERSE_TOKEN secret; it never reads the workflow
repo, so `permissions: {}` documents that.
The inline heredoc body inside the workflow's `gh pr create` step
was long and tangled bash-escaping (backticks in markdown vs
command substitution) with markdown structure. Moved to
`.github/typst-universe-pr-body.md` and substituted at submission
time via `envsubst` restricted to the three expected variables —
incidental $-references in the body cannot accidentally expand.

The job now sparse-checks-out only that single file, so we don't
pull lib.typ + icons we don't need. The PR body itself is now
editable in any markdown tool, with no shell-escape gotchas.
smur89 added a commit that referenced this pull request Jun 11, 2026
The [Typst Universe automated
check](typst/packages#5037) on altacv 0.3.0
raised two errors and two warnings. This PR addresses all four; once
merged, release-please cuts a 0.3.1 patch with the corrected manifest +
README.

## Errors

- **`README.md:62`** — `examples/example.typ` and `tests/` are
referenced via relative links, but those directories are intentionally
excluded from the package bundle (only `typst.toml`, `lib.typ`,
`icons/`, `LICENSE`, `README.md` ship). The dangling links failed the
bundle integrity check. Replaced with a textual mention plus one link to
the source repository.

## Warnings

- **`typst.toml:7`** — `description` started with "Typst CV template …";
the [manifest
guidelines](https://github.com/typst/packages/blob/main/docs/manifest.md#writing-a-good-description)
say the field should generally not contain the word `Typst` (every
Universe package is Typst by definition).
- **`README.md:9`** — hero image's alt text was just `Preview`. Replaced
with a descriptive sentence covering layout and section content for
accessibility.

## Follow-up

After merge, release-please will open a release PR proposing `0.3.1`.
Merging that cuts the tag + release. Submission of `altacv:0.3.1` to
typst/packages will:

- happen **automatically** if PR #6 (the auto-submit workflow) is
already merged, or
- be done **manually** via the same flow we used for 0.3.0.

We should also **close
[typst/packages#5037](typst/packages#5037
once 0.3.1 is submitted — the 0.3.0 directory in that PR has the unfixed
README/manifest and cannot be patched in place without inconsistency
with the released tarball.

Co-authored-by: Shane Murphy <shane@swissborg.com>
@smur89 smur89 changed the title feat(ci): auto-submit altacv to Typst Universe on release chore(ci): auto-submit altacv to Typst Universe on release Jun 11, 2026
@smur89 smur89 merged commit 49fc45c into main Jun 11, 2026
5 checks passed
@smur89 smur89 deleted the feat/auto-submit-typst-universe branch June 11, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant