You've already forked setup-dotnet
							
							
				mirror of
				https://github.com/actions/setup-dotnet.git
				synced 2025-10-31 07:16:21 +07:00 
			
		
		
		
	Compare commits
	
		
			11 Commits
		
	
	
		
			v4.0.1
			...
			Dependabot
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 13be569c2a | |||
| 628f2a72df | |||
| 87b7050bc5 | |||
| e4c228a841 | |||
| 3e891b0cb6 | |||
| 2e0b25913c | |||
| 29640e4139 | |||
| cbeba61921 | |||
| 344ba5f715 | |||
| 9be03d3dab | |||
| dbebe359e4 | 
							
								
								
									
										22
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| # To get started with Dependabot version updates, you'll need to specify which | ||||
| # package ecosystems to update and where the package manifests are located. | ||||
| # Please see the documentation for all configuration options: | ||||
| # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||||
|  | ||||
| version: 2 | ||||
| updates: | ||||
|   # Enable version updates for npm | ||||
|   - package-ecosystem: 'npm' | ||||
|     # Look for `package.json` and `lock` files in the `root` directory | ||||
|     directory: '/' | ||||
|     # Check the npm registry for updates every day (weekdays) | ||||
|     schedule: | ||||
|       interval: 'weekly' | ||||
|  | ||||
|   # Enable version updates for GitHub Actions | ||||
|   - package-ecosystem: 'github-actions' | ||||
|     # Workflow files stored in the default location of `.github/workflows` | ||||
|     # You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`. | ||||
|     directory: '/' | ||||
|     schedule: | ||||
|       interval: 'weekly' | ||||
							
								
								
									
										371
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										371
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							| @ -17,7 +17,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -35,12 +35,35 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^2.2.402$", "^3.1.404$", "^3.0" | ||||
|  | ||||
|   test-setup-multiple-versions-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup dotnet 6.0.427, 8.0.403 and 8.0.x | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: | | ||||
|             6.0.427 | ||||
|             8.0.403 | ||||
|             8.0.x | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^6.0.427$", "^8.0.403$", "^8.0" | ||||
|  | ||||
|   test-setup-full-version: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -64,12 +87,41 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1.201$", "^2.2.402$" -CheckNugetConfig | ||||
|  | ||||
|   test-setup-full-version-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       # Side-by-side install of 6.0 and 8.0 used for the test project | ||||
|       - name: Setup dotnet 6.0.427 | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 6.0.427 | ||||
|       - name: Setup dotnet 8.0.402 | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 8.0.402 | ||||
|           # We are including this variable to force the generation of the nuget config file to verify that it is created in the correct place | ||||
|           source-url: https://api.nuget.org/v3/index.json | ||||
|         env: | ||||
|           NUGET_AUTH_TOKEN: NOTATOKEN | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.402$", "^6.0.427$" -CheckNugetConfig | ||||
|  | ||||
|   test-setup-without-patch-version: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -89,12 +141,37 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1", "^2.2" | ||||
|  | ||||
|   test-setup-without-patch-version-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       # 6.0, 7.0, 8.0 needs to be in single quotes to interpret as a string instead of as an integer | ||||
|       - name: Setup dotnet '8.0' | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '8.0' | ||||
|       - name: Setup dotnet '6.0' | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '6.0' | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^6.0" | ||||
|  | ||||
|   test-setup-prerelease-version: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -109,12 +186,32 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "3.1.100-preview1-014459" | ||||
|  | ||||
|   test-setup-prerelease-version-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup dotnet '8.0.100-preview.1.23115.2' | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '8.0.100-preview.1.23115.2' | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "8.0.100-preview.1.23115.2" | ||||
|  | ||||
|   test-setup-latest-patch-version: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -133,12 +230,37 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^2.2", "^3.1" | ||||
|  | ||||
|   test-setup-latest-patch-version-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup dotnet 8.0.x | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 8.0.x | ||||
|       - name: Setup dotnet 6.0.X | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 6.0.X | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^8.0" | ||||
|  | ||||
|   test-ABCxx-syntax: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: | ||||
|           [ubuntu-latest, windows-latest, macos-13, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -159,7 +281,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -178,12 +300,36 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1", "^2.2" | ||||
|  | ||||
|   test-setup-with-wildcard-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup dotnet 8.0.* | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 8.0.* | ||||
|       - name: Setup dotnet 6.0.* | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 6.0.* | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^6.0" | ||||
|  | ||||
|   test-setup-global-json-specified-and-version: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -204,12 +350,38 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^2.2", "^3.1" | ||||
|  | ||||
|   test-setup-global-json-specified-and-version-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Write global.json | ||||
|         shell: bash | ||||
|         run: | | ||||
|           mkdir subdirectory | ||||
|           echo '{"sdk":{"version": "6.0.424","rollForward": "latestFeature"}}' > ./subdirectory/global.json | ||||
|       - name: Setup dotnet | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '8.0' | ||||
|           global-json-file: ./subdirectory/global.json | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^8.0" | ||||
|  | ||||
|   test-setup-global-json-only: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -229,12 +401,37 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^2.2" | ||||
|  | ||||
|   test-setup-global-json-only-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Write global.json | ||||
|         shell: bash | ||||
|         run: | | ||||
|           mkdir subdirectory | ||||
|           echo '{"sdk":{"version": "6.0.424","rollForward": "latestFeature"}}' > ./subdirectory/global.json | ||||
|       - name: Setup dotnet | ||||
|         uses: ./ | ||||
|         with: | ||||
|           global-json-file: ./subdirectory/global.json | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^6.0" | ||||
|  | ||||
|   test-global-json-with-comments: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -254,12 +451,38 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^2.2" | ||||
|  | ||||
|   test-global-json-with-comments-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Write global.json | ||||
|         shell: bash | ||||
|         run: | | ||||
|           mkdir subdirectory | ||||
|           echo '/* should support comments */ {"sdk":{"version": "6.0.424","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json | ||||
|       - name: Setup dotnet | ||||
|         uses: ./ | ||||
|         with: | ||||
|           global-json-file: ./subdirectory/global.json | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^6.0" | ||||
|  | ||||
|   test-setup-with-dotnet-quality: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: | ||||
|           [ubuntu-latest, windows-latest, macos-13, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -281,7 +504,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     env: | ||||
|       NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||||
|     steps: | ||||
| @ -307,12 +530,43 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1" | ||||
|  | ||||
|   test-setup-with-cache-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     env: | ||||
|       NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Copy NuGet lock file to root | ||||
|         shell: bash | ||||
|         run: cp ./__tests__/e2e-test-csproj/packages.lock.json ./packages.lock.json | ||||
|       - name: Setup .NET Core 8.0 | ||||
|         id: setup-dotnet | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '8.0' | ||||
|           cache: true | ||||
|       - name: Verify Cache | ||||
|         if: steps.setup-dotnet.outputs.cache-hit == 'true' | ||||
|         shell: bash | ||||
|         run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0" | ||||
|  | ||||
|   test-setup-with-cache-dependency-path: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|     env: | ||||
|       NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||||
|     steps: | ||||
| @ -336,12 +590,42 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1" | ||||
|  | ||||
|   test-setup-with-cache-dependency-path-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|     env: | ||||
|       NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup .NET Core 8.0 | ||||
|         id: setup-dotnet | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: '8.0' | ||||
|           cache: true | ||||
|           cache-dependency-path: './__tests__/e2e-test-csproj/packages.lock.json' | ||||
|       - name: Verify Cache | ||||
|         if: steps.setup-dotnet.outputs.cache-hit == 'true' | ||||
|         shell: bash | ||||
|         run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0" | ||||
|  | ||||
|   test-dotnet-version-output-during-single-version-installation: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: | ||||
|           [ubuntu-latest, windows-latest, macos-13, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -367,7 +651,8 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: | ||||
|           [ubuntu-latest, windows-latest, macos-13, macos-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| @ -431,7 +716,7 @@ jobs: | ||||
|           __tests__/verify-dotnet.ps1 -Patterns "^6.0" -CheckNugetConfig | ||||
|  | ||||
|   test-bypass-proxy: | ||||
|     runs-on: ubuntu-latest | ||||
|     runs-on: ubuntu-22.04 | ||||
|     env: | ||||
|       https_proxy: http://no-such-proxy:3128 | ||||
|       no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net | ||||
| @ -452,12 +737,34 @@ jobs: | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^3.1.201$" -CheckNugetConfig | ||||
|  | ||||
|   test-bypass-proxy-extended: | ||||
|     runs-on: ubuntu-latest | ||||
|     env: | ||||
|       https_proxy: http://no-such-proxy:3128 | ||||
|       no_proxy: github.com,dotnetcli.blob.core.windows.net,download.visualstudio.microsoft.com,api.nuget.org,dotnetcli.azureedge.net | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       - name: Setup dotnet 8.0.402 | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: 8.0.402 | ||||
|           source-url: https://api.nuget.org/v3/index.json | ||||
|         env: | ||||
|           NUGET_AUTH_TOKEN: NOTATOKEN | ||||
|       - name: Verify dotnet | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.402$" -CheckNugetConfig | ||||
|  | ||||
|   test-sequential-version-installation: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: [ubuntu-22.04, windows-latest, macos-13] | ||||
|         lower-version: ['3.1.426'] | ||||
|         higher-version: ['7.0.203'] | ||||
|     steps: | ||||
| @ -481,3 +788,33 @@ jobs: | ||||
|       - name: Verify dotnet (higher version) | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$" | ||||
|  | ||||
|   test-sequential-version-installation-extended: | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, macos-latest] | ||||
|         lower-version: ['6.0.425'] | ||||
|         higher-version: ['8.0.403'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Clear toolcache | ||||
|         shell: pwsh | ||||
|         run: __tests__/clear-toolcache.ps1 ${{ runner.os }} | ||||
|       # Install one version, use it for something, then switch to next version | ||||
|       - name: Setup dotnet (lower version) | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: ${{ matrix.lower-version }} | ||||
|       - name: Verify dotnet (lower version) | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$" | ||||
|       - name: Setup dotnet (higher version) | ||||
|         uses: ./ | ||||
|         with: | ||||
|           dotnet-version: ${{ matrix.higher-version }} | ||||
|       - name: Verify dotnet (higher version) | ||||
|         shell: pwsh | ||||
|         run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$" | ||||
|  | ||||
							
								
								
									
										20
									
								
								.github/workflows/publish-immutable-actions.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/publish-immutable-actions.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | ||||
| name: 'Publish Immutable Action Version' | ||||
|  | ||||
| on: | ||||
|   release: | ||||
|     types: [published] | ||||
|  | ||||
| jobs: | ||||
|   publish: | ||||
|     runs-on: ubuntu-latest | ||||
|     permissions: | ||||
|       contents: read | ||||
|       id-token: write | ||||
|       packages: write | ||||
|  | ||||
|     steps: | ||||
|       - name: Checking out | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Publish | ||||
|         id: publish | ||||
|         uses: actions/publish-immutable-action@0.0.3 | ||||
| @ -23,7 +23,7 @@ jobs: | ||||
|     steps: | ||||
|       - name: Update the ${{ env.TAG_NAME }} tag | ||||
|         id: update-major-tag | ||||
|         uses: actions/publish-action@v0.2.2 | ||||
|         uses: actions/publish-action@v0.3.0 | ||||
|         with: | ||||
|           source-tag: ${{ env.TAG_NAME }} | ||||
|           slack-webhook: ${{ secrets.SLACK_WEBHOOK }} | ||||
|  | ||||
							
								
								
									
										24
									
								
								.github/workflows/test-dotnet.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.github/workflows/test-dotnet.yml
									
									
									
									
										vendored
									
									
								
							| @ -17,8 +17,30 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest, macos-13] | ||||
|         operating-system: | ||||
|           [ubuntu-latest, ubuntu-22.04, windows-latest, macos-13, macos-latest] | ||||
|         dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0', '6.0', '7.0', '8.0'] | ||||
|         exclude: | ||||
|           - dotnet-version: '2.1' | ||||
|             operating-system: ubuntu-latest | ||||
|           - dotnet-version: '2.2' | ||||
|             operating-system: ubuntu-latest | ||||
|           - dotnet-version: '3.0' | ||||
|             operating-system: ubuntu-latest | ||||
|           - dotnet-version: '3.1' | ||||
|             operating-system: ubuntu-latest | ||||
|           - dotnet-version: '5.0' | ||||
|             operating-system: ubuntu-latest | ||||
|           - dotnet-version: '2.1' | ||||
|             operating-system: macos-latest | ||||
|           - dotnet-version: '2.2' | ||||
|             operating-system: macos-latest | ||||
|           - dotnet-version: '3.0' | ||||
|             operating-system: macos-latest | ||||
|           - dotnet-version: '3.1' | ||||
|             operating-system: macos-latest | ||||
|           - dotnet-version: '5.0' | ||||
|             operating-system: macos-latest | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/fast-xml-parser.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/fast-xml-parser.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: fast-xml-parser | ||||
| version: 4.3.6 | ||||
| version: 4.4.1 | ||||
| type: npm | ||||
| summary: Validate XML, Parse XML, Build XML without C/C++ based libraries | ||||
| homepage: | ||||
|  | ||||
							
								
								
									
										9
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							| @ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() { | ||||
| exports.isCacheFeatureAvailable = isCacheFeatureAvailable; | ||||
| /** | ||||
|  * Returns this action runs on GitHub Enterprise Server or not. | ||||
|  * (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134)
 | ||||
|  */ | ||||
| function isGhes() { | ||||
|     const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; | ||||
|     return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; | ||||
|     const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); | ||||
|     const hostname = ghUrl.hostname.trimEnd().toUpperCase(); | ||||
|     const isGitHubHost = hostname === 'GITHUB.COM'; | ||||
|     const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); | ||||
|     const isLocalHost = hostname.endsWith('.LOCALHOST'); | ||||
|     return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										49
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										49
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							| @ -51639,6 +51639,8 @@ exports.validate = function (xmlData, options) { | ||||
|             return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); | ||||
|           } else if (attrStr.trim().length > 0) { | ||||
|             return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); | ||||
|           } else if (tags.length === 0) { | ||||
|             return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); | ||||
|           } else { | ||||
|             const otg = tags.pop(); | ||||
|             if (tagName !== otg.tagName) { | ||||
| @ -52082,6 +52084,7 @@ Builder.prototype.j2x = function(jObj, level) { | ||||
|       //repeated nodes
 | ||||
|       const arrLen = jObj[key].length; | ||||
|       let listTagVal = ""; | ||||
|       let listTagAttr = ""; | ||||
|       for (let j = 0; j < arrLen; j++) { | ||||
|         const item = jObj[key][j]; | ||||
|         if (typeof item === 'undefined') { | ||||
| @ -52091,17 +52094,27 @@ Builder.prototype.j2x = function(jObj, level) { | ||||
|           else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; | ||||
|           // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
 | ||||
|         } else if (typeof item === 'object') { | ||||
|           if(this.options.oneListGroup ){ | ||||
|             listTagVal += this.j2x(item, level + 1).val; | ||||
|           if(this.options.oneListGroup){ | ||||
|             const result = this.j2x(item, level + 1); | ||||
|             listTagVal += result.val; | ||||
|             if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { | ||||
|               listTagAttr += result.attrStr | ||||
|             } | ||||
|           }else{ | ||||
|             listTagVal += this.processTextOrObjNode(item, key, level) | ||||
|           } | ||||
|         } else { | ||||
|           listTagVal += this.buildTextValNode(item, key, '', level); | ||||
|           if (this.options.oneListGroup) { | ||||
|             let textValue = this.options.tagValueProcessor(key, item); | ||||
|             textValue = this.replaceEntitiesValue(textValue); | ||||
|             listTagVal += textValue; | ||||
|           } else { | ||||
|             listTagVal += this.buildTextValNode(item, key, '', level); | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|       if(this.options.oneListGroup){ | ||||
|         listTagVal = this.buildObjectNode(listTagVal, key, '', level); | ||||
|         listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); | ||||
|       } | ||||
|       val += listTagVal; | ||||
|     } else { | ||||
| @ -52911,10 +52924,18 @@ const parseXml = function(xmlData) { | ||||
|           let tagContent = ""; | ||||
|           //self-closing tag
 | ||||
|           if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ | ||||
|             if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
 | ||||
|               tagName = tagName.substr(0, tagName.length - 1); | ||||
|               jPath = jPath.substr(0, jPath.length - 1); | ||||
|               tagExp = tagName; | ||||
|             }else{ | ||||
|               tagExp = tagExp.substr(0, tagExp.length - 1); | ||||
|             } | ||||
|             i = result.closeIndex; | ||||
|           } | ||||
|           //unpaired tag
 | ||||
|           else if(this.options.unpairedTags.indexOf(tagName) !== -1){ | ||||
|              | ||||
|             i = result.closeIndex; | ||||
|           } | ||||
|           //normal tag
 | ||||
| @ -93612,11 +93633,14 @@ function isCacheFeatureAvailable() { | ||||
| exports.isCacheFeatureAvailable = isCacheFeatureAvailable; | ||||
| /** | ||||
|  * Returns this action runs on GitHub Enterprise Server or not. | ||||
|  * (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134)
 | ||||
|  */ | ||||
| function isGhes() { | ||||
|     const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; | ||||
|     return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; | ||||
|     const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); | ||||
|     const hostname = ghUrl.hostname.trimEnd().toUpperCase(); | ||||
|     const isGitHubHost = hostname === 'GITHUB.COM'; | ||||
|     const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); | ||||
|     const isLocalHost = hostname.endsWith('.LOCALHOST'); | ||||
|     return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| @ -93782,7 +93806,13 @@ class DotnetVersionResolver { | ||||
|                 allowRetries: true, | ||||
|                 maxRetries: 3 | ||||
|             }); | ||||
|             const response = yield httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl); | ||||
|             let response; | ||||
|             try { | ||||
|                 response = yield httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl); | ||||
|             } | ||||
|             catch (error) { | ||||
|                 response = yield httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexFallbackUrl); | ||||
|             } | ||||
|             const result = response.result || {}; | ||||
|             const releasesInfo = result['releases-index']; | ||||
|             const releaseInfo = releasesInfo.find(info => { | ||||
| @ -93797,7 +93827,8 @@ class DotnetVersionResolver { | ||||
|     } | ||||
| } | ||||
| exports.DotnetVersionResolver = DotnetVersionResolver; | ||||
| DotnetVersionResolver.DotnetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; | ||||
| DotnetVersionResolver.DotnetCoreIndexUrl = 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json'; | ||||
| DotnetVersionResolver.DotnetCoreIndexFallbackUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; | ||||
| class DotnetInstallScript { | ||||
|     constructor() { | ||||
|         this.scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh'; | ||||
|  | ||||
							
								
								
									
										3189
									
								
								externals/install-dotnet.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3189
									
								
								externals/install-dotnet.ps1
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										154
									
								
								externals/install-dotnet.sh
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										154
									
								
								externals/install-dotnet.sh
									
									
									
									
										vendored
									
									
								
							| @ -327,6 +327,14 @@ get_machine_architecture() { | ||||
|             echo "loongarch64" | ||||
|             return 0 | ||||
|             ;; | ||||
|         riscv64) | ||||
|             echo "riscv64" | ||||
|             return 0 | ||||
|             ;; | ||||
|         powerpc|ppc) | ||||
|             echo "ppc" | ||||
|             return 0 | ||||
|             ;; | ||||
|         esac | ||||
|     fi | ||||
|  | ||||
| @ -415,11 +423,17 @@ get_normalized_architecture_for_specific_sdk_version() { | ||||
| # args: | ||||
| # version or channel - $1 | ||||
| is_arm64_supported() { | ||||
|     #any channel or version that starts with the specified versions | ||||
|     case "$1" in | ||||
|         ( "1"* | "2"* | "3"*  | "4"* | "5"*)  | ||||
|             echo false | ||||
|             return 0 | ||||
|     # Extract the major version by splitting on the dot | ||||
|     major_version="${1%%.*}" | ||||
|  | ||||
|     # Check if the major version is a valid number and less than 6 | ||||
|     case "$major_version" in | ||||
|         [0-9]*)   | ||||
|             if [ "$major_version" -lt 6 ]; then | ||||
|                 echo false | ||||
|                 return 0 | ||||
|             fi | ||||
|             ;; | ||||
|     esac | ||||
|  | ||||
|     echo true | ||||
| @ -942,6 +956,37 @@ get_absolute_path() { | ||||
|     return 0 | ||||
| } | ||||
|  | ||||
| # args: | ||||
| # override - $1 (boolean, true or false) | ||||
| get_cp_options() { | ||||
|     eval $invocation | ||||
|  | ||||
|     local override="$1" | ||||
|     local override_switch="" | ||||
|  | ||||
|     if [ "$override" = false ]; then | ||||
|         override_switch="-n" | ||||
|  | ||||
|         # create temporary files to check if 'cp -u' is supported | ||||
|         tmp_dir="$(mktemp -d)" | ||||
|         tmp_file="$tmp_dir/testfile" | ||||
|         tmp_file2="$tmp_dir/testfile2" | ||||
|  | ||||
|         touch "$tmp_file" | ||||
|  | ||||
|         # use -u instead of -n if it's available | ||||
|         if cp -u "$tmp_file" "$tmp_file2" 2>/dev/null; then | ||||
|             override_switch="-u" | ||||
|         fi | ||||
|  | ||||
|         # clean up | ||||
|         rm -f "$tmp_file" "$tmp_file2" | ||||
|         rm -rf "$tmp_dir" | ||||
|     fi | ||||
|  | ||||
|     echo "$override_switch" | ||||
| } | ||||
|  | ||||
| # args: | ||||
| # input_files - stdin | ||||
| # root_path - $1 | ||||
| @ -953,15 +998,7 @@ copy_files_or_dirs_from_list() { | ||||
|     local root_path="$(remove_trailing_slash "$1")" | ||||
|     local out_path="$(remove_trailing_slash "$2")" | ||||
|     local override="$3" | ||||
|     local osname="$(get_current_os_name)" | ||||
|     local override_switch=$( | ||||
|         if [ "$override" = false ]; then | ||||
|             if [ "$osname" = "linux-musl" ]; then | ||||
|                 printf -- "-u"; | ||||
|             else | ||||
|                 printf -- "-n"; | ||||
|             fi | ||||
|         fi) | ||||
|     local override_switch="$(get_cp_options "$override")" | ||||
|  | ||||
|     cat | uniq | while read -r file_path; do | ||||
|         local path="$(remove_beginning_slash "${file_path#$root_path}")" | ||||
| @ -1235,6 +1272,61 @@ downloadwget() { | ||||
|     return 0 | ||||
| } | ||||
|  | ||||
| extract_stem() { | ||||
|     local url="$1" | ||||
|     # extract the protocol | ||||
|     proto="$(echo $1 | grep :// | sed -e's,^\(.*://\).*,\1,g')" | ||||
|     # remove the protocol | ||||
|     url="${1/$proto/}" | ||||
|     # extract the path (if any) - since we know all of our feeds have a first path segment, we can skip the first one. otherwise we'd use -f2- to get the full path | ||||
|     full_path="$(echo $url | grep / | cut -d/ -f2-)" | ||||
|     path="$(echo $full_path | cut -d/ -f2-)" | ||||
|     echo $path | ||||
| } | ||||
|  | ||||
| check_url_exists() { | ||||
|     eval $invocation | ||||
|     local url="$1" | ||||
|  | ||||
|     local code="" | ||||
|     if machine_has "curl" | ||||
|     then | ||||
|         code=$(curl --head -o /dev/null -w "%{http_code}" -s --fail "$url"); | ||||
|     elif machine_has "wget" | ||||
|     then | ||||
|         # get the http response, grab the status code | ||||
|         server_response=$(wget -qO- --method=HEAD --server-response "$url" 2>&1) | ||||
|         code=$(echo "$server_response" | grep "HTTP/" | awk '{print $2}') | ||||
|     fi | ||||
|     if [ $code = "200" ]; then | ||||
|         return 0 | ||||
|     else | ||||
|         return 1 | ||||
|     fi | ||||
| } | ||||
|  | ||||
| sanitize_redirect_url() { | ||||
|     eval $invocation | ||||
|  | ||||
|     local url_stem | ||||
|     url_stem=$(extract_stem "$1") | ||||
|     say_verbose "Checking configured feeds for the asset at ${yellow:-}$url_stem${normal:-}" | ||||
|  | ||||
|     for feed in "${feeds[@]}" | ||||
|     do | ||||
|         local trial_url="$feed/$url_stem" | ||||
|         say_verbose "Checking ${yellow:-}$trial_url${normal:-}" | ||||
|         if check_url_exists "$trial_url"; then | ||||
|             say_verbose "Found a match at ${yellow:-}$trial_url${normal:-}" | ||||
|             echo "$trial_url" | ||||
|             return 0 | ||||
|         else | ||||
|             say_verbose "No match at ${yellow:-}$trial_url${normal:-}" | ||||
|         fi | ||||
|     done | ||||
|     return 1 | ||||
| } | ||||
|  | ||||
| get_download_link_from_aka_ms() { | ||||
|     eval $invocation | ||||
|  | ||||
| @ -1287,6 +1379,11 @@ get_download_link_from_aka_ms() { | ||||
|             return 1 | ||||
|         fi | ||||
|  | ||||
|         sanitized_redirect_url=$(sanitize_redirect_url "$aka_ms_download_link") | ||||
|         if [[ -n "$sanitized_redirect_url" ]]; then | ||||
|             aka_ms_download_link="$sanitized_redirect_url" | ||||
|         fi | ||||
|  | ||||
|         say_verbose "The redirect location retrieved: '$aka_ms_download_link'." | ||||
|         return 0 | ||||
|     else | ||||
| @ -1298,23 +1395,16 @@ get_download_link_from_aka_ms() { | ||||
| get_feeds_to_use() | ||||
| { | ||||
|     feeds=( | ||||
|     "https://dotnetcli.azureedge.net/dotnet" | ||||
|     "https://dotnetbuilds.azureedge.net/public" | ||||
|     "https://builds.dotnet.microsoft.com/dotnet" | ||||
|     "https://ci.dot.net/public" | ||||
|     ) | ||||
|  | ||||
|     if [[ -n "$azure_feed" ]]; then | ||||
|         feeds=("$azure_feed") | ||||
|     fi | ||||
|  | ||||
|     if [[ "$no_cdn" == "true" ]]; then | ||||
|         feeds=( | ||||
|         "https://dotnetcli.blob.core.windows.net/dotnet" | ||||
|         "https://dotnetbuilds.blob.core.windows.net/public" | ||||
|         ) | ||||
|  | ||||
|         if [[ -n "$uncached_feed" ]]; then | ||||
|             feeds=("$uncached_feed") | ||||
|         fi | ||||
|     if [[ -n "$uncached_feed" ]]; then | ||||
|         feeds=("$uncached_feed") | ||||
|     fi | ||||
| } | ||||
|  | ||||
| @ -1446,7 +1536,7 @@ generate_regular_links() { | ||||
|         link_types+=("legacy") | ||||
|     else | ||||
|         legacy_download_link="" | ||||
|         say_verbose "Cound not construct a legacy_download_link; omitting..." | ||||
|         say_verbose "Could not construct a legacy_download_link; omitting..." | ||||
|     fi | ||||
|  | ||||
|     #  Check if the SDK version is already installed. | ||||
| @ -1549,7 +1639,7 @@ install_dotnet() { | ||||
|                 say "The resource at $link_type link '$download_link' is not available." | ||||
|                 ;; | ||||
|             *) | ||||
|                 say "Failed to download $link_type link '$download_link': $download_error_msg" | ||||
|                 say "Failed to download $link_type link '$download_link': $http_code $download_error_msg" | ||||
|                 ;; | ||||
|             esac | ||||
|             rm -f "$zip_path" 2>&1 && say_verbose "Temporary archive file $zip_path was removed" | ||||
| @ -1610,7 +1700,6 @@ install_dir="<auto>" | ||||
| architecture="<auto>" | ||||
| dry_run=false | ||||
| no_path=false | ||||
| no_cdn=false | ||||
| azure_feed="" | ||||
| uncached_feed="" | ||||
| feed_credential="" | ||||
| @ -1683,10 +1772,6 @@ do | ||||
|             verbose=true | ||||
|             non_dynamic_parameters+=" $name" | ||||
|             ;; | ||||
|         --no-cdn|-[Nn]o[Cc]dn) | ||||
|             no_cdn=true | ||||
|             non_dynamic_parameters+=" $name" | ||||
|             ;; | ||||
|         --azure-feed|-[Aa]zure[Ff]eed) | ||||
|             shift | ||||
|             azure_feed="$1" | ||||
| @ -1727,7 +1812,7 @@ do | ||||
|             zip_path="$1" | ||||
|             ;; | ||||
|         -?|--?|-h|--help|-[Hh]elp) | ||||
|             script_name="$(basename "$0")" | ||||
|             script_name="dotnet-install.sh" | ||||
|             echo ".NET Tools Installer" | ||||
|             echo "Usage:" | ||||
|             echo "       # Install a .NET SDK of a given Quality from a given Channel" | ||||
| @ -1791,13 +1876,10 @@ do | ||||
|             echo "  --verbose,-Verbose                 Display diagnostics information." | ||||
|             echo "  --azure-feed,-AzureFeed            For internal use only." | ||||
|             echo "                                     Allows using a different storage to download SDK archives from." | ||||
|             echo "                                     This parameter is only used if --no-cdn is false." | ||||
|             echo "  --uncached-feed,-UncachedFeed      For internal use only." | ||||
|             echo "                                     Allows using a different storage to download SDK archives from." | ||||
|             echo "                                     This parameter is only used if --no-cdn is true." | ||||
|             echo "  --skip-non-versioned-files         Skips non-versioned files if they already exist, such as the dotnet executable." | ||||
|             echo "      -SkipNonVersionedFiles" | ||||
|             echo "  --no-cdn,-NoCdn                    Disable downloading from the Azure CDN, and use the uncached feed directly." | ||||
|             echo "  --jsonfile <JSONFILE>              Determines the SDK version from a user specified global.json file." | ||||
|             echo "                                     Note: global.json must have a value for 'SDK:Version'" | ||||
|             echo "  --keep-zip,-KeepZip                If set, downloaded file is kept." | ||||
|  | ||||
							
								
								
									
										22
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										22
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -16,7 +16,7 @@ | ||||
|         "@actions/glob": "^0.4.0", | ||||
|         "@actions/http-client": "^2.2.1", | ||||
|         "@actions/io": "^1.0.2", | ||||
|         "fast-xml-parser": "^4.3.6", | ||||
|         "fast-xml-parser": "^4.4.1", | ||||
|         "json5": "^2.2.3", | ||||
|         "semver": "^7.6.0" | ||||
|       }, | ||||
| @ -2907,9 +2907,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/cross-spawn": { | ||||
|       "version": "7.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", | ||||
|       "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", | ||||
|       "version": "7.0.6", | ||||
|       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", | ||||
|       "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", | ||||
|       "dev": true, | ||||
|       "dependencies": { | ||||
|         "path-key": "^3.1.0", | ||||
| @ -3490,9 +3490,9 @@ | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/fast-xml-parser": { | ||||
|       "version": "4.3.6", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz", | ||||
|       "integrity": "sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==", | ||||
|       "version": "4.4.1", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", | ||||
|       "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", | ||||
|       "funding": [ | ||||
|         { | ||||
|           "type": "github", | ||||
| @ -4795,12 +4795,12 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/micromatch": { | ||||
|       "version": "4.0.5", | ||||
|       "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", | ||||
|       "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", | ||||
|       "version": "4.0.8", | ||||
|       "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", | ||||
|       "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", | ||||
|       "dev": true, | ||||
|       "dependencies": { | ||||
|         "braces": "^3.0.2", | ||||
|         "braces": "^3.0.3", | ||||
|         "picomatch": "^2.3.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|  | ||||
| @ -33,7 +33,7 @@ | ||||
|     "@actions/glob": "^0.4.0", | ||||
|     "@actions/http-client": "^2.2.1", | ||||
|     "@actions/io": "^1.0.2", | ||||
|     "fast-xml-parser": "^4.3.6", | ||||
|     "fast-xml-parser": "^4.4.1", | ||||
|     "json5": "^2.2.3", | ||||
|     "semver": "^7.6.0" | ||||
|   }, | ||||
|  | ||||
| @ -90,9 +90,16 @@ export function isCacheFeatureAvailable(): boolean { | ||||
|  | ||||
| /** | ||||
|  * Returns this action runs on GitHub Enterprise Server or not. | ||||
|  * (port from https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/cache/src/internal/cacheUtils.ts#L134) | ||||
|  */ | ||||
| function isGhes(): boolean { | ||||
|   const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; | ||||
|   return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM'; | ||||
|   const ghUrl = new URL( | ||||
|     process.env['GITHUB_SERVER_URL'] || 'https://github.com' | ||||
|   ); | ||||
|  | ||||
|   const hostname = ghUrl.hostname.trimEnd().toUpperCase(); | ||||
|   const isGitHubHost = hostname === 'GITHUB.COM'; | ||||
|   const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM'); | ||||
|   const isLocalHost = hostname.endsWith('.LOCALHOST'); | ||||
|  | ||||
|   return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost; | ||||
| } | ||||
|  | ||||
| @ -101,9 +101,18 @@ export class DotnetVersionResolver { | ||||
|       allowRetries: true, | ||||
|       maxRetries: 3 | ||||
|     }); | ||||
|     const response = await httpClient.getJson<any>( | ||||
|       DotnetVersionResolver.DotnetCoreIndexUrl | ||||
|     ); | ||||
|  | ||||
|     let response; | ||||
|     try { | ||||
|       response = await httpClient.getJson<any>( | ||||
|         DotnetVersionResolver.DotnetCoreIndexUrl | ||||
|       ); | ||||
|     } catch (error) { | ||||
|       response = await httpClient.getJson<any>( | ||||
|         DotnetVersionResolver.DotnetCoreIndexFallbackUrl | ||||
|       ); | ||||
|     } | ||||
|  | ||||
|     const result = response.result || {}; | ||||
|     const releasesInfo: any[] = result['releases-index']; | ||||
|  | ||||
| @ -122,6 +131,8 @@ export class DotnetVersionResolver { | ||||
|   } | ||||
|  | ||||
|   static DotnetCoreIndexUrl = | ||||
|     'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json'; | ||||
|   static DotnetCoreIndexFallbackUrl = | ||||
|     'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	