This is a copy of the Github readme.
Find the original on https://github.com/automation-tasks-rs/cargo_auto_template_new_auto_for_cli

automation_tasks_rs

Automation tasks coded in Rust language for the workflow of Rust projects
version: 1.0.0 date: 2024-05-04 author: Bestia.dev repository: GitHub

maintained ready-for-use rustlang automation workflow License

logo
This is part of the automation_tasks_rs project

The sub-project automation_tasks_rs

In this sub-project automation_tasks_rs, you can write tasks that you need when compiling or managing your Rust project.
The simple cargo build and cargo build --release are sometimes not enough. We need to copy some files, to prepare some environment. It is nice to have all the tasks in one place with a sort order that new users can easily follow.
It is a Rust project, so you don't have to learn another strange language for automation. You can develop this sub-project in VSCode:

code automation--tasks--rs

Don't put any secrets like passwords, passphrases, or tokens here, because this helper project is pushed to the remote repository together with the main Rust project.

cargo-auto

This helper project is used in combination with the program cargo-auto. Install it with:

cargo install cargo-auto

You can use also the cargo bash completion program:

cargo install dev_bestia_cargo_completion

In the main project folder (where the Cargo.toml file is) run

cargo auto

You will get a list of possible tasks with descriptions like cargo auto build, cargo auto release, cargo auto doc,...

Already prepared tasks

I prepared some tasks that I often use. I use my own library crate for often-used functions cargo_auto_lib. You can use this tasks or you can modify them or you can completely delete them.

You can write any task you need. You have all the power of the Rust language under your fingertips. You can use or write a library crate for some specific tasks you need.

Secrets

Sometimes we need secrets in the development workflow. For example the secret access token for GitHub or crates.io. We must be careful with secrets.

I use my knowledge of SSH private keys to store secrets in my ~/.ssh folder. They are protected by my private key, that is protected by a passphrase that is easy to remember. This secrets never leave the source code inside automation--tasks--rs. They never go to an obscure library crate that can turn malevolent from one update to the other.

In the file cargo_auto_config.json there are the names of the private keys you can use in automation--tasks--rs.

ssh-agent

Typing the passphrase every time you user the private key is very secure, but it has to be repeated too much times. I use the ssh-agent to store my private keys for one hour. This is less secure, but much more comfortable. ssh-agent works well in Linux and in Windows git-bash that is installed with git-for-windows.

GitHub api

Many things in GitHub can be achieve only through GitHub api. This needs the secret token. GitHub uses OAuth2 to get the token. This is all prepared and working.

The prepared automation--tasks--rs can create a new git repository and a remote GitHub repository, split docs to a separate commit for clarity, change GitHub topics from Cargo.toml keywords, create a release and upload the executables.

crates.io

To publish to crates.io we need the secret access token. The prepared tasks will store it in ~/.ssh protected by your private key.

Open-source and free as a beer

My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻

//bestia.dev
//github.com/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials