Skip to content

Use publish workflow provided by the setup-dart GHA action #184

@joecotton-wk

Description

@joecotton-wk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions