name: Console (.NET) - Artifactory Only on: workflow_dispatch: defaults: run: shell: pwsh jobs: build_console: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' - name: Build Console App w/only Artifactory Source run: | # 1. Remove all existing package sources $sourceList = dotnet nuget list source $sourceNames = @() foreach ($line in $sourceList) { if ($line -match '^\s*\d+\.\s+(.*)\s+\[Enabled\]') { $sourceNames += $matches[1].Trim() } } foreach ($name in $sourceNames) { dotnet nuget remove source "$name" Write-Host "Removed $name ..." } # 2. Add Artifactory source with credentials from GitHub Secrets dotnet nuget add source "https://bed-artifactory.bedford.progress.com/artifactory/api/nuget/v3/dt-nuget-virtual-tierpoint/index.json" ` --name "artifactory_virtual" ` --username ${{secrets.ARTIFACTORY_NUGET_USERNAME}} ` --password ${{secrets.ARTIFACTORY_NUGET_PASSWORD}} ` --store-password-in-clear-text # 3. List sources to verify dotnet nuget list source # 4. Build the project dotnet build "src/Console/MyDocProcApp/MyDocProcApp.csproj" env: TELERIK_LICENSE: ${{secrets.TELERIK_LICENSE_KEY}}