Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cargo-generate #169

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Support cargo-generate #169

wants to merge 7 commits into from

Conversation

armandas
Copy link

cargo-generate is a popular tool for generating projects from templates and significantly lowers the barrier to starting.
This PR makes changes to support cargo-generate, enabling users to start a project with a single line:

cargo generate --git https://github.com/emilk/eframe_template

The core changes are:

  • Replacing hard-coded project name and author with appropriate template placeholders
  • Deleting scripts for filling in the templates

However, the bulk of changes are in order to update the github actions. The flow is as follows:

  1. First, a project is generated using cargo-generate
  2. The generated project is uploaded as an artifact
  3. Each subsequent action downloads the generated project, instead of checking out the repository

Tangential changes to the actions:

  • actions-rs actions are no longer maintained, so their usage has been removed. For rust toolchain, I'm using dtolnay/rust-toolchain action. Cargo commands are now just written out, instead of relying on an action.
  • trunk is installed using cargo binstall instead of using wget

armandas and others added 6 commits November 18, 2024 15:49
- Generate the project using cargo-generate
- Upload generated project as artifact
- Download the artifact and use it in the following actions
@armandas armandas changed the title Use cargo-generate Support cargo-generate Nov 23, 2024
@armandas armandas mentioned this pull request Nov 23, 2024
Use code blocks to allow click-copying code from github.
@c-git
Copy link
Contributor

c-git commented Nov 26, 2024

I love the idea but wouldn't this make it incompatible with using the github template feature?

@armandas
Copy link
Author

Yeah, I guess that would be the reason to keep the scripts around...

@c-git
Copy link
Contributor

c-git commented Nov 28, 2024

Yeah, I guess if they use the GitHub template they can just change it manually or use the script (which will need to be updated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants