# Semantic Release

Once you have added your [Project](/usage/projects.md) to CFA and set up a [Requester](/usage/requesters.md) and a [Responder](/usage/responders.md) for that project you can go ahead and configure Semantic Release to use CFA.

### Step 1: Configure your CI environment

In order for CFA to run and authenticate correctly you must configure the following environment variables on your CI provider.

| Environment Variable | Value                                                         |
| -------------------- | ------------------------------------------------------------- |
| `CFA_SECRET`         | The "Project Secret" found on your Project configuration page |
| `CFA_PROJECT_ID`     | The "Project ID" found on your Project configuration page     |

These variables are automatically configured by the `CircleCI`and `GitHub Actions`requesters.

### Step 2: Configure Semantic Release

You should [configure Semantic Release](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/getting-started.md#getting-started) following the default instructions.  Then once it's completely set up you should add `@continuous-auth/semantic-release-npm` as a dev-dependency to your project. You do not need to configure a `GITHUB_TOKEN`as that will be provided automatically by CFA.

{% tabs %}
{% tab title="Yarn" %}

```bash
yarn add @continuous-auth/semantic-release-npm --dev
```

{% endtab %}

{% tab title="NPM" %}

```bash
npm install @continuous-auth/semantic-release-npm --save-dev
```

{% endtab %}
{% endtabs %}

&#x20;Then add the following file to the root of your project

{% code title=".releaserc.json" %}

```javascript
{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@continuous-auth/semantic-release-npm",
    "@semantic-release/github"
  ]
}
```

{% endcode %}

This is identical to the default configuration but with the default npm plugin swapped out for the CFA one.

### Step 3: Try trigger a release

Everything should be completely set up now, try pushing a semantic commit to master and see if it releases your module.

### Step 4 (Optional): Use GitHub Action

CFA provides a convenient, secure GitHub Action you can use to easily set up Semantic Release. You can check it out [here](https://github.com/continuousauth/action).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.continuousauth.dev/usage/semantic-release.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
