{"id":15060871,"url":"https://github.com/fornever/generaptor","last_synced_at":"2025-04-10T06:12:37.247Z","repository":{"id":222216133,"uuid":"756550674","full_name":"ForNeVeR/Generaptor","owner":"ForNeVeR","description":"GitHub Actions configuration generator","archived":false,"fork":false,"pushed_at":"2024-11-20T15:41:56.000Z","size":66,"stargazers_count":46,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T07:22:16.431Z","etag":null,"topics":["ci","dotnet","fsharp","github-actions"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ForNeVeR.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-12T21:27:19.000Z","updated_at":"2024-11-20T15:41:58.000Z","dependencies_parsed_at":"2024-03-29T22:23:39.035Z","dependency_job_id":"2575852a-67aa-480b-b387-4549bebff635","html_url":"https://github.com/ForNeVeR/Generaptor","commit_stats":null,"previous_names":["fornever/generaptor"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FGeneraptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FGeneraptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FGeneraptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FGeneraptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ForNeVeR","download_url":"https://codeload.github.com/ForNeVeR/Generaptor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","dotnet","fsharp","github-actions"],"created_at":"2024-09-24T23:05:39.018Z","updated_at":"2025-04-10T06:12:37.226Z","avatar_url":"https://github.com/ForNeVeR.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"🦖 Generaptor [![Status Ventis][status-ventis]][andivionian-status-classifier]\n============\n\nGeneraptor helps you to maintain GitHub actions for your project. It can generate the YAML files, according to the specification defined in your code.\n\nNow you can manage your action definitions via NuGet packages, and port the whole workflows between repositories.\nA bit of strong typing will also help to avoid mistakes!\n\nNuGet package links:\n- [![Generaptor][nuget.badge.generaptor]][nuget.generaptor]\n- [![Generaptor.Library][nuget.badge.generaptor-library]][nuget.generaptor-library]\n\n\nShowcase\n--------\nConsider this F# program (this is actually used in this very repository):\n```fsharp\nlet mainBranch = \"main\"\nlet images = [\n    \"macos-12\"\n    \"ubuntu-22.04\"\n    \"windows-2022\"\n]\n\nlet workflows = [\n    workflow \"main\" [\n        name \"Main\"\n        onPushTo mainBranch\n        onPullRequestTo mainBranch\n        onSchedule(day = DayOfWeek.Saturday)\n        onWorkflowDispatch\n        job \"main\" [\n            checkout\n            yield! dotNetBuildAndTest()\n        ] |\u003e addMatrix images\n    ]\n]\n\n[\u003cEntryPoint\u003e]\nlet main(args: string[]): int =\n    EntryPoint.Process args workflows\n```\n\n(See the actual example with all the imports in [the main program file][example.main].)\n\nIt will generate the following GitHub action configuration:\n```yaml\nname: Main\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n  schedule:\n    - cron: 0 0 * * 6\n  workflow_dispatch:\njobs:\n  main:\n    strategy:\n      matrix:\n        image:\n          - macos-12\n          - ubuntu-22.04\n          - windows-2022\n      fail-fast: false\n    runs-on: ${{ matrix.image }}\n    env:\n      DOTNET_CLI_TELEMETRY_OPTOUT: 1\n      DOTNET_NOLOGO: 1\n      NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages\n    steps:\n      - uses: actions/checkout@v4\n      - name: Set up .NET SDK\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: 8.0.x\n      - name: NuGet cache\n        uses: actions/cache@v4\n        with:\n          key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.fsproj') }}\n          path: ${{ env.NUGET_PACKAGES }}\n      - name: Build\n        run: dotnet build\n      - name: Test\n        run: dotnet test\n        timeout-minutes: 10\n```\n\nHow to Use\n----------\nWe recommend two main modes of execution for Generaptor: from a .NET project and from a script file.\n\n### .NET Project\nThis integration is useful if you already have a solution file, and it's more convenient for you to have your infrastructure in a new project in that solution. Follow this instruction.\n\n1. Create a new F# project in your solution. The location doesn't matter, but we recommend calling it `GitHubActions` and put inside the `Infrastructure` solution folder, to not mix it with the main code.\n2. Install the `Generaptor.Library` NuGet package.\n3. Call the `Generaptor.EntryPoint.Process` method with the arguments passed to the `main` function and the list of workflows you want to generate.\n4. Run the program from the repository root folder in your shell, for example:\n   ```console\n   $ cd \u003cyour-repository-root-folder\u003e\n   $ dotnet run --project ./Infrastructure/GitHubActions\n   ```\n\n   When called with empty arguments of with command `generate`, it will (re-)generate the workflow files in `.github/workflows` folder, relatively to the current directory.\n\n### Script File\nAs an alternative execution mode, we also support execution from an F# script file.\n\nPut your code (see an example below) into an `.fsx` file (say, `github-actions.fsx`), and run it with the following shell command:\n\n```console\n$ dotnet fsi github-actions.fsx [optional parameters may go here]\n```\n\nThe script file example:\n```fsharp\n#r \"nuget: Generaptor.Library, 1.1.0\"\nopen System\n\nopen Generaptor\nopen Generaptor.GitHubActions\nopen type Generaptor.GitHubActions.Commands\nopen type Generaptor.Library.Actions\nopen type Generaptor.Library.Patterns\n\nlet mainBranch = \"main\"\nlet images = [\n    \"macos-12\"\n    \"ubuntu-22.04\"\n    \"windows-2022\"\n]\n\nlet workflows = [\n    workflow \"main\" [\n        name \"Main\"\n        onPushTo mainBranch\n        onPullRequestTo mainBranch\n        onSchedule(day = DayOfWeek.Saturday)\n        onWorkflowDispatch\n        job \"main\" [\n            checkout\n            yield! dotNetBuildAndTest()\n        ] |\u003e addMatrix images\n    ]\n]\n\nEntryPoint.Process fsi.CommandLineArgs workflows\n```\n\n### Available Features\nFor basic GitHub Action support (workflow and step DSL), see [the `GitHubActions.fs` file][api.github-actions]. The basic actions are in the main **Generaptor** package.\n\nFor advanced patterns and action commands ready for use, see [Actions][api.library-actions] and [Patterns][api.library-patterns] files. These are in the auxiliary **Generaptor.Library** package.\n\nFeel free to create your own actions and patterns, and either send a PR to this repository, or publish your own NuGet packages!\n\nDocumentation\n-------------\n- [Changelog][docs.changelog]\n- [License (MIT)][docs.license]\n- [Maintainer Guide][docs.maintainer-guide]\n- [Code of Conduct (adapted from the Contributor Covenant)][docs.code-of-conduct]\n\nVersioning Notes\n----------------\nThis project's versioning follows the [Semantic Versioning 2.0.0][semver] specification.\n\nWhen considering compatible changes, we currently only consider the source compatibility with the user scripts, not binary compatibility. This may be subject to change in the future.\n\n[andivionian-status-classifier]: https://andivionian.fornever.me/v1/#status-ventis-\n[api.github-actions]: ./Generaptor/GitHubActions.fs\n[api.library-actions]: ./Generaptor.Library/Actions.fs\n[api.library-patterns]: ./Generaptor.Library/Patterns.fs\n[docs.changelog]: ./CHANGELOG.md\n[docs.code-of-conduct]: ./CODE_OF_CONDUCT.md\n[docs.license]: ./LICENSE.md\n[docs.maintainer-guide]: ./MAINTAINERSHIP.md\n[example.main]: ./Infrastructure/GitHubActions/Program.fs\n[nuget.badge.generaptor-library]: https://img.shields.io/nuget/v/Generaptor.Library?label=Generaptor.Library\n[nuget.badge.generaptor]: https://img.shields.io/nuget/v/Generaptor?label=Generaptor\n[nuget.generaptor-library]: https://www.nuget.org/packages/Generaptor.Library\n[nuget.generaptor]: https://www.nuget.org/packages/Generaptor\n[semver]: https://semver.org/spec/v2.0.0.html\n[status-ventis]: https://img.shields.io/badge/status-ventis-yellow.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fgeneraptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffornever%2Fgeneraptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fgeneraptor/lists"}