actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
952 stars 474 forks source link

Action install wrong version of dotnet #549

Closed curioyang closed 2 months ago

curioyang commented 2 months ago

Description: The action installed a LTS version of dotnet. But i specific .NET version 7.0

Task version: V4

Platform:

Runner type:

Repro steps:

  build-native:
    needs: [build-compiler]
    name: build-native-${{matrix.config.name}}
    runs-on: ${{matrix.config.os}}
    strategy:
      matrix:
        dotnet-version: ['7.0']
        config:
          # - {name: aarch64-macos, os: macos-14}
          - {name: x86_64-linux, os: ubuntu-latest}
          # - {name: x86_64-windows, os: windows-2019, arch: x64}

    steps:
    - uses: actions/checkout@v3
    - uses: seanmiddleditch/gha-setup-ninja@master

    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: ${{matrix.dotnet-version}}

Expected behavior: I just want to install dotnet-7.0 in my CI.

Actual behavior:

Run actions/setup-dotnet@v4
  with:
    dotnet-version: 7.0
    runtime-version: 7.0
    cache: false
/home/runner/work/_actions/actions/setup-dotnet/v[4](https://github.com/kendryte/nncase/actions/runs/10845061847/job/30095200229#step:4:4)/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '8.0.8' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --channel [7](https://github.com/kendryte/nncase/actions/runs/10845061847/job/30095200229#step:4:8).0
dotnet-install: .NET Core SDK with version '7.0.410' is already installed.

What should i do?

curioyang commented 2 months ago

Any error in my workflow?

curioyang commented 2 months ago
- name: Setup .NET
  uses: actions/setup-dotnet@v3
  with:
   dotnet-version: '7.0.x'

Worked!