Skip to content

docs(common): Improve GitHub Actions license key example #2771

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

Merged
merged 7 commits into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions deployment/ci-cd-license-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,34 @@ The license activation process in a CI/CD environment involves the following ste

The recommended way to provide your license key to the `Telerik.Licensing` NuGet package in CI/CD environment is to use environment variables. Each CI/CD platform has a different process for setting environment variables. This article lists only some of the most popular examples.

### Azure Pipelines (YAML)
### Azure Pipelines

1. Create a new <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch" target="_blank">user-defined variable</a> named `TELERIK_LICENSE`.
1. Paste the contents of the license key file as a value.

### Azure Pipelines (Classic)

1. Create a new <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch" target="_blank">user-defined variable</a> named `TELERIK_LICENSE`.
1. Paste the contents of the license key file as a value.
1. Create a new [user-defined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables) named `TELERIK_LICENSE`, according to your [YAML](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-variables-in-pipeline) or [Classic](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch#set-variables-in-pipeline) pipeline setup.
1. Paste the contents of the license key file as a value of the variable.

### GitHub Actions

1. Create a new <a href="https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository" target="_blank">Repository Secret</a> or an <a href="https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization" target="_blank">Organization Secret</a>.
1. Create a new [Repository Secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) or an [Organization Secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization).
1. Set the name of the secret to `TELERIK_LICENSE` and paste the contents of the license file as a value.
1. After running `npm install` or `yarn`, add a build step to activate the license:
````YAML
1. Add a `TELERIK_LICENSE` environment variable to the steps, which build and publish the Blazor app:
````YAML.skip-repl
env:
TELERIK_LICENSE: ${ { secrets.TELERIK_LICENSE } } # remove the spaces between the brackets
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}
````
The resulting workflow steps may look similar to:
````YAML.skip-repl
- name: Build Step
run: dotnet build -c Release
env:
TELERIK_NUGET_KEY: ${{ "{{ secrets.TELERIK_NUGET_KEY }}" }}
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}

- name: Publish Step
run: dotnet publish -c Release
env:
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}
````
Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the article [Restoring NuGet Packages in Your CI Workflow](slug:deployment-nuget). It shows how to use the `TELERIK_NUGET_KEY` environment variable in your CI build environment.

### Docker

Expand Down
Loading