json_schema icon indicating copy to clipboard operation
json_schema copied to clipboard

Use publish workflow provided by the setup-dart GHA action

Open joecotton-wk opened this issue 1 year ago • 0 comments

We should use the dart-lang/setup-dart/.github/workflows/publish.yml@v1 workflow provided by the setup-dart GHA action instead of home-rolling our own.

Something like this:

jobs:
  publish:
    name: Publish to pub.dev
    uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

Details

Previously, we were using the publish workflow provided by the setup-dart GHA action. However, this caused our publishing workflow to fail (link):

 Package validation found the following potential issues:
* 1 checked-in file is ignored by a `.gitignore`.
  Previous versions of Pub would include those in the published package.
  
  Consider adjusting your `.gitignore` files to not ignore those files, and if you do not wish to
  publish these files use `.pubignore`. See also dart.dev/go/pubignore
  
  Files that are checked in while gitignored:
  
  test/JSON-Schema-Test-Suite/tests/latest

The origin of this error is a bug in dart publish that hasn't been addressed. Until that bug is addressed, we have to publish with the --skip-validation flag enabled, but the publish workflow from the setup-dart GHA action doesn't allow that parameter to be passed to it. Consequently, we've had to duplicate the majority of that workflow just so we can add the flag.

Once the bug is fixed and we no longer need the --skip-validation flag, we can replace the copied code with the one from setup-dart.

joecotton-wk avatar Apr 03 '24 17:04 joecotton-wk