Skip to content

Commit f3301ee

Browse files
authored
docs(Common): Improve Deployment License Keys docs
1 parent 2c7ed74 commit f3301ee

File tree

1 file changed

+54
-20
lines changed

1 file changed

+54
-20
lines changed

deployment/ci-cd-license-key.md

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,68 @@ steps:
4343
# ...
4444
env:
4545
TELERIK_LICENSE: $(Secret_Telerik_License_Key)
46+
47+
- task: DotNetCoreCLI@2
48+
inputs:
49+
command: 'publish'
50+
# ...
51+
env:
52+
TELERIK_LICENSE: $(Secret_Telerik_License_Key)
4653
````
4754

48-
> Another option is to use a Telerik license file as a [secure file in the pipeline](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files). Implement a [script that copies the license file](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops#consume-a-secure-file-in-a-pipeline) to the application's root folder, so that it's available to all projects that need it.
55+
Another option is to use a Telerik license file as a [secure file](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files) in the pipeline. [Download the secure file](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/download-secure-file-v1?view=azure-pipelines) and use it with a `TELERIK_LICENSE_PATH` environment variable instead of `TELERIK_LICENSE` in all tasks, steps, or scripts that build and publish the Blazor app.
56+
57+
`TELERIK_LICENSE_PATH` requires `Telerik.Licensing` version `1.4.9` and above. You can use it with Telerik UI for Blazor `8.1.0` and above.
58+
59+
>caption Using a TELERIK_LICENSE_PATH environment variable in Azure Pipeline YAML
60+
61+
````YAML.skip-repl
62+
steps:
63+
64+
- task: DownloadSecureFile@1
65+
name: telerikLicense
66+
displayName: 'Download telerik-license.txt'
67+
inputs:
68+
secureFile: 'telerik-license.txt'
69+
70+
- task: DotNetCoreCLI@2
71+
inputs:
72+
command: 'build'
73+
# ...
74+
env:
75+
TELERIK_LICENSE_PATH: $(telerikLicense.secureFilePath)
76+
77+
- task: DotNetCoreCLI@2
78+
displayName: 'Publish'
79+
inputs:
80+
command: 'publish'
81+
# ...
82+
env:
83+
TELERIK_LICENSE_PATH: $(telerikLicense.secureFilePath)
84+
````
4985

5086
### GitHub Actions
5187

5288
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).
5389
1. Paste the contents of the license key file as a value of the GitHub secret.
5490
1. Assign the secret to an environment variable named `TELERIK_LICENSE`.
55-
1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app:
56-
````YAML.skip-repl
57-
env:
58-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
59-
````
60-
The resulting workflow steps may look similar to:
61-
````YAML.skip-repl
62-
- name: Build Step
63-
run: dotnet build -c Release
64-
env:
65-
TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }}
66-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
67-
68-
- name: Publish Step
69-
run: dotnet publish -c Release
70-
env:
71-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
72-
````
73-
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.
91+
1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app.
92+
93+
>caption Using a TELERIK_LICENSE environment variable in GitHub Actions
94+
95+
````YAML.skip-repl
96+
- name: Build Step
97+
run: dotnet build -c Release
98+
env:
99+
TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }}
100+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
101+
102+
- name: Publish Step
103+
run: dotnet publish -c Release
104+
env:
105+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
106+
````
107+
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.
74108

75109
### Docker
76110

0 commit comments

Comments
 (0)