This GitHub Action generates C bindings with cbindgen for a Rust project.
Input | Required | Default | Description |
---|---|---|---|
rust-project-path |
No | . |
Path to the Rust project |
config-file |
Yes | cbindgen.toml |
Configuration file for cbindgen |
output-header-file |
Yes | bindings_c.h |
Path to the output header file generated by cbindgen |
upload-artifact |
No | true |
Whether to upload the generated header file as an artifact |
github-token |
No | A GitHub token for pushing to the repo. Example: ${{ secrets.GITHUB_TOKEN }} |
|
commit-updated-bindings |
No | false |
Whether to commit the updated bindings |
steps:
- uses: actions/checkout@v4
- uses: Reloaded-Project/cbindgen-action@v1
with:
rust-project-path: '.'
config-file: 'cbindgen.toml'
output-header-file: 'bindings_c.h'
upload-artifact: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-updated-bindings: 'true'
If the upload-artifact
input is set to true
, the generated header file will be uploaded as
an artifact with the following name format:
C-Bindings-<output-header-file>
For example, if the output-header-file
input is set to bindings_c.h
, the artifact name
will be C-Bindings-bindings_c.h
.
If you are not uploading an artifact, the generated header can be found at
${{ inputs.rust-project-path }}/${{ inputs.output-header-file }}
.
This is part of the release pipeline for Reloaded3 libraries and components.
To make things more maintainable, and better for everyone, the code has been wrapped into an efficient GitHub Action.
This project is licensed under the MIT License. See the LICENSE file for details.