Skip to content

Commit

Permalink
Prepare for v1
Browse files Browse the repository at this point in the history
  • Loading branch information
philss committed Jan 23, 2023
1 parent 9fcfc5d commit d140e0d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
# Rustler Precompiled Action

:warning: - **Please do not use this project yet. It's under construction.**"

This is a GitHub Action that builds library crates conditionally using [cross],
and renames the final library file to the naming expected by [RustlerPrecompiled].

It's **important to notice that this Action won't install Rust**. So you need to
install it first.
install it first. For that we recommend the [dtolnay/rust-toolchain] action that
is well maintained.

## Inputs

The following inputs are accepted:

| Name | Description | Required | Default |
|-------------------|---------------|----------|-----------|
| `cross-version` | The version desired for cross. Only relevant if `use-cross` is true. | false | `"v0.2.4"` |
| `nif-version` | The NIF version that we are aiming to. | false | `"2.16"` |
| `project-dir` | A relative path where the project is located. | true | "./" |
| `project-name` | Name of the crate that is being built. This is the same of the Cargo.toml of the crate. | true | |
| `project-version` | The version to use in the name of the lib. This mostly matches the Elixir package version. | true | |
| `target` | The Rust target we are building to. | true | |
| `use-cross` | If the target requires the usage of cross. | false | |
| Name | Description | Required | Default |
|-------------------|-----------------------------------------------------------------------|----------|------------|
| `cross-version` | The version desired for cross. Only relevant if `use-cross` is true. | false | `"v0.2.4"` |
| `nif-version` | The NIF version that we are aiming to. | false | `"2.16"` |
| `project-dir` | A relative path where the project is located. | true | "./" |
| `project-name` | Name of the crate that is being built. Same as in Cargo.toml | true | |
| `project-version` | The version of the Elixir package that the crate is in. | true | |
| `target` | The Rust target we are building to. | true | |
| `use-cross` | If the target requires the usage of cross. | false | |

## Outputs

| Name | Description |
|-------------|-------------|
| `file-name` | The name of the tarball file for this build |
| `file-path` | The full path of the tarball file for this build |
| `file-sha256` | The SHA256 of the tarball file. |
| Name | Description |
|---------------|---------------------------------------------------|
| `file-name` | The name of the tarball file for this build. |
| `file-path` | The full path of the tarball file for this build. |
| `file-sha256` | The SHA256 of the tarball file. |

## Example

Expand All @@ -53,15 +52,16 @@ jobs:
matrix:
nif: ["2.16", "2.15"]
job:
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04 , use-cross: true }
- { target: aarch64-apple-darwin , os: macos-11 }
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true }
- { target: aarch64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true }
- { target: aarch64-apple-darwin , os: macos-11 }
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04 , use-cross: true }
- { target: riscv64gc-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true }
- { target: x86_64-apple-darwin , os: macos-11 }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true }
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true }

steps:
- name: Checkout source code
Expand Down Expand Up @@ -124,3 +124,4 @@ limitations under the License.
[cross]: https://github.com/cross-rs/cross
[RustlerPrecompiled]: https://github.com/philss/rustler_precompiled
[RustlerPrecompiledExample]: https://github.com/philss/rustler_precompilation_example
[dtolnay/rust-toolchain]: https://github.com/dtolnay/rust-toolchain
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inputs:
description: >
A relative path where the project is located.
The script is going to enter this path in order to compile the NIF.
For example:\s"native/my_nif".
For example, "native/my_nif".
required: true
default: "./"

Expand Down Expand Up @@ -143,7 +143,7 @@ runs:
echo "File name: ${TAR_GZ_FILE}"
echo "SHA256: ${FILE_SHA256}"
# Move the tar gz to the initial/root dir. This is necessary because Windows can't find
# Move the tar gz to the initial/root dir. This is necessary because Windows cannot find
# inside the path we provide.
mv "${TAR_GZ_FILE}" "${INITIAL_DIR}/"
Expand Down

0 comments on commit d140e0d

Please sign in to comment.