You've already forked setup-dotnet
							
							
				mirror of
				https://github.com/actions/setup-dotnet.git
				synced 2025-11-04 00:46:36 +07:00 
			
		
		
		
	Compare commits
	
		
			10 Commits
		
	
	
		
			v4.0.1
			...
			benwells/r
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8e5c05a67c | |||
| 87b7050bc5 | |||
| e4c228a841 | |||
| 3e891b0cb6 | |||
| 2e0b25913c | |||
| 29640e4139 | |||
| cbeba61921 | |||
| 344ba5f715 | |||
| 9be03d3dab | |||
| dbebe359e4 | 
							
								
								
									
										371
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										371
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							@ -17,7 +17,7 @@ jobs:
 | 
				
			|||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -35,12 +35,35 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^2.2.402$", "^3.1.404$", "^3.0"
 | 
					        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:
 | 
					  test-setup-full-version:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -64,12 +87,41 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1.201$", "^2.2.402$" -CheckNugetConfig
 | 
					        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:
 | 
					  test-setup-without-patch-version:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -89,12 +141,37 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1", "^2.2"
 | 
					        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:
 | 
					  test-setup-prerelease-version:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -109,12 +186,32 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "3.1.100-preview1-014459"
 | 
					        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:
 | 
					  test-setup-latest-patch-version:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -133,12 +230,37 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^2.2", "^3.1"
 | 
					        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:
 | 
					  test-ABCxx-syntax:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system:
 | 
				
			||||||
 | 
					          [ubuntu-latest, windows-latest, macos-13, macos-latest]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -159,7 +281,7 @@ jobs:
 | 
				
			|||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -178,12 +300,36 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1", "^2.2"
 | 
					        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:
 | 
					  test-setup-global-json-specified-and-version:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -204,12 +350,38 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^2.2", "^3.1"
 | 
					        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:
 | 
					  test-setup-global-json-only:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -229,12 +401,37 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^2.2"
 | 
					        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:
 | 
					  test-global-json-with-comments:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -254,12 +451,38 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^2.2"
 | 
					        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:
 | 
					  test-setup-with-dotnet-quality:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system:
 | 
				
			||||||
 | 
					          [ubuntu-latest, windows-latest, macos-13, macos-latest]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -281,7 +504,7 @@ jobs:
 | 
				
			|||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
					      NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
@ -307,12 +530,43 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1"
 | 
					        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:
 | 
					  test-setup-with-cache-dependency-path:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
					      NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
@ -336,12 +590,42 @@ jobs:
 | 
				
			|||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1"
 | 
					        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:
 | 
					  test-dotnet-version-output-during-single-version-installation:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system:
 | 
				
			||||||
 | 
					          [ubuntu-latest, windows-latest, macos-13, macos-latest]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -367,7 +651,8 @@ jobs:
 | 
				
			|||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system:
 | 
				
			||||||
 | 
					          [ubuntu-latest, windows-latest, macos-13, macos-latest]
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
@ -431,7 +716,7 @@ jobs:
 | 
				
			|||||||
          __tests__/verify-dotnet.ps1 -Patterns "^6.0" -CheckNugetConfig
 | 
					          __tests__/verify-dotnet.ps1 -Patterns "^6.0" -CheckNugetConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  test-bypass-proxy:
 | 
					  test-bypass-proxy:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-22.04
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      https_proxy: http://no-such-proxy:3128
 | 
					      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
 | 
					      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
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^3.1.201$" -CheckNugetConfig
 | 
					        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:
 | 
					  test-sequential-version-installation:
 | 
				
			||||||
    runs-on: ${{ matrix.operating-system }}
 | 
					    runs-on: ${{ matrix.operating-system }}
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        operating-system: [ubuntu-latest, windows-latest, macos-13]
 | 
					        operating-system: [ubuntu-22.04, windows-latest, macos-13]
 | 
				
			||||||
        lower-version: ['3.1.426']
 | 
					        lower-version: ['3.1.426']
 | 
				
			||||||
        higher-version: ['7.0.203']
 | 
					        higher-version: ['7.0.203']
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
@ -481,3 +788,33 @@ jobs:
 | 
				
			|||||||
      - name: Verify dotnet (higher version)
 | 
					      - name: Verify dotnet (higher version)
 | 
				
			||||||
        shell: pwsh
 | 
					        shell: pwsh
 | 
				
			||||||
        run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$"
 | 
					        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:
 | 
					    steps:
 | 
				
			||||||
      - name: Update the ${{ env.TAG_NAME }} tag
 | 
					      - name: Update the ${{ env.TAG_NAME }} tag
 | 
				
			||||||
        id: update-major-tag
 | 
					        id: update-major-tag
 | 
				
			||||||
        uses: actions/publish-action@v0.2.2
 | 
					        uses: actions/publish-action@v0.3.0
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          source-tag: ${{ env.TAG_NAME }}
 | 
					          source-tag: ${{ env.TAG_NAME }}
 | 
				
			||||||
          slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
 | 
					          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:
 | 
					    strategy:
 | 
				
			||||||
      fail-fast: false
 | 
					      fail-fast: false
 | 
				
			||||||
      matrix:
 | 
					      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']
 | 
					        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:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					        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
 | 
					name: fast-xml-parser
 | 
				
			||||||
