Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
amanjeev committed Oct 25, 2024
1 parent 80f3776 commit 011e0b3
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ This is a very simple demo.

## Prerequisites

To start, we will need:

- Access to a GitHub account where you can create repo(s).
- Access to [Ferrocene Customer Portal].
- TL;DR: You can see the [`build.yml`](./.github/workflows/build.yml) file for a fully working sample for this demo project.

## Steps to use Ferrocene in your project

Expand All @@ -31,20 +30,21 @@ packages = [
]
```

- You will use this to install Ferrocene and its releases for your project, and packages and dependencies for the release (like [rustup]).
- You will also use this to build/run your project (like [cargo]).
- CriticalUp depends on a project manifest file, usually named `criticalup.toml`, that it tries to find within your project folder or its parent directory.
- You can override this and provide an explicit `--project` flag with path to your own `criticalup.toml` file for your project.
- `criticalup install --project /path/to/my/manifest/criticalup.toml`.
- To install CriticalUp, head to the [Installing CriticalUp](https://criticalup.ferrocene.dev/install.html) section of the [Criticalup documentation].
Some highlights about CriticalUp and the project manifest:

- This is CritalUp project manifest file. It is usually named `criticalup.toml`. CriticalUp tries to find it within your project folder or its parent directory.
- You can override this and provide an explicit `--project` flag with path to your own `criticalup.toml` file for your project.
- `criticalup install --project /path/to/my/manifest/criticalup.toml`.
- Used to install Ferrocene and its releases for your project, and packages and dependencies for the release (like [rustup]).
- Also used to build/run your project (like [cargo]).
- You can use `-${rustc-host}` suffix to automatically have CriticalUp fill the current architecture triple.

### Get the CriticalUp Token to authenticate

- To install any Ferrocene product/toolchain, you will need to get a token from the [Ferrocene Customer Portal]. This token can be created by you or your organization's liason admin.
- The tokens are at the [Ferrocene CriticalUp Tokens] section of the portal.
- Once you are on the page, click "New Token" and copy the token.
- The token is only shown once for security.
- Once you are on the page, click "New Token" and copy the token.
- The token is only shown once for security.

### Add the CriticalUp Token to GitHub Action secrets

Expand All @@ -54,14 +54,13 @@ The CriticalUp Token you got from the [Ferrocene Customer Portal] must be set in
- Click 'Secrets and variables'.
- Click 'Actions'.
- Click 'New repository secret'.
- Add Name as 'CRITICALUP_TOKEN' and past the token from [Ferrocene Customer Portal] in the 'Secret' text area.

- Add Name as `CRITICALUP_TOKEN` and past the token from [Ferrocene Customer Portal] in the 'Secret' text area.

### Create a simple GitHub Action

You can see the [`build.yml`](./.github/workflows/build.yml) file for a fully working sample for this demo project.

- We will use a single job so we don't need to cache anything. It will have multiple steps.
- We will use a single job so we don't need to cache anything. The job will have multiple steps.
- We will showcase only Ubuntu 20.04 in this exercise.

#### Install CriticalUp
Expand All @@ -72,46 +71,46 @@ The [Installing CriticalUp](https://criticalup.ferrocene.dev/install.html) secti
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/latest/download/criticalup-installer.sh | sh
```

See the step 'Make sure CriticalUp is installed and available' in [`build.yml`](./.github/workflows/build.yml).
> See the step 'Make sure CriticalUp is installed and available' in [`build.yml`](./.github/workflows/build.yml).
#### Test CriticalUp is installed

The following command does not require a token and can tell you available subcommands for CriticalUp.
The following command does not require a token or authentication and can tell you available subcommands for CriticalUp.

```shell
criticalup --help
```

See the step 'Test if CriticalUp is installed' in [`build.yml`](./.github/workflows/build.yml).
> See the step 'Test if CriticalUp is installed' in [`build.yml`](./.github/workflows/build.yml).
#### Authenticate CriticalUp

This section assumes you have done the following from above:
_This section assumes you have done the following from above:

- Get the CriticalUp Token to authenticate
- Add the CriticalUp Token to GitHub Action secrets
- Add the CriticalUp Token to GitHub Action secrets_

In your GitHub Action you can use the secret now as:

```shell
criticalup auth set ${{ secrets.CRITICALUP_TOKEN }}
```

See the step 'Authenticate CriticalUp' in [`build.yml`](./.github/workflows/build.yml).
> See the step 'Authenticate CriticalUp' in [`build.yml`](./.github/workflows/build.yml).
#### Install Ferrocene toolchain

This step assumes you have already done the following from above:
_This step assumes you have already done the following from above:

- Add a project manifest to your repo
- Add a project manifest to your repo_

Just running the following command will install the toolchain listed in your project manifest (`criticalup.toml`).

```shell
criticalup install
```

See the step 'Install Ferrocene toolchain from the project manifest (criticalup.toml)' in [`build.yml`](./.github/workflows/build.yml).
> See the step 'Install Ferrocene toolchain from the project manifest (criticalup.toml)' in [`build.yml`](./.github/workflows/build.yml).
#### Run your app using CriticalUp

Expand All @@ -121,9 +120,9 @@ The following command uses installed Ferrocene:
criticalup run cargo run --release
```

As you can see, you can simple pass `cargo` as a subcommand.
As you can see, you can simply pass `cargo` as a subcommand.

See the step 'Run my app via Ferrocene and its toolchain' in [`build.yml`](./.github/workflows/build.yml).
> See the step 'Run my app via Ferrocene and its toolchain' in [`build.yml`](./.github/workflows/build.yml).
## References

Expand Down

0 comments on commit 011e0b3

Please sign in to comment.