GithubHelp home page GithubHelp logo

Comments (4)

litetex avatar litetex commented on July 29, 2024

resolved in #80

from setup-dotnet.

nietras avatar nietras commented on July 29, 2024

@litetex I did try using the latest sdk version (as per https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json) in yml but this fails e.g.:

    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest, windows-latest, macos-latest ]
        dotnet: [ '5.0.100-preview.3.20216.6' ]
# ...
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ runner.dotnet }}

Am I specifying it wrong? :) Seems like the ${{ runner.dotnet }} is not unfolded correctly...

from setup-dotnet.

litetex avatar litetex commented on July 29, 2024

Okay I see the problem now.

@nietras
At first:
You should use ${{ matrix.dotnet }} instead of ${{ runner.dotnet }}.
For more info checkout the docs

Second: it seems like the input is not validated correctly
https://github.com/litetex/ConsoleApp1/runs/618343455

Run actions/setup-dotnet@v1
with:

So dotnet is installed without any version information - clearly the workflow should fail now but it doesn't.
The following dotnet restore reads:

Run dotnet restore

Welcome to .NET Core 3.1!

Because the github vm's are set up with dotnet:
https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners
e.g.:
https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md

The main error reason seems to be that https://github.com/actions/setup-dotnet/blob/master/action.yml

dotnet-version:
    description: 'SDK version to use. Example: 2.2.104'

does not match what's written in the source code

    //
    // Version is optional.  If supplied, install / use from the tool cache
    // If not supplied then task is still used to setup proxy, auth, etc...
    //

    let version = core.getInput('version');
    if (!version) {
      version = core.getInput('dotnet-version');
    }
    if (version) {
      const dotnetInstaller = new installer.DotnetCoreInstaller(version);
      await dotnetInstaller.installDotnet();
    }

    const sourceUrl: string = core.getInput('source-url');
    const configFile: string = core.getInput('config-file');
    if (sourceUrl) {
      auth.configAuthentication(sourceUrl, configFile);
    }
    // TODO: setup proxy from runner proxy config

    const matchersPath = path.join(__dirname, '..', '.github');
    console.log(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
  } catch (error) {
    core.setFailed(error.message);
  }

from setup-dotnet.

nietras avatar nietras commented on July 29, 2024

You should use ${{ matrix.dotnet }} instead of ${{ runner.dotnet }}.

@litetex thanks, yes it seems the source I copied this from got it wrong. I got the preview working but now my issue is you cannot install multiple sdks it seems, closing this though since setting up a preview version is not a problem :)

from setup-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.