version: 4.3.6
 | 
					version: 4.4.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
 | 
					summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
 | 
				
			||||||
homepage:
 | 
					homepage:
 | 
				
			||||||
 | 
				
			|||||||
@ -308,6 +308,15 @@ build:
 | 
				
			|||||||
        cache: true
 | 
					        cache: true
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Recommended permissions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					When using the `setup-dotnet` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					permissions:
 | 
				
			||||||
 | 
					  contents: read # access to check out code and install dependencies
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## License
 | 
					## License
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
 | 
					The scripts and documentation in this project are released under the [MIT License](LICENSE)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										9
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							@ -81174,11 +81174,14 @@ function isCacheFeatureAvailable() {
 | 
				
			|||||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
					exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Returns this action runs on GitHub Enterprise Server or not.
 | 
					 * 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() {
 | 
					function isGhes() {
 | 
				
			||||||
    const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
 | 
					    const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
				
			||||||
    return new URL(url).hostname.toUpperCase() !== '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));
 | 
					            return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
 | 
				
			||||||
          } else if (attrStr.trim().length > 0) {
 | 
					          } else if (attrStr.trim().length > 0) {
 | 
				
			||||||
            return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
 | 
					            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 {
 | 
					          } else {
 | 
				
			||||||
            const otg = tags.pop();
 | 
					            const otg = tags.pop();
 | 
				
			||||||
            if (tagName !== otg.tagName) {
 | 
					            if (tagName !== otg.tagName) {
 | 
				
			||||||
@ -52082,6 +52084,7 @@ Builder.prototype.j2x = function(jObj, level) {
 | 
				
			|||||||
      //repeated nodes
 | 
					      //repeated nodes
 | 
				
			||||||
      const arrLen = jObj[key].length;
 | 
					      const arrLen = jObj[key].length;
 | 
				
			||||||
      let listTagVal = "";
 | 
					      let listTagVal = "";
 | 
				
			||||||
 | 
					      let listTagAttr = "";
 | 
				
			||||||
      for (let j = 0; j < arrLen; j++) {
 | 
					      for (let j = 0; j < arrLen; j++) {
 | 
				
			||||||
        const item = jObj[key][j];
 | 
					        const item = jObj[key][j];
 | 
				
			||||||
        if (typeof item === 'undefined') {
 | 
					        if (typeof item === 'undefined') {
 | 
				
			||||||
@ -52091,17 +52094,27 @@ Builder.prototype.j2x = function(jObj, level) {
 | 
				
			|||||||
          else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
 | 
					          else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
 | 
				
			||||||
          // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
 | 
					          // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
 | 
				
			||||||
        } else if (typeof item === 'object') {
 | 
					        } else if (typeof item === 'object') {
 | 
				
			||||||
          if(this.options.oneListGroup ){
 | 
					          if(this.options.oneListGroup){
 | 
				
			||||||
            listTagVal += this.j2x(item, level + 1).val;
 | 
					            const result = this.j2x(item, level + 1);
 | 
				
			||||||
 | 
					            listTagVal += result.val;
 | 
				
			||||||
 | 
					            if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
 | 
				
			||||||
 | 
					              listTagAttr += result.attrStr
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
          }else{
 | 
					          }else{
 | 
				
			||||||
            listTagVal += this.processTextOrObjNode(item, key, level)
 | 
					            listTagVal += this.processTextOrObjNode(item, key, level)
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        } 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){
 | 
					      if(this.options.oneListGroup){
 | 
				
			||||||
        listTagVal = this.buildObjectNode(listTagVal, key, '', level);
 | 
					        listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      val += listTagVal;
 | 
					      val += listTagVal;
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
@ -52911,10 +52924,18 @@ const parseXml = function(xmlData) {
 | 
				
			|||||||
          let tagContent = "";
 | 
					          let tagContent = "";
 | 
				
			||||||
          //self-closing tag
 | 
					          //self-closing tag
 | 
				
			||||||
          if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
 | 
					          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;
 | 
					            i = result.closeIndex;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          //unpaired tag
 | 
					          //unpaired tag
 | 
				
			||||||
          else if(this.options.unpairedTags.indexOf(tagName) !== -1){
 | 
					          else if(this.options.unpairedTags.indexOf(tagName) !== -1){
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
            i = result.closeIndex;
 | 
					            i = result.closeIndex;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          //normal tag
 | 
					          //normal tag
 | 
				
			||||||
@ -93612,11 +93633,14 @@ function isCacheFeatureAvailable() {
 | 
				
			|||||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
					exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Returns this action runs on GitHub Enterprise Server or not.
 | 
					 * 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() {
 | 
					function isGhes() {
 | 
				
			||||||
    const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
 | 
					    const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
				
			||||||
    return new URL(url).hostname.toUpperCase() !== '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,
 | 
					                allowRetries: true,
 | 
				
			||||||
                maxRetries: 3
 | 
					                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 result = response.result || {};
 | 
				
			||||||
            const releasesInfo = result['releases-index'];
 | 
					            const releasesInfo = result['releases-index'];
 | 
				
			||||||
            const releaseInfo = releasesInfo.find(info => {
 | 
					            const releaseInfo = releasesInfo.find(info => {
 | 
				
			||||||
@ -93797,7 +93827,8 @@ class DotnetVersionResolver {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.DotnetVersionResolver = 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 {
 | 
					class DotnetInstallScript {
 | 
				
			||||||
    constructor() {
 | 
					    constructor() {
 | 
				
			||||||
        this.scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh';
 | 
					        this.scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh';
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										707
									
								
								externals/install-dotnet.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										707
									
								
								externals/install-dotnet.ps1
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										129
									
								
								externals/install-dotnet.sh
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										129
									
								
								externals/install-dotnet.sh
									
									
									
									
										vendored
									
									
								
							@ -327,6 +327,14 @@ get_machine_architecture() {
 | 
				
			|||||||
            echo "loongarch64"
 | 
					            echo "loongarch64"
 | 
				
			||||||
            return 0
 | 
					            return 0
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					        riscv64)
 | 
				
			||||||
 | 
					            echo "riscv64"
 | 
				
			||||||
 | 
					            return 0
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					        powerpc|ppc)
 | 
				
			||||||
 | 
					            echo "ppc"
 | 
				
			||||||
 | 
					            return 0
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -415,11 +423,17 @@ get_normalized_architecture_for_specific_sdk_version() {
 | 
				
			|||||||
# args:
 | 
					# args:
 | 
				
			||||||
# version or channel - $1
 | 
					# version or channel - $1
 | 
				
			||||||
is_arm64_supported() {
 | 
					is_arm64_supported() {
 | 
				
			||||||
    #any channel or version that starts with the specified versions
 | 
					    # Extract the major version by splitting on the dot
 | 
				
			||||||
    case "$1" in
 | 
					    major_version="${1%%.*}"
 | 
				
			||||||
        ( "1"* | "2"* | "3"*  | "4"* | "5"*) 
 | 
					
 | 
				
			||||||
            echo false
 | 
					    # Check if the major version is a valid number and less than 6
 | 
				
			||||||
            return 0
 | 
					    case "$major_version" in
 | 
				
			||||||
 | 
					        [0-9]*)  
 | 
				
			||||||
 | 
					            if [ "$major_version" -lt 6 ]; then
 | 
				
			||||||
 | 
					                echo false
 | 
				
			||||||
 | 
					                return 0
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
    esac
 | 
					    esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo true
 | 
					    echo true
 | 
				
			||||||
@ -942,6 +956,37 @@ get_absolute_path() {
 | 
				
			|||||||
    return 0
 | 
					    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:
 | 
					# args:
 | 
				
			||||||
# input_files - stdin
 | 
					# input_files - stdin
 | 
				
			||||||
# root_path - $1
 | 
					# root_path - $1
 | 
				
			||||||
@ -953,15 +998,7 @@ copy_files_or_dirs_from_list() {
 | 
				
			|||||||
    local root_path="$(remove_trailing_slash "$1")"
 | 
					    local root_path="$(remove_trailing_slash "$1")"
 | 
				
			||||||
    local out_path="$(remove_trailing_slash "$2")"
 | 
					    local out_path="$(remove_trailing_slash "$2")"
 | 
				
			||||||
    local override="$3"
 | 
					    local override="$3"
 | 
				
			||||||
    local osname="$(get_current_os_name)"
 | 
					    local override_switch="$(get_cp_options "$override")"
 | 
				
			||||||
    local override_switch=$(
 | 
					 | 
				
			||||||
        if [ "$override" = false ]; then
 | 
					 | 
				
			||||||
            if [ "$osname" = "linux-musl" ]; then
 | 
					 | 
				
			||||||
                printf -- "-u";
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                printf -- "-n";
 | 
					 | 
				
			||||||
            fi
 | 
					 | 
				
			||||||
        fi)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cat | uniq | while read -r file_path; do
 | 
					    cat | uniq | while read -r file_path; do
 | 
				
			||||||
        local path="$(remove_beginning_slash "${file_path#$root_path}")"
 | 
					        local path="$(remove_beginning_slash "${file_path#$root_path}")"
 | 
				
			||||||
@ -1235,6 +1272,61 @@ downloadwget() {
 | 
				
			|||||||
    return 0
 | 
					    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() {
 | 
					get_download_link_from_aka_ms() {
 | 
				
			||||||
    eval $invocation
 | 
					    eval $invocation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1287,6 +1379,11 @@ get_download_link_from_aka_ms() {
 | 
				
			|||||||
            return 1
 | 
					            return 1
 | 
				
			||||||
        fi
 | 
					        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'."
 | 
					        say_verbose "The redirect location retrieved: '$aka_ms_download_link'."
 | 
				
			||||||
        return 0
 | 
					        return 0
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@ -1298,7 +1395,9 @@ get_download_link_from_aka_ms() {
 | 
				
			|||||||
get_feeds_to_use()
 | 
					get_feeds_to_use()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    feeds=(
 | 
					    feeds=(
 | 
				
			||||||
 | 
					    "https://builds.dotnet.microsoft.com/dotnet"
 | 
				
			||||||
    "https://dotnetcli.azureedge.net/dotnet"
 | 
					    "https://dotnetcli.azureedge.net/dotnet"
 | 
				
			||||||
 | 
					    "https://ci.dot.net/public"
 | 
				
			||||||
    "https://dotnetbuilds.azureedge.net/public"
 | 
					    "https://dotnetbuilds.azureedge.net/public"
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1727,7 +1826,7 @@ do
 | 
				
			|||||||
            zip_path="$1"
 | 
					            zip_path="$1"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        -?|--?|-h|--help|-[Hh]elp)
 | 
					        -?|--?|-h|--help|-[Hh]elp)
 | 
				
			||||||
            script_name="$(basename "$0")"
 | 
					            script_name="dotnet-install.sh"
 | 
				
			||||||
            echo ".NET Tools Installer"
 | 
					            echo ".NET Tools Installer"
 | 
				
			||||||
            echo "Usage:"
 | 
					            echo "Usage:"
 | 
				
			||||||
            echo "       # Install a .NET SDK of a given Quality from a given Channel"
 | 
					            echo "       # Install a .NET SDK of a given Quality from a given Channel"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										22
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										22
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -16,7 +16,7 @@
 | 
				
			|||||||
        "@actions/glob": "^0.4.0",
 | 
					        "@actions/glob": "^0.4.0",
 | 
				
			||||||
        "@actions/http-client": "^2.2.1",
 | 
					        "@actions/http-client": "^2.2.1",
 | 
				
			||||||
        "@actions/io": "^1.0.2",
 | 
					        "@actions/io": "^1.0.2",
 | 
				
			||||||
        "fast-xml-parser": "^4.3.6",
 | 
					        "fast-xml-parser": "^4.4.1",
 | 
				
			||||||
        "json5": "^2.2.3",
 | 
					        "json5": "^2.2.3",
 | 
				
			||||||
        "semver": "^7.6.0"
 | 
					        "semver": "^7.6.0"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
@ -2907,9 +2907,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/cross-spawn": {
 | 
					    "node_modules/cross-spawn": {
 | 
				
			||||||
      "version": "7.0.3",
 | 
					      "version": "7.0.6",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
 | 
				
			||||||
      "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
 | 
					      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "path-key": "^3.1.0",
 | 
					        "path-key": "^3.1.0",
 | 
				
			||||||
@ -3490,9 +3490,9 @@
 | 
				
			|||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/fast-xml-parser": {
 | 
					    "node_modules/fast-xml-parser": {
 | 
				
			||||||
      "version": "4.3.6",
 | 
					      "version": "4.4.1",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz",
 | 
				
			||||||
      "integrity": "sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==",
 | 
					      "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==",
 | 
				
			||||||
      "funding": [
 | 
					      "funding": [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          "type": "github",
 | 
					          "type": "github",
 | 
				
			||||||
@ -4795,12 +4795,12 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/micromatch": {
 | 
					    "node_modules/micromatch": {
 | 
				
			||||||
      "version": "4.0.5",
 | 
					      "version": "4.0.8",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
 | 
				
			||||||
      "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
 | 
					      "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "braces": "^3.0.2",
 | 
					        "braces": "^3.0.3",
 | 
				
			||||||
        "picomatch": "^2.3.1"
 | 
					        "picomatch": "^2.3.1"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "engines": {
 | 
					      "engines": {
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@
 | 
				
			|||||||
    "@actions/glob": "^0.4.0",
 | 
					    "@actions/glob": "^0.4.0",
 | 
				
			||||||
    "@actions/http-client": "^2.2.1",
 | 
					    "@actions/http-client": "^2.2.1",
 | 
				
			||||||
    "@actions/io": "^1.0.2",
 | 
					    "@actions/io": "^1.0.2",
 | 
				
			||||||
    "fast-xml-parser": "^4.3.6",
 | 
					    "fast-xml-parser": "^4.4.1",
 | 
				
			||||||
    "json5": "^2.2.3",
 | 
					    "json5": "^2.2.3",
 | 
				
			||||||
    "semver": "^7.6.0"
 | 
					    "semver": "^7.6.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
				
			|||||||
@ -90,9 +90,16 @@ export function isCacheFeatureAvailable(): boolean {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Returns this action runs on GitHub Enterprise Server or not.
 | 
					 * 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 {
 | 
					function isGhes(): boolean {
 | 
				
			||||||
  const url = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
 | 
					  const ghUrl = new URL(
 | 
				
			||||||
  return new URL(url).hostname.toUpperCase() !== 'GITHUB.COM';
 | 
					    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,
 | 
					      allowRetries: true,
 | 
				
			||||||
      maxRetries: 3
 | 
					      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 result = response.result || {};
 | 
				
			||||||
    const releasesInfo: any[] = result['releases-index'];
 | 
					    const releasesInfo: any[] = result['releases-index'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -122,6 +131,8 @@ export class DotnetVersionResolver {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  static DotnetCoreIndexUrl =
 | 
					  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';
 | 
					    'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user