pdlgen
pdlgen copied to clipboard
use github action to generate cdproto
- it makes the call to easyjson more reliable. Here are the details:
- remove
easyjson.go
from the white list so that deprecated files (if any) won't stay in the repository. - generate
easyjson.go
stubs first so that the source codes are valid from the perspetive of syntax, which in turn makes it possible to runbootstrap.Generator
one by one. - run
bootstrap.Generator
one by one to avoid the occasional failure. Error messages when it failed (both the source file and import path changed from time to time when it failed):# github.com/chromedp/cdproto/cachestorage cachestorage/easyjson.go:8:3: can't find import: "encoding/json" # github.com/chromedp/cdproto/cast cast/easyjson.go:6:3: can't find import: "github.com/mailru/easyjson"
- remove
- The github action will do this jobs:
- run
cdproto-gen
to regenerate thecdproto
package. - test
chromedp
to with the newcdproto
package. - if the run is triggered manually, it will commit the changes to the the
cdproto
repository (to a new branch namebuild-[build id]
. The maintainer can merge this branch after checking.
- run
Note: an encrypted personal access token should be provided to push to the cdproto
repository. See:
- https://docs.github.com/en/actions/reference/encrypted-secrets
- https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
I have tested the workflow with my forked repository (see https://github.com/ZekeLu/pdlgen/actions), but maybe something should be changed to make it work for an organization repository.