gha 0.0.2 copy "gha: ^0.0.2" to clipboard
gha: ^0.0.2 copied to clipboard

Type-safe GitHub Actions workflows in Dart with strongly typed models, action helpers, and YAML generation for creating workflows programmatically.

example/gha_example.dart

import 'package:gha/gha.dart';

void main(List<String> arguments) {
  final workflow = Workflow(
    name: 'CI',
    on: WorkflowTriggers.simple(['push', 'pull_request']),
    jobs: {
      'build': Job(
        name: 'Build and Test',
        runsOn: RunnerSpec.single('ubuntu-latest'),
        steps: const [
          Step(name: 'Checkout', uses: 'actions/checkout@v4'),
          Step(
            name: 'Setup Dart',
            uses: 'dart-lang/setup-dart@v1',
            withArguments: {'sdk': 'stable'},
          ),
          Step(name: 'Install dependencies', run: 'dart pub get'),
          Step(name: 'Run tests', run: 'dart test'),
        ],
      ),
    },
  );

  print(workflow.toYamlString());
}
0
likes
160
points
35
downloads

Publisher

verified publisherglenfordwilliams.com

Weekly Downloads

Type-safe GitHub Actions workflows in Dart with strongly typed models, action helpers, and YAML generation for creating workflows programmatically.

Repository (GitHub)
View/report issues

Topics

#github-actions #workflow #ci-cd #yaml #automation

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com

License

MIT (license)

Dependencies

dart_mappable, json2yaml, json_schema, path, yaml

More

Packages that depend on gha