8 unstable releases (3 breaking)

new 0.4.1 Nov 16, 2024
0.4.0 Nov 13, 2024
0.3.0 Nov 11, 2024
0.2.1 Nov 11, 2024
0.1.2 Nov 8, 2024

#283 in Development tools

Download history 133/week @ 2024-11-03 748/week @ 2024-11-10

883 downloads per month
Used in 2 crates

Apache-2.0

78KB
1.5K SLoC

🦀 Rust GitHub Actions Workflow 🚀

Rust Build Status License: MIT Crates.io Contributors GitHub forks Stars Issues

🧑‍💻 What is Rust GitHub Workflows?

Rust GitHub Workflows is a library that allows developers to write GitHub Actions in Rust. It empowers you to automate, manage, and improve your CI/CD pipelines in a type-safe manner.

GitHub Actions is powerful, but writing workflows can sometimes feel repetitive, tricky and frustrating with no strict type-checking. That's where Rust GitHub Workflows steps in! 🦾

  • 🔥 Rust-Powered: Leverage the type-safety of Rust for writing workflows.
  • 📦 Crate-friendly: Build reusable workflows and publish them as crates.

📦 Installation

To use Rust GitHub Workflows in your project, add it to your Cargo.toml:

[build-dependencies]
gh-workflow = "1"

Then you can start creating GitHub Actions in your build.rs.

👷 Usage

  • Simply add a build.rs file to your project's root directory.

  • Add the following code to generate the GitHub Actions workflow:

    use rust_gh_workflows::*;
    
    fn main() {
        // Create a basic workflow
        let workflow = Workflow::setup_rust();
    
        // Generate the ci.yml
        workflow.generate().unwrap();
    }
    

    To view a fully functional example, check out the build.rs of this project.

  • Run cargo build to generate the GitHub Actions workflow.

Workspace

  • The workspace directory contains the gh-workflow-gen crate, which generates the workflow.

🛠️ Roadmap

  • Support for Automated Cargo Releases
  • Improve Type Safety of Nightly Builds
  • Updates Rust Docs using Github's official documentation for the API

💡 Why Rust?

Rust provides the perfect combination of speed, safety, and flexibility, making it an ideal choice for writing GitHub Actions. With Rust, you get strong typing, memory safety, and the ability to reuse existing code, which can make your automation scripts more robust and maintainable.

📄 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

🙌 Contributors

A big thank you to all the contributors who helped make this project a success! 🙏

Contributors

🌟 Show Your Support

If you like this project, please consider giving it a ⭐ on GitHub and share it with the community!

🔗 Inspiration

This project was inspired by the following repositories:


Happy automating with Rust! 🦀❤️

Dependencies

~2.6–3.5MB
~77K SLoC