Skip to content

Build Console App

Build Console App #188

name: Build Console App
on:
workflow_dispatch:
push:
branches:
- main
- "console/*"
paths:
- 'src/Console/**/*'
- '.github/workflows/main_build-console.yml'
jobs:
# A job that builds a .NET console application using Telerik Document Processing Libraries
# It uses a Windows runner and builds for Any CPU (remember: Linux file paths are case-sensitive!)
build_console:
runs-on: ubuntu-22.04
env:
RID: win-x64
CSPROJ_PATH: src/Console/MyDocProcApp/MyDocProcApp.csproj
NUGETCONFIG_PATH: src/NuGet.Config
BUILD_CONFIGURATION: Release
# IMPORTANT - REQUIRED For 'akeyless' step
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
# This example uses a NuGet Key instead of username and password, visit https://www.telerik.com/blogs/announcing-nuget-keys.
# You can use GitHub secret to store the key's value, here I am getting the secret from AKeyless using https://github.com/marketplace/actions/akeyless-integrations
- name: Fetch secrets from AKeyless
id: akeyless
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.AKEYLESS_JWT_ID }}
static-secrets: '{"/personal-keys/mccarthy/TELERIK_NUGET_KEY":"TELERIK_NUGET_KEY"}'
- name: Update NuGet Package Sources
run: |
#_____STEP 1_____# The 'update source' command will look in the nuget.config file for the 'Telerik' source and update its credentials using the 'api-key'
dotnet nuget update source 'Telerik' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p "${{ env.TELERIK_NUGET_KEY }}" --configfile 'src/NuGet.Config' --store-password-in-clear-text
#_____STEP 2_____# Now we can use the 'restore' command
dotnet restore ${{ env.CSPROJ_PATH }} --configfile ${{ env.NUGETCONFIG_PATH }} --runtime ${{ env.RID }}
- name: Build Solution
run: dotnet build ${{ env.CSPROJ_PATH }} --configuration ${{ env.BUILD_CONFIGURATION }} --runtime ${{ env.RID }} --no-self-contained --no-restore