Crates.io | flowcrafter |
lib.rs | flowcrafter |
version | 0.3.0 |
source | src |
created_at | 2023-06-01 18:36:05.878256 |
updated_at | 2023-12-21 07:28:48.073594 |
description | Create and manage workflows for GitHub Actions |
homepage | |
repository | https://github.com/jdno/flowcrafter |
max_upload_size | |
id | 880015 |
size | 159,919 |
FlowCrafter is a command-line tool to create and manage workflows for GitHub Actions.
FlowCrafter can be installed using cargo
. Running the following command will
download the latest version of FlowCrafter, compile it, and make it available as
a command-line tool.
cargo install flowcrafter
After the installation, flowcrafter
is available as a command in the terminal:
flowcrafter --help
Using FlowCrafter consists of three different steps:
FlowCrafter uses templates stored on GitHub to create workflows and jobs. These are YAML files that follow a few conventions:
rust
).workflow.yml
that defines the
workflow (e.g. rust/workflow.yml
).rust/lint.yml
).The workflow template sets the top-level configuration for the workflow. It can also contain a list of jobs that should always be part of the workflow.
The workflow template is always named workflow.yml
.
---
name: Rust
"on":
push:
branches:
- main
pull_request:
jobs:
run-always:
name: Always include this job
runs-on: ubuntu-latest
steps:
- run: echo "This will always be included"
Jobs are defined in individual YAML files within the workflow folder. Each represents a single job that can be included in a workflow.
style:
name: Check style
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Rustfmt
run: cargo fmt --all -- --check
FlowCrafter manages the workflows for a repository on GitHub. After cloning the repository to your local machine, open a terminal, change into its directory, and then generate a configuration file for FlowCrafter:
flowcrafter init -r <owner>/<repo>
This will create a file called .flowcrafter.yml
in the .github
directory and
configure the repository owner/repo
as the source for workflow and job
templates.
With FlowCrafter initialized and templates on GitHub, you can now create a workflow with FlowCrafter:
flowcrafter create -w <workflow> -j <job> -j <job>
For example, given a repository with the following templates:
rust
├── lint.yml
├── test.yml
└── workflow.yml
You can create a workflow for Rust with the following command:
flowcrafter create -w rust -j lint -j test
This will create the file .github/workflows/rust.yml
and merge workflow.yml
and the two jobs lint.yml
and test.yml
into it.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.