Introduce a GitHub Actions workflow for publishing a release and fix npm publish
warnings about the package.json
format
#18350
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.
The commit messages contain more details about the individual changes.
Notes:
on_release.js
file botio-files-pdfjs#45 being merged and deployed to the bots first (to avoid publishing twice).NPM_TOKEN
repository secret being configured in this repository, with the same token that the bots currently have.on: pull_request
trigger so that I could trigger the workflow from my branch (because releases require it to be merged tomaster
first which is inconvenient for testing) and adding the--dry-run
option to thenpm publish
command so that we can see what e.g. the release tarball would contain without actually having to publish anything yet. You can find the logs of the dry-run for the first commit at https://github.com/timvandermeij/pdf.js/actions/runs/9732441891/job/26858099909?pr=11 and with the second commit applied at https://github.com/timvandermeij/pdf.js/actions/runs/9732541964/job/26858344999?pr=11 (showing that the warnings are now gone). Release tarball correctness can be verified by comparing the file listing in the logs to the file listing on https://www.npmjs.com/package/pdfjs-dist/v/latest?activeTab=code, and seeing that the "total files" property of 334 and the "unpacked size" property of 36 MB matches what's listed on NPM for the current release.pdfjs-dist
repository has been broken for a long time and the current logic fails to run on GitHub Actions. To keep the scope of this patch small and to only port the logic we actually need and have functional right now I'll make a follow-up issue for revamping the Git publishing part in a separate scope (because that'll have to be re-implemented anyway).Fixes a part of #11851.