Skip to content

Commit

Permalink
[Dependencies] - Update .github/actions/nuget/action.yml to match the…
Browse files Browse the repository at this point in the history
… template repo
  • Loading branch information
credfeto committed Nov 27, 2023
1 parent d23629c commit fed93c7
Showing 1 changed file with 257 additions and 0 deletions.
257 changes: 257 additions & 0 deletions .github/actions/nuget/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
--- # Build and deploy packages
name: 'Configure Nuget Feeds'
description: 'Configure Nuget Feeds'
inputs:
# NUGET
NUGET_PUBLIC_RESTORE_FEED_CACHE:
description: 'Local cache of public nuget feed'
required: false
NUGET_PUBLIC_RESTORE_FEED:
description: 'public nuget feed'
required: false
NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE:
description: 'Any additional nuget feed to download packages from'
required: false
NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE:
description: 'Any additional nuget feed to download packages from'
required: false
NUGET_ADDITIONAL_RESTORE_FEED_RELEASE:
description: 'Any additional nuget feed to download packages from'
required: false
NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE:
description: 'Any additional nuget feed to download packages from'
required: false

runs:
using: "composite"
steps:

- name: "List current nuget feeds (before)"
shell: bash
run: |
echo "List current nuget feeds (before)"
dotnet nuget list source
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

### REMOVE FEEDS
- name: "Dotnet: Remove cache nuget feed (NugetCache) if it exists"
shell: bash
run: |
echo "Removing NugetCache NuGet Feed"
[ "$(dotnet nuget list source | grep NugetCache | tr -s ' ' | cut -d ' ' -f 3)" == "NugetCache" ] && dotnet nuget remove source NugetCache || echo "NugetCache NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Remove cache nuget feed (nuget.org) if it exists"
shell: bash
run: |
echo "Removing nuget.org NuGet Feed"
[ "$(dotnet nuget list source | grep nuget | tr -s ' ' | cut -d ' ' -f 3)" == "nuget.org" ] && dotnet nuget remove source nuget.org || echo "nuget.org NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Remove optional nuget feed (Additional1Cache) if it exists"
shell: bash
run: |
echo "Removing Additional1Cache NuGet Feed"
[ "$(dotnet nuget list source | grep Additional1Cache | tr -s ' ' | cut -d ' ' -f 3)" == "Additional1Cache" ] && dotnet nuget remove source Additional1Cache || echo "Additional1Cache NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Remove optional nuget feed (Additional2Cache) if it exists"
shell: bash
run: |
echo "Removing Additional2Cache NuGet Feed"
[ "$(dotnet nuget list source | grep Additional2Cache | tr -s ' ' | cut -d ' ' -f 3)" == "Additional2Cache" ] && dotnet nuget remove source Additional2Cache || echo "Additional2Cache NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Remove optional nuget feed (Additional1) if it exists"
shell: bash
run: |
echo "Removing Additional1 NuGet Feed"
[ "$(dotnet nuget list source | grep Additional1 | tr -s ' ' | cut -d ' ' -f 3)" == "Additional1" ] && dotnet nuget remove source Additional1 || echo "Additional1 NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Remove optional nuget feed (Additional2) if it exists"
shell: bash
run: |
echo "Removing Additional2 NuGet Feed"
[ "$(dotnet nuget list source | grep Additional2 | tr -s ' ' | cut -d ' ' -f 3)" == "Additional2" ] && dotnet nuget remove source Additional2 || echo "Additional2 NuGet Feed is Not Registered"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

#### ADD FEEDS
- name: "Dotnet: Add optional nuget feed (NugetCache)"
if: inputs.NUGET_PUBLIC_RESTORE_FEED_CACHE != ''
shell: bash
run: |
echo "Adding NugetCache NuGet feed..."
dotnet nuget add source --name NugetCache "${{inputs.NUGET_PUBLIC_RESTORE_FEED_CACHE}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Add nuget feed (nuget.org)"
shell: bash
run: |
echo "Adding nuget.org NuGet feed..."
dotnet nuget add source --name nuget.org "${{inputs.NUGET_PUBLIC_RESTORE_FEED}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Add optional nuget feed (Additional1Cache)"
if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE != ''
shell: bash
run: |
echo "Adding Additional1Cache NuGet feed..."
dotnet nuget add source --name Additional1Cache "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Add optional nuget feed (Additional2Cache)"
if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE != ''
shell: bash
run: |
echo "Adding Additional2Cache NuGet feed..."
dotnet nuget add source --name Additional2Cache "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Add optional nuget feed (Additional1)"
if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE != ''
shell: bash
run: |
echo "Adding Additional1 NuGet feed..."
dotnet nuget add source --name Additional1 "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Add optional nuget feed (Additional2)"
if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE != ''
shell: bash
run: |
echo "Adding Additional2 NuGet feed..."
dotnet nuget add source --name Additional2 "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE}}"
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Show sources (After)"
shell: bash
run: |
echo "List current nuget feeds (after)"
dotnet nuget list source
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

- name: "Dotnet: Clear nuget cache"
shell: bash
run: dotnet nuget locals all --clear
env:
DOTNET_ROOT: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_INSTALL_DIR: "${{github.workspace}}/.dotnet/${{github.sha}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}"
DOTNET_MULTILEVEL_LOOKUP: "false"
DOTNET_NOLOGO: "true"
DOTNET_PRINT_TELEMETRY_MESSAGE: "false"
DOTNET_ReadyToRun: "0"
DOTNET_TC_QuickJitForLoops: "1"
DOTNET_TieredPGO: "1"

0 comments on commit fed93c7

Please sign in to comment.