Repository navigation
ci: npm trusted publishing (OIDC) and a version-bump release workflow - #23
Merged
Merged
Conversation
Co-authored-by: Yukai Huang <hi@yukai.dev>
Coverage Report for CI Build 39545612036Coverage remained the same at 99.336%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Co-authored-by: Yukai Huang <hi@yukai.dev>
…im RELEASING.md Co-authored-by: Yukai Huang <hi@yukai.dev>
…gical tests "many code spans on one line" and "many images on one line" (added in 240d144) rendered 300000 repeats under a 3s limit that includes worker startup. Healthy code took 1.8-2.8s on CI, so slow runners timed out, while the quadratic code they guard against rendered code spans in 2.4s on a fast machine and passed. Compare the time for n and 4n repeats in the same worker instead: about 4x for the current code, 7-9x for the code before 240d144, limit 6x. Co-authored-by: Yukai Huang <hi@yukai.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two workflows:
.github/workflows/publish.ymlpublishes@hackmd/markdown-itto npm through npm trusted publishing (OIDC). It uses no npm token, and every publish gets provenance..github/workflows/bump-version.ymlbumps the version, rebuildsdist/, commits and tags on master, creates the GitHub Release, and dispatchespublish.yml.Agent: Cursor cloud agent (on behalf of Yukaii)
publish.ymlrelease: published(a person publishing a Release) andworkflow_dispatch(used by the bump workflow, or a manual re-run with optionaldry-run).id-token: write,contents: read.npm, used as an approval gate.package.json'sversion, that version must not already be on npm, and a manual run must come from a tag or master.npm ci,npm test,npm run build, thennpm publish --access public --provenance. Pre-release versions are published undernext.bump-version.ymlworkflow_dispatchon master.release-type(patch, minor, major or prerelease), optional explicitversion,preid(defaultbeta), anddry-run.npm version --no-git-tag-versionupdatespackage.jsonandpackage-lock.json.dist/.chore: release <version> [skip ci], includingdist/. This replaces the manual "chore: build" commit.v<version>and push the commit and tag in one atomic push.gh release create --generate-notes.gh workflow run publish.yml --ref v<version>.CHANGELOG.md.Design notes
workflow_dispatchdoes. That's why the bump workflow dispatches publish explicitly.[skip ci]: it only affectspushandpull_requestevents.publish.ymlhas no push trigger, so the skip can't reach it.workflow_call: withworkflow_call, npm would validate the caller's filename. A dispatched run ofpublish.ymlis its own top-level run, so the registered filename stayspublish.yml.Other changes
package.json:repositorynow uses the full GitHub URL. Trusted publishing requiresrepository.urlto match the repository.RELEASING.md, plus a one-line link to it fromCONTRIBUTING.md.Flaky pathological tests (pre-existing, from #22)
Push CI on 77a6dc4 and d5878aa failed with
Terminated (timeout exceeded). The failing tests were "many code spans on one line" and "many images on one line", which 240d144 added in #22.test_linearnow compares the time for n and 4n repeats in the same worker, best of 2, with a 30-second hang timeout. Results:lib/: 7.3 to 8.6x, so it fails the 6x limit every time.Testing
npm testpasses on Node 18 and 24.14.2.0andminorboth give14.2.0, andprereleasegives14.1.3-beta.0.12.0.12) and an unchanged version (14.1.2) are rejected.dist/,package.jsonandpackage-lock.json.npm Trusted Publisher values
hackmdiomarkdown-itpublish.ymlnpmNo version bump, tags, releases, publishes or workflow runs.