GitHub Actions Kotlin DSL

Overview

GitHub Actions Kotlin DSL

Work in progress!

The goal is to be able to describe GH Actions in Kotlin with all its perks, like:

workflow(
    name = "Test workflow",
    on = listOf(Push),
) {
    job(
        name = "test_job",
        runsOn = UbuntuLatest,
    ) {
        uses(action = "actions/checkout@v2")

        run(
            name = "Hello world!",
            run = "echo 'hello!'")
    }
}
Comments
  • Update Gradle config to share common configuration

    Update Gradle config to share common configuration

    Hi, I thought I'd make a PR directly rather than an issue - I hope that's okay.

    I noticed the Gradle build files had some repetition that could be tidied up by using buildSrc convention plugins.

    I also tidied up some of the Gradle task definitions.

    To help me work with the existing style I added a simple Editor Config file.

    If accepted, here are some notes on how to develop in the future:

    • The versions of Gradle plugins are defined in one place: ./buildSrc/build.gradle.kts
    • To add a new Gradle plugin, add the Maven coordinates to ./buildSrc/build.gradle.kts
    • Repositories are defined in one place: ./buildSrc/repositories.settings.gradle.kts
    • To change a Kotlin setting for all subprojects, change it in the kotlin-jvm.gradle.kts buildSrc plugin. To change a setting for one subproject, change it in that subproject

    The versions of dependencies could be defined in one place using the 'Java Platform' plugin and/or using a version catalog - I can implement this if you'd like!

    opened by aSemy 13
  • Improve and centralize YAML serialization

    Improve and centralize YAML serialization

    Currently the library contains logic for serializing to YAML in multiple places. Besides mixing layers (business logic vs serialization), this is error-prone because e.g. fixing an issue in one place may lead to not fixing it in other relevant contexts.

    Here's a list of problems that appeared because of incorrect YAML serialization:

    • #36
    • #70
    • #89 (confusion during development how to make the indent correct)
    • #369
    • #370
    • #292
    enhancement 
    opened by krzema12 13
  • Create a tool for providing typings for action inputs and outputs

    Create a tool for providing typings for action inputs and outputs

    Problem statement

    Currently it's challenging to add support for multiple new actions. Each new action requires checking its inputs and inferring their types which then land in WrappersToGenerate.kt. Sometimes they are provided by the authors in README, sometimes they are inferred from input's description or type of default value. It doesn't scale well, introduces a risk of human error and adds operational load for actions already supported if they get new inputs.

    Proposed solution

    We should encourage action owners to proactively provide types for their actions' APIs in a standardized manner. The proposed approach is to have a GitHub action that would read action's manifest (action.y(a)ml) and would validate an extra type attribute for each input and output. This DSL library currently generates type-safe API only for inputs, but in the future the outputs can be type-safe as well.

    Once such approach becomes popular, an automated job could proactively scan GitHub for actions using the typing validation action mentioned above, and add it to the list of requested wrappers. In the future, once Kotlin compiler plugins are easier to use from Kotlin scripting, I can imagine generating necessary wrapper code using such plugin, which would remove the need to maintain wrappers code in the library.

    enhancement 
    opened by krzema12 12
  • allow running script from anywhere using __FILE__

    allow running script from anywhere using __FILE__

    see #129

    the minimal way to call workflow is now with arguments like so

    workflow(
        name = "...",
        on = listOf()
        sourceFile = __FILE__,
    ) {
        ...
    }
    

    optional arguments are

    • rootDir, by default finds the first folder up the filetree that contains a .git folder
    • targetFolder, by default $gitRootFolder/.github/workflows/
    • targetFileName by default the basename of the script + .yml (eg. build.main.kts -> build.yml)

    usage sample: https://github.com/NikkyAI/twitch-announcement-discord-bot/blob/main/.github/workflows/docker_workflow.main.kts

    opened by NikkyAI 11
  • [#99] Allow setting arbitrary workflow/job/step attribute

    [#99] Allow setting arbitrary workflow/job/step attribute

    Allow setting arbitrary workflow/job/step attribute via withFreeArgs(...) https://github.com/krzema12/github-actions-kotlin-dsl/issues/99

    val action = CheckoutV2(
        repository = "repository",
        ref = "main",
    ).withFreeArgs(
        "hello" to "world",
        "repository" to "jcenter",
        "groceries" to listOf("cheese", "wine"),
    )
    val trigger = PullRequest().withFreeArgs(
        "types" to listOf("ignored"),
        "lang" to "french",
        "list" to listOf(1, 2, 3)
    )
    
    val workflow = workflow(
    ) {
        job(
            name = "test_job",
            runsOn = RunnerType.UbuntuLatest,
        ) {
        }.withFreeArgs(
            "distribute-job" to true,
            "servers" to listOf("server-1", "server-2")
        )
    }.withFreeArgs(
        "dry-run" to true,
        "written-by" to listOf("Alice", "Bob")
    )
    
    opened by jmfayard 11
  • Periodic jobs are ran for forked repos

    Periodic jobs are ran for forked repos

    It's usually not needed, and needlessly consumes shared resources. The jobs are usually needed only for the original repo since they help keeping the action wrappers up-to-date.

    bug 
    opened by krzema12 10
  • Env vars in type-safe expressions are serialized incorrectly

    Env vars in type-safe expressions are serialized incorrectly

    See https://github.com/krzema12/github-actions-kotlin-dsl/actions/workflows/Integration%20tests%20-%20type-safe%20expressions.yaml

    The workflow is not valid. .github/workflows/Integration tests - type-safe expressions.yaml (Line: 26, Col: 14): Unexpected symbol: '$GREETING'. Located at position 1 within expression: $GREETING
    

    There wasn't a single successful run. I noticed it by accident. It doesn't produce a failed run within e. g. a PR which is a real bummer.

    FYI @jmfayard

    bug 
    opened by krzema12 10
  • [Bug] Library produces YAML with anchors not working on GitHub

    [Bug] Library produces YAML with anchors not working on GitHub

    Action

    https://github.com/krzema12/github-actions-kotlin-dsl/blob/982b225bc2c456962b9280da86f19068a64d61b0/.github/workflows/check-if-wrappers-up-to-date.main.kts#L21-L23

    See the PullRequest and WorkflowDispatch triggers, they have no arguments which produces {} in YAML:

    https://github.com/krzema12/github-actions-kotlin-dsl/blob/982b225bc2c456962b9280da86f19068a64d61b0/.github/workflows/check-if-wrappers-up-to-date.yaml#L10-L14

    Apparently snakeyaml thinks it can optimize stuff by putting {} under an alias.

    Expected

    A working workflow, in this case: without the aliases and anchors.

    Actual

    https://github.com/krzema12/github-actions-kotlin-dsl/actions/runs/2885270912

    The workflow is not valid. .github/workflows/check-if-wrappers-up-to-date.yaml: Anchors are not currently supported. Remove the anchor 'id001'

    Workaround, if exists

    Try to adjust your code so that there are no repeated objects. Example: https://github.com/krzema12/github-actions-kotlin-dsl/commit/fc98b5c52a473b1097659a4dd8cf97356f3b796d

    Library version

    v0.25.0

    bug 
    opened by krzema12 8
  • [Core feature request] Defaults Parameters

    [Core feature request] Defaults Parameters

    What feature do you need? defaults parameter for workflows and jobs.

    Do you have an example usage?

    defaults:
      run:
        shell: bash
        working-directory: scripts
    

    Is there a workaround for not having this feature? If yes, please describe it. The custom arguments for either workflows or jobs do not work in this case since its a nested map and custom arguments only support one level of nesting at the moment.

    enhancement question 
    opened by scottbisaillon 8
  • [#203] type-safe expressions

    [#203] type-safe expressions

    opened by jmfayard 8
  • [Action wrapper request] Implement wrappers for most popular actions

    [Action wrapper request] Implement wrappers for most popular actions

    There are lists of most popular actions, e.g.: https://codecov.wordpress.com/2020/09/14/most-popular-and-used-github-actions/ The goal here is to proactively add them so that there's higher chance that new users of this library can use it without adding new wrappers.


    List of wrappers to add, updated so that already added wrappers are removed: https://gist.github.com/krzema12/59de5c0508dac8f5d1d27d00de38a06e

    enhancement 
    opened by krzema12 8
  • [Action wrapper(s) request] superfly/flyctl-actions/setup-flyctl@master

    [Action wrapper(s) request] superfly/flyctl-actions/setup-flyctl@master

    Are you sure the action(s) you want aren't already supported?

    No, it's not supported yet

    What action(s) do you need?

    • superfly/flyctl-actions/setup-flyctl@v1
      • https://github.com/superfly/flyctl-actions/tree/master/setup-flyctl

    Read more about them: https://fly.io/docs/app-guides/continuous-deployment-with-github-actions

    Note that this action is not using the default and recommended project layout. I.e. they have action.yml in a subdirectory.

    Thus, I was not able to quickly make the generator (./gradlew :wrapper-generator:run) work generate anything for it. I got either

    Generating superfly/flyctl-actions@setup-flyctl
    Exception in thread "main" java.lang.IllegalArgumentException: Only major versions are supported, and 'setup-flyctl' was given!
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt.generateWrapper(Generation.kt:48)
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt.generateWrapper$default(Generation.kt:44)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.generateWrappers(GenerationEntryPoint.kt:39)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.main(GenerationEntryPoint.kt:28)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.main(GenerationEntryPoint.kt)
    

    or

    Generating flyctl-actions/setup-flyctl@v1
      ... from https://raw.githubusercontent.com/flyctl-actions/setup-flyctl/dbf1fa04f4d2e52c33185153d06cdb5443aa189d/action.yml
      ... from https://raw.githubusercontent.com/flyctl-actions/setup-flyctl/dbf1fa04f4d2e52c33185153d06cdb5443aa189d/action.yaml
    Exception in thread "main" java.lang.IllegalStateException: flyctl-actions/setup-flyctl@v1
    †Can't fetch any of those URLs:
    - https://raw.githubusercontent.com/flyctl-actions/setup-flyctl/dbf1fa04f4d2e52c33185153d06cdb5443aa189d/action.yml
    - https://raw.githubusercontent.com/flyctl-actions/setup-flyctl/dbf1fa04f4d2e52c33185153d06cdb5443aa189d/action.yaml
    Check release page https://github.com/flyctl-actions/setup-flyctl/releases
            at it.krzeminski.githubactions.wrappergenerator.metadata.MetadataReadingKt.fetchMetadata(MetadataReading.kt:64)
            at it.krzeminski.githubactions.wrappergenerator.metadata.MetadataReadingKt.fetchMetadata$default(MetadataReading.kt:48)
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt$generateWrapper$1.invoke(Generation.kt:46)
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt$generateWrapper$1.invoke(Generation.kt:46)
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt.generateWrapper(Generation.kt:52)
            at it.krzeminski.githubactions.wrappergenerator.generation.GenerationKt.generateWrapper$default(Generation.kt:44)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.generateWrappers(GenerationEntryPoint.kt:39)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.main(GenerationEntryPoint.kt:28)
            at it.krzeminski.githubactions.wrappergenerator.GenerationEntryPointKt.main(GenerationEntryPoint.kt)
    

    When trying to run it with three / two levels accordingly.

    enhancement 
    opened by madhead 0
  • [Action wrapper(s) request] madhead/intellij-http-client-action

    [Action wrapper(s) request] madhead/intellij-http-client-action

    opened by madhead 0
  • Plot build time on CI

    Plot build time on CI

    https://api.github.com/repos/krzema12/github-workflows-kt/actions/runs?branch=main&event=push

    https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

    operational 
    opened by krzema12 1
  • Host script-generator somewhere

    Host script-generator somewhere

    https://kotlinlang.slack.com/archives/C02UUATR7RC/p1669500030127449?thread_ts=1669498777.877479&cid=C02UUATR7RC

    Ideas how to proceed:

    • check the cost of hosting the current solution as a Web service
    • see how hard it would be to port script-generator to Kotlin/JS
      • it has two major external dependencies: Kotlin Poet and kaml
    • a GitHub action you run once, which produces the Kotlin scripts, runs them, removes itself and commits everything
    enhancement 
    opened by krzema12 0
  • Encourage action owners to onboard github-actions-typing

    Encourage action owners to onboard github-actions-typing

    • https://github.com/Vampire/setup-wsl/pull/30
    • https://github.com/madhead/read-java-properties/issues/36 (also for madhead/check-gradle-version and madhead/semver-utils)
    • https://github.com/mi-kas/kover-report/issues/34
    • https://github.com/gautamkrishnar/blog-post-workflow/pull/149
    • https://github.com/ReactiveCircus/android-emulator-runner/issues/268
    • https://github.com/bahmutov/npm-install/pull/148
    • https://github.com/Borales/actions-yarn/issues/52
    • :purple_heart: https://github.com/krzema12/github-actions-typing/commit/39ca5c89e5654f2c294c8fa7e09dcb7fda39ce9a
    • https://github.com/softprops/action-gh-release/issues/282
    • :purple_heart: https://github.com/c2corg/browserslist-update-action/commit/c9492fdf2e05303c4a5159bd5d4b108a92a4f419
    • :purple_heart: https://github.com/c2corg/transifex-pull-request-action/commit/871f9e05b06923c57bc00263f45c718d43634dba
    • https://github.com/ericcornelissen/git-tag-annotation-action/pull/262
    • https://github.com/actions/stale/pull/830
    • https://github.com/entrostat/git-secret-action/pull/3
    opened by krzema12 1
Releases(v0.33.0)
  • v0.33.0(Dec 8, 2022)

  • v0.32.0(Nov 25, 2022)

  • v0.30.0(Oct 28, 2022)

    :star: Features

    DSL

    • chore: enable explicit API mode - it should be easier to browse the source code of the library, now the visibility modifiers are added everywhere. It's clear what's included in library's public API

    Actions

    :hammer_and_wrench: Fixes

    None.

    :bomb: Breaking changes

    • define typings in YAMLs - for details see https://github.com/krzema12/github-workflows-kt/issues/407#issuecomment-1295180055

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.29.0...v0.30.0

    Source code(tar.gz)
    Source code(zip)
  • v0.29.0(Oct 14, 2022)

    :star: Features

    DSL

    None.

    Actions

    :hammer_and_wrench: Fixes

    None.

    :bomb: Breaking changes


    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.28.0...v0.29.0

    Source code(tar.gz)
    Source code(zip)
  • v0.28.0(Sep 30, 2022)

    :star: Features

    DSL

    Actions

    :hammer_and_wrench: Fixes

    :bomb: Breaking changes


    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.27.0...v0.28.0

    Source code(tar.gz)
    Source code(zip)
  • v0.27.0(Sep 16, 2022)

  • v0.26.0(Sep 1, 2022)

    :star: Features

    DSL

    Actions

    :hammer_and_wrench: Fixes

    :bomb: Breaking changes

    • the fix for #416 includes minor formatting changes, especially around 'on': -> on:

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.25.0...v0.26.0

    Source code(tar.gz)
    Source code(zip)
  • v0.25.0(Aug 18, 2022)

    :star: Features

    Actions

    :hammer_and_wrench: Fixes

    :bomb: Breaking changes

    • the change of using snakeyaml to emit YAML: it's not technically a breaking API change, but it will emit a slightly different YAML in terms of formatting

    Also, thanks @aSemy for contributing to the build system config!


    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.24.0...v0.25.0

    Source code(tar.gz)
    Source code(zip)
  • v0.24.0(Aug 5, 2022)

    :star: Features

    Actions:

    • add entrostat/[email protected] (https://github.com/krzema12/github-actions-kotlin-dsl/commit/b77d03e7717ea5ee3da40d210125228452bb6257) - thanks @LeoColman!
    • update actions/stale@v5 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/180a93a67a49b6082085ae71abd82ee49083f4e8)
    • update ruby/setup-ruby@v1 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/211c5ba6b197154e49349ce8e779bb4e83238bb6)
    • update appleboy/ssh-action to v0.1.5 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/f072d8dbe62e2d45ee9d1de265a534f674981455)
    • use v1 major version for supercharge/mongodb-githubaction (https://github.com/krzema12/github-actions-kotlin-dsl/commit/d4ee5e9bf5c11bf9192eabfbad0a759e830f1677)
    • update actions/setup-python@v4 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/8a912c9b2a8e7cd9cc49c4a8f715fbca0347db76)
    • update aws-actions/configure-aws-credentials@v1(https://github.com/krzema12/github-actions-kotlin-dsl/commit/b6f9e68aebbd9474782fc43fc67f68bbdb12776c)
    • update aws-actions/amazon-ecr-login@v1 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/69fde5f1f702b7f90d9be11b967d66eee795cce1)
    • update elgohr/Publish-Docker-Github-Action@v4 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/ee1c2e6ea83a9492d39cfe853f3684702ca4e522)

    :hammer_and_wrench: Fixes

    None.

    :bomb: Breaking changes

    None.

    Also, thanks @aSemy and @Goooler for improvements in the build system config!


    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.23.0...v0.24.0

    Source code(tar.gz)
    Source code(zip)
  • v0.23.0(Jul 27, 2022)

    :star: Features

    • [#217] add timeout to steps (https://github.com/krzema12/github-actions-kotlin-dsl/commit/0aca5303cd397976b9fb21e8742acdfcbaac14fb)
    • [#286] add shell customization to run command step (https://github.com/krzema12/github-actions-kotlin-dsl/commit/44b1bf3228f6c13aeacd7e868896bb3fadf2d9a2)
    • [#360] add working directory customization to run command step (https://github.com/krzema12/github-actions-kotlin-dsl/commit/4ebe7a6e0c773cc748f9f6ed5ff97ac8bfa0c142)
    • add ReactiveCircus/android-emulator-runner@v2 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/4df2da55131da4cb15053c0799b9f461339f0690) (thanks @LeoColman!)
    • update docker/build-push-action@v3 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/bcb69c3eb89742e6f1da2a8a305318e88c75e704)
    • update JamesIves/github-pages-deploy-action@v4 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/1949ded7630bc08147ff157da2753532a8f2b42c)
    • update krzema12/github-action-typing@v0 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/d2aa75120da3aebe1b5634114e39b226acd23073)
    • update gautamkrishnar/blog-post-workflow@v1 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/de5b902df171e086dddc6a18c4d372ea378e392f)
    • update ruby/setup-ruby@v1 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/80887386d3d46bf2ea6e14b6313874d437047419)

    :hammer_and_wrench: Fixes

    • [#298] allow arbitrarily complex custom arguments (https://github.com/krzema12/github-actions-kotlin-dsl/commit/727a55aabfabbe4aac8a5a8c0b282f4b9fc4291f)
    • don't produce empty lines for multiline commands (https://github.com/krzema12/github-actions-kotlin-dsl/commit/7e0b1f0721a08849b7c896866648e0ab2e81ef9c)

    :bomb: Breaking changes

    • the fix for #298 requires you to get rid of wrappers like BooleanCustomValue or ListCustomValue. See the docs for examples

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.22.0...v0.23.0

    Source code(tar.gz)
    Source code(zip)
  • v0.22.0(Jul 18, 2022)

  • v0.21.0(Jul 2, 2022)

    ⭐ Highlights

    💣 Breaking changes

    • moved expr(...) to expression package (https://github.com/krzema12/github-actions-kotlin-dsl/commit/3c0f984f9241c2d2fd47dda4baa5a247c2406d82)

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.20.0...v0.21.0

    Source code(tar.gz)
    Source code(zip)
  • v0.20.0(Jun 24, 2022)

    Kudos to @Vampire, @aSemy, @jmfayard for their contributions! :smile:

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.19.0...v0.20.0

    Source code(tar.gz)
    Source code(zip)
  • v0.19.0(Jun 14, 2022)

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.18.0...v0.19.0

    Kudos to @NikkyAI for cooperating on https://github.com/krzema12/github-actions-kotlin-dsl/commit/f88e648b953732561658e2350fc0f242ebf82fd4!

    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Jun 10, 2022)

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.17.0...v0.18.0

    :bomb: Breaking changes

    • https://github.com/krzema12/github-actions-kotlin-dsl/commit/9245ae5dcdcbd590c02106bdcb1c566e71825e98 - it's no longer necessary to specify the full path to the target file. It can be now inferred from sourceFile. If desired, it's possible to override just the name. Kudos to @NikkyAI for cooperation on it!
    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(May 27, 2022)

  • v0.16.0(May 13, 2022)

  • v0.15.0(Apr 29, 2022)

  • v0.14.0(Apr 24, 2022)

    Thanks @jmfayard and @aSemy for your contributions!

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.13.0...v0.14.0

    Source code(tar.gz)
    Source code(zip)
  • v0.13.0(Apr 14, 2022)

    :star: Features

    Wrappers

    • add ad-m/[email protected]
    • add anmol098/waka-readme-stats@v4
    • add anothrNick/[email protected]
    • add appleboy/[email protected]
    • add appleboy/[email protected]
    • add appleboy/[email protected]
    • add aws-actions/amazon-ecr-login@v1
    • add aws-actions/amazon-ecs-deploy-task-definition@v1
    • add aws-actions/amazon-ecs-render-task-definition@v1
    • add aws-actions/configure-aws-credentials@v1
    • add bahmutov/[email protected]
    • add cachix/install-nix-action@v17
    • add calibreapp/[email protected]
    • add codecov/codecov-action@v3
    • add actions/cache@v3, deprecate v2
    • add actions/download-artifact@v3, deprecate v2
    • add actions/setup-java@v3, deprecate v2
    • add actions/setup-node@v3, deprecate v2
    • add actions/setup-python@v3, deprecate v2
    • add actions/upload-artifact@v3, deprecate v2
    • add EndBug/add-and-commit@v9, deprecate v8
    • add 'force' input for JamesIves/github-pages-deploy-action@v4 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/195cfbb8c71c893ae0899cb95aefe6859655c974)
    • add 'export_environment_variables' input for google-github-actions/auth@v0 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/33a5085ac7a65885bfef2d18895f6c4675e74903)

    Docs

    • add a list of supported actions (https://github.com/krzema12/github-actions-kotlin-dsl/commit/462abd19a80ceb4aea35622e41f6bc0ea3de9886, https://github.com/krzema12/github-actions-kotlin-dsl/commit/03ff12edd98469fc279790c217c41713a88db24e) (together with @jmfayard). You can see it here: https://krzema12.github.io/github-actions-kotlin-dsl/supported-actions/

    Wrapper generator

    • add a job for suggesting newer available action versions (https://github.com/krzema12/github-actions-kotlin-dsl/commit/2ea9bf56b881d85b3a51378ae1a2500da2351adb, https://github.com/krzema12/github-actions-kotlin-dsl/commit/a3a24a3c1e05a68544d42cb4f908050af6787203) (thanks @jmfayard!)

    :hammer_and_wrench: Fixes

    Wrapper generator

    • rename obsolete ListOfStringsTyping to ListOfTypings (https://github.com/krzema12/github-actions-kotlin-dsl/commit/01c6c318ce27e4e376c995c23eb4bf143f081456) (thanks @jmfayard!)

    :bomb: Breaking changes

    • version madhead/semver-utils by major version (https://github.com/krzema12/github-actions-kotlin-dsl/commit/d9b91c30e6d95489f03b59e14bb16b6d247a9f54) (thanks @jmfayard!)

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.12.0...v0.13.0

    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Mar 30, 2022)

    :star: Features

    • [#159] add script generator (thanks @jmfayard!)
    • [#145] make step name optional
    • add all remaining triggers (thanks @jmfayard!)
    • [#135] configure nightly builds (jitpack) (thanks @NikkyAI!)

    :hammer_and_wrench: Fixes

    • [#153] docs: fix formatting of 'Getting started' (thanks @polarene!)
    • [#152] use Job.name as ID and add Job.name (thanks @NikkyAI!)

    :bomb: Breaking changes

    • [#152] use Job.name as ID and add Job.name (https://github.com/krzema12/github-actions-kotlin-dsl/commit/1fbf7fb0a88df2d92412b90e559bf9d39d5d9cd1) - your scripts will stop compiling. All you need to do is rename name to id for jobs

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.11.0...v0.12.0

    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Mar 22, 2022)

    :star: Features

    • Publish documentation, available at https://krzema12.github.io/github-actions-kotlin-dsl/
    • Allow setting arbitrary workflow/job/step attribute (https://github.com/krzema12/github-actions-kotlin-dsl/commit/89047e798ffae8f221791f08d3971b8e7278dedb) (thanks @jmfayard!)
    • Add CustomAction for adding untyped wrapper (https://github.com/krzema12/github-actions-kotlin-dsl/commit/e050db40e33925902d45880192660a5f2b6a1dc6) (thanks @jmfayard!)
    • Add Job.timeoutMinutes (https://github.com/krzema12/github-actions-kotlin-dsl/commit/c2c6f387e58b794ddf64300b2f6f65bbf73afdcb) (thanks @NikkyAI!)
    • Don't install Kotlin for consistency check (https://github.com/krzema12/github-actions-kotlin-dsl/commit/afdb0b9c7bc7a025ea5e91da88aede1b112c7da7)

    New/changed wrappers:

    • add google-github-actions/auth@v0 (thanks @NikkyAI!)
    • add google-github-actions/setup-gcloud@v0 (thanks @NikkyAI!)
    • update docker/build-push-action@v2

    Wrapper generator:

    • Add @Deprecated to wrappers for actions of older versions (https://github.com/krzema12/github-actions-kotlin-dsl/commit/e312b6c40b93ecf26054e8c1114008d8225cfeae) (thanks @jmfayard!)
    • Allow passing custom inputs (https://github.com/krzema12/github-actions-kotlin-dsl/commit/a2fc1809334d98b5cc5df36bace7b0aa5f0c1faf) (thanks @jmfayard!)
    • Allow passing custom versions (https://github.com/krzema12/github-actions-kotlin-dsl/commit/3a8f2c4f1571383c3ae40442272204d996174111)

    :hammer_and_wrench: Fixes

    • validate job name when creating Job (https://github.com/krzema12/github-actions-kotlin-dsl/commit/ef5022ed99e8f8b88cb07741ffbc60a2bdccdcbb)

    :bomb: Breaking changes

    None.


    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.10.0...v0.11.0

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Mar 9, 2022)

    :star: Features

    • Add git-based consistency check for writeToFile() (https://github.com/krzema12/github-actions-kotlin-dsl/commit/59c92a53c5748441637b9e24df20e0e102e032f7) (thanks @NikkyAI!)
    • Use actions/checkout@v3 in consistency check (https://github.com/krzema12/github-actions-kotlin-dsl/commit/8c987101e3560b25ee60c9fc783c74d7680cc93b)

    New wrappers:

    • actions/checkout@v3
    • 10up/[email protected] (thanks @jmfayard!)
    • 8398a7/action-slack@v3 (thanks @jmfayard!)
    • Azure/docker-login@v1 (thanks @jmfayard!)
    • Azure/login@v1 (thanks @jmfayard!)
    • Azure/webapps-deploy@v2 (thanks @jmfayard!)
    • Borales/[email protected] (thanks @jmfayard!)
    • GoogleCloudPlatform/github-actions@v0 (thanks @jmfayard!)
    • JamesIves/github-pages-deploy-action@v4 (thanks @jmfayard!)
    • JasonEtco/create-an-issue@v2 (thanks @jmfayard!)
    • SamKirkland/[email protected] (thanks @jmfayard!)
    • actions/create-release@v1 (thanks @jmfayard!)
    • actions/first-interaction@v1 (thanks @jmfayard!)
    • actions/github-script@v6 (thanks @jmfayard!)
    • actions/labeler@v4 (thanks @jmfayard!)
    • actions/setup-dotnet@v2 (thanks @jmfayard!)
    • actions/setup-go@v3 (thanks @jmfayard!)
    • actions/stale@v5 (thanks @jmfayard!)
    • actions-rs/audit-check@v1 (thanks @jmfayard!)
    • actions-rs/cargo@v1 (thanks @jmfayard!)
    • actions-rs/clippy-check@v1 (thanks @jmfayard!)
    • actions-rs/toolchain@v1 (thanks @jmfayard!)

    Wrapper generator:

    • Make list typing work with more than strings + allow customizing enum names (https://github.com/krzema12/github-actions-kotlin-dsl/commit/ffd8e30bea0390310e4b54dddebf91cad5d19aca) (thanks @jmfayard!)

    :hammer_and_wrench: Fixes

    None.

    :bomb: Breaking changes

    • regarding "Add git-based consistency check for writeToFile() (https://github.com/krzema12/github-actions-kotlin-dsl/commit/59c92a53c5748441637b9e24df20e0e102e032f7)", it will now produce the consistency check for writeToFile(). Depending on your file layout, you may need to adjust your workflows, either by making use of the new git-based consistency check, or opting out of the consistency check by passing addConsistencyCheck = false

    Full Changelog: https://github.com/krzema12/github-actions-kotlin-dsl/compare/v0.9.0...v0.10.0

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Feb 26, 2022)

    :star: Features

    • [#56] Add unique step ID
    • [#56] Add API to use step outputs (see usage in https://github.com/krzema12/github-actions-kotlin-dsl/commit/0009280e1eb430f9587be4e592f437e768530f8f)
    • [#56] Add a helper for defining GitHub expressions (https://github.com/krzema12/github-actions-kotlin-dsl/commit/4648000018b623a390fe1f91760e287d1739affa)
    • Add @Deprecated annotations for deprecated action inputs (https://github.com/krzema12/github-actions-kotlin-dsl/commit/f9c43c16c52861fa4bb0074d4e73b9afa83bf4be) (thanks @jmfayard!)
    • Add PullRequest.types (https://github.com/krzema12/github-actions-kotlin-dsl/commit/0908f390fafe50e6d68e5c1a74e3b128929de7e4) (thanks @jmfayard!)
    • [#1] Fail if no jobs, triggers or steps are defined
    • [#1] Fail if duplicate job names are used
    • [#1] Fail if mutually exclusive properties are defined in Push, PullRequest, PullRequestTarget
    • Add wrappers for actions:
      • actions/cache@v2
      • docker/login-action@v1
      • docker/setup-buildx-action@v1
      • docker/build-push-action@v2
      • nobrayner/discord-webhook@v1

    :hammer_and_wrench: Fixes

    • Unify order of arguments in Push trigger (https://github.com/krzema12/github-actions-kotlin-dsl/commit/2cb43180a0c6c38432dd6db6dd56ef429389cd42)

    :bomb: Breaking changes

    • Unify order of arguments in Push trigger (https://github.com/krzema12/github-actions-kotlin-dsl/commit/2cb43180a0c6c38432dd6db6dd56ef429389cd42) - it's a breaking change only if you use positional arguments, not named arguments. It's generally recommended to use named arguments for the sake of better readability
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Feb 16, 2022)

    :star: Features

    • Add to triggers: paths paths_ignore pull_request_target (https://github.com/krzema12/github-actions-kotlin-dsl/commit/b3c28a513dcf15fe099d9f9091a2488eacbdadd2) (thanks @jmfayard!)
    • [#64] Implement WorkflowDispatch inputs (thanks @jmfayard!)
    • Validate job name against illegal characters (https://github.com/krzema12/github-actions-kotlin-dsl/commit/5b51ff812942ce08f5fb5b266c10c1a1e22fb402) (thanks @jmfayard!)
    • Generate wrapper for AkhileshNS/heroku-deploy@v3 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/840ef9e36cdded38c1ab084f7811e03388d9c5e8) (thanks @jmfayard!)
    • Generate wrapper for actions/setup-python@v2 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/3e172ea3fd208899448b98366cfaf2a88a74949f) (thanks @jmfayard!)

    :hammer_and_wrench: Fixes

    • Allow specifying any string for "push" input in EndBug/add-and-commit@v2 (https://github.com/krzema12/github-actions-kotlin-dsl/commit/6e6f9a124ccfcbde5c01f5ac01f73a4435384bcb) (thanks @jmfayard!)

    :bomb: Breaking changes

    • the bugfix for "Allow specifying any string for "push" input in EndBug/add-and-commit@v2", the type of push field is now String
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Feb 14, 2022)

    :star: Features

    • #71: Generate action wrappers code From now on, you won't find hand-crafted action wrappers in the library - they are now generated based on action metadata file (action.yml). It makes adding new wrappers much simpler and boilerplate-free. From users' perspective, it provides KDoc documentation for all inputs, as provided by actions' authors. It also unlocks great possibilities, as e.g. changes to actions API will be easy to apply in batch to all wrappers (e. g. action outputs handling). Kudos to @jmfayard for supporting this effort, especially for preparing a PoC and showing me how to use kotlinpoet (Kotlin generation library) :)
    • Add wrapper for actions/setup-node@v2

    :hammer_and_wrench: Fixes

    • #70: Incorrect YAML when value starts with *, [ or !

    :bomb: Breaking changes

    • #71: Because the code is now generated, several breaking changes occurred. From what I remember when working on code generation:
      • CreateBranchV2 is now ActionCreateBranchV2 - the name is inferred straight from the action name (https://github.com/krzema12/github-actions-kotlin-dsl/commit/4a2f2ea5a6b8b6ff1cd4cd1a3e1cdace27a10066)
      • in CheckoutV2, FetchDepth's concrete value is now passed with Value class instead of Quantity (https://github.com/krzema12/github-actions-kotlin-dsl/commit/a8bcdf1b93ca9ccd0a1876ccc0a0e655ed41cd79)
      • minor inconvenience: the order of arguments rendered to YAML for various actions may be different (e.g. for actions/setup-java@v2: https://github.com/krzema12/github-actions-kotlin-dsl/commit/9e4b554fdc1d28a938abb02f163a726dadd6b199)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Feb 4, 2022)

    :star: Features

    None.

    :hammer_and_wrench: Fixes

    • #67: Consistency check job uses backward slashes when YAML generated on Windows

    :bomb: Breaking changes

    None.

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Feb 2, 2022)

    :star: Features

    • #53: Implement filters (branches, tags) for push and pull_request triggers
    • #55: Implement environment variables for workflows, jobs and steps
    • #57: Allow conditions for jobs
    • https://github.com/krzema12/github-actions-kotlin-dsl/commit/594ce1668ff992b5231b79b9be0dbc4da8e8d051: Add type-safe Cron() declaration (thanks @jmfayard!)

    :hammer_and_wrench: Fixes

    • #52: Fix rendering of multiline action arguments

    :bomb: Breaking changes

    • #53: PullRequest, Push and WorkflowDispatch are now classes, not objects. It means that using them as triggers requires syntax e.g. PullRequest(). It's done to be able to add parameters to them, e.g. filters, like mentioned in the features section. The triggers are now also in triggers package, not an inner class of Trigger (change e.g. ...Trigger.Push to ...triggers.Push in your imports)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jan 28, 2022)

    :star: Features

    • #43: Add wrappers for madhead/* actions. Thanks for contributing @madhead!
    • #37: Add wrapper for actions/setup-java
    • #40: Add wrapper for gradle-update/update-gradle-wrapper-action
    • #39: Add wrapper for gradle/wrapper-validation-action
    • #38: Add wrapper for gradle/gradle-build-action
    • #42: Add pull request trigger
    • #41: Add schedule trigger

    :hammer_and_wrench: Fixes

    • #36: Fix multiline commands with leading pipes
    • #50: Don't overwrite job dependencies with consistency job
    • #47: Add missing parameters for actions/CheckoutV2

    :bomb: Breaking changes

    • #48: Custom actions API: change constructor to accept owner, name and version as separate strings
    • actions/UploadArtifactV2 and actions/DownloadArtifactV2: rename artifact parameter to name (https://github.com/krzema12/github-actions-kotlin-dsl/commit/b23f671e7f02668d4ae61fe9863a0ba05025429e, https://github.com/krzema12/github-actions-kotlin-dsl/commit/8f12c7f2d4258eb85863305094aaef75901f2ee3)
    • actions/CheckoutV2: Put FetchDepth type inside the wrapper class (https://github.com/krzema12/github-actions-kotlin-dsl/commit/b152a2b91c7578103302018f8070ad6a77cf506c). It's enough to adjust the import
    Source code(tar.gz)
    Source code(zip)
Owner
Piotr Krzemiński
Piotr Krzemiński
Kotlin-client-dsl - A kotlin-based dsl project for a (Client) -> (Plugin) styled program

kotlin-client-dsl a kotlin-based dsl project for a (Client) -> (Plugin) styled p

jackson 3 Dec 10, 2022
A Template for a Github Actions Pipeline for building and publishing Gradle-JVM Applications

github-actions-cd-template-jvm A Template for a Github Actions Pipeline for building and publishing Gradle-JVM Applications It build a executable shad

Raphael Panic 0 Dec 5, 2021
Godot's AdMob Plugin for Android (3.2.2+) using GitHub Actions for CI/CD. Working on Standard and Mono Godot versions.

Godot AdMob Android A Godot's plugin for Android of AdMob. About • Installation • Docs • Downloads About This repository is for a Godot Engine Plugin

Poing Studios 148 Jan 8, 2023
📌 replaces mutable tags or branch names by commit shas in your GitHub actions

?? pin-github-actions Using a branch name or tag name as a version for a GitHub action is dangerous as neither branches nor tags are immutable. (See G

Martin Bonnin 10 Jul 21, 2022
Unofficial Actions on Google SDK for Kotlin and Java

Actions On Google Client Library This is a port of the official Node.js SDK to Kotlin. This can also be used from Java and any JVM language. Quick Fac

Ticketmaster® & Live Nation Entertainment® 118 Oct 3, 2022
Actions are things that run, with parameters. Serves as a common dependency for a variety of Cepi extensions.

Actions Actions that take in customizable paramaters, an optional target, and do things. Installation Download the jar from Releases OR compile it you

Cepi 1 Jan 9, 2022
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

MaterialDrawerKt Create navigation drawers in your Activities and Fragments without having to write any XML, in pure Kotlin code, with access to all t

Márton Braun 517 Nov 19, 2022
{ } Declarative Kotlin DSL for choreographing Android transitions

Transition X Kotlin DSL for choreographing Android Transitions TransitionManager makes it easy to animate simple changes to layout without needing to

Arunkumar 520 Dec 16, 2022
Kotlin Dsl for Android RecyclerView

KRecyclerDsl Kotlin Dsl for Android RecyclerView Exemple Sample project recyclerView.adapter = dataClassAdapter<MyView, MyDataClass>(R.layout.my_view,

Thomas Girard 14 Mar 31, 2019
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
Nice and simple DSL for Espresso in Kotlin

Kakao Nice and simple DSL for Espresso in Kotlin Introduction At Agoda, we have more than 1000 automated tests to ensure our application's quality and

Agoda Company Pte Ltd. 1.1k Nov 22, 2022
DSL for constructing the drawables in Kotlin instead of in XML

Android Drawable Kotlin DSL DSL for constructing the drawables in Kotlin instead of in XML Examples Shape drawables <?xml version="1.0" encoding="utf-

Infotech Group 178 Dec 4, 2022
Lightweight Kotlin DSL dependency injection library

Warehouse DSL Warehouse is a lightweight Kotlin DSL dependency injection library this library has an extremely faster learning curve and more human fr

Osama Raddad 18 Jul 17, 2022
Code generation of Kotlin DSL for AWS CDK

Code generation of Kotlin DSL for AWS CDK

Semantic Configuration 5 Dec 24, 2022
Regular expression DSL on Kotlin

Examples Characters Construct Equivalent Matches x character(Char) The character x \\ character('\\') The backslash character \0n octal(OctalValue(7))

null 1 Oct 7, 2021
Kotlin Object Notation - Lightweight DSL to build fluid JSON trees

Kotlin Object Notation Lightweight kotlin MPP DSL for building JSON trees Setup Just drop the dependency in your commonMain sourceSet kotlin { sourc

Martynas Petuška 43 Dec 10, 2022
Kotlin parser library with an easy-to-use DSL

Pratt Library for parsing expressions and a beautiful Kotlin DSL Just define your operators and operands with the Kotlin DSL and the parser is ready!

furetur 9 Oct 17, 2022
Kotlin DSL for Junit5

Kupiter is Kotlin DSL for Junit5. Current API is only for dynamic tests. Get it repositories { maven { url 'https://jitpack.io' } } dependencies

Andrius Semionovas 14 Oct 3, 2022
Kotlin-dsl-sample - Preferences project on android

kotlin-dsl-example Sample preferences project on android. How to use val

null 1 Dec 30, 2021