From f05a62b1cc1ce829b6ca41f45b3b28f2c5b7c529 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 11:36:11 +0100 Subject: [PATCH 1/8] Update README.md to clarify installation process --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cec68e9..68d89ba 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ steps: 5.0.x - run: dotnet build ``` -> **Note**: In case multiple versions are installed, the latest .NET version will be used by default unless another version is specified in the `global.json` file. +> **Note**: Unless a conrete version is specified in the `global.json` file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Check the list of preinstalled .NET versions on a particular OS [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software). ## Supported version syntax From d8f1ab14a74cf395b91b2f323f8d72320e1755ea Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 11:38:26 +0100 Subject: [PATCH 2/8] Add link to global.json documentation ti README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68d89ba..9bd9279 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ steps: 5.0.x - run: dotnet build ``` -> **Note**: Unless a conrete version is specified in the `global.json` file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Check the list of preinstalled .NET versions on a particular OS [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software). +> **Note**: Unless a conrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Check the list of preinstalled .NET versions on a particular OS [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software). ## Supported version syntax From e21107efbd166d144ef265b6add73f5119283e0a Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 11:41:39 +0100 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bd9279..8fffcc3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ steps: 5.0.x - run: dotnet build ``` -> **Note**: Unless a conrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Check the list of preinstalled .NET versions on a particular OS [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software). +> **Note**: Unless a conrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version).Please refer to the documentation: [Software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for .NET SDK versions that are currently available. ## Supported version syntax From 80c862dc381a5cdb9ccfcbf4e4cdb65cf1cf9094 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 11:45:22 +0100 Subject: [PATCH 4/8] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8fffcc3..46a0319 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ This action sets up a [.NET CLI](https://github.com/dotnet/sdk) environment for > **Note**: GitHub hosted runners have some versions of the .NET SDK preinstalled. Installed versions are subject to change. Please refer to the -documentation -[software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) +documentation: +[Software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for .NET SDK versions that are currently available. ## Usage @@ -40,7 +40,7 @@ steps: 5.0.x - run: dotnet build ``` -> **Note**: Unless a conrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (incliding preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version).Please refer to the documentation: [Software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for .NET SDK versions that are currently available. +> **Note**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions. ## Supported version syntax From 014f8c8384136623001722cc5e268588ab60d42c Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 12:30:05 +0100 Subject: [PATCH 5/8] Add part about temporary global.json files --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 46a0319..8d20db0 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,31 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ matrix.dotnet }} - - run: dotnet build + - name: Execute dotnet + run: dotnet build +``` +>**Note**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). To control this behavior you may want to use temporary `global.json` files: + +**Matrix testing with temporary global.json creation** +```yml +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + dotnet: [ '2.1.x', '3.1.x', '5.0.x' ] + name: Dotnet ${{ matrix.dotnet }} sample + steps: + - uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + id: cp310 + with: + dotnet-version: ${{ matrix.dotnet }} + - name: Create temporary global.json + run: echo '{"sdk":{"version": "${{ steps.cp310.outputs.dotnet-version }}"}}' > ./global.json + - name: Execute dotnet + run: dotnet build ``` ## Setting up authentication for nuget feeds From 047f06d08673175b1162adc7efafe5154fefcd65 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 14:58:50 +0100 Subject: [PATCH 6/8] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8d20db0..b63bb29 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ steps: dotnet-version: '3.1.x' - run: dotnet build ``` +> **Warning**: ***Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions.*** **Multiple version installation**: ```yml @@ -40,8 +41,6 @@ steps: 5.0.x - run: dotnet build ``` -> **Note**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions. - ## Supported version syntax The `dotnet-version` input supports following syntax: From aefe5b483fa0f9a3c0224dd7c55f7beda1328842 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 15:03:30 +0100 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b63bb29..5efe14f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ steps: dotnet-version: '3.1.x' - run: dotnet build ``` -> **Warning**: ***Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions.*** +> **Warning**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, **_the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version)_**. Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions. **Multiple version installation**: ```yml From 13abe4777e40d0f2ed3596e2236fce47ca68966c Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Tue, 20 Dec 2022 15:31:56 +0100 Subject: [PATCH 8/8] Update step id naming --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5efe14f..87115c4 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,11 @@ jobs: - uses: actions/checkout@v3 - name: Setup dotnet uses: actions/setup-dotnet@v3 - id: cp310 + id: stepid with: dotnet-version: ${{ matrix.dotnet }} - name: Create temporary global.json - run: echo '{"sdk":{"version": "${{ steps.cp310.outputs.dotnet-version }}"}}' > ./global.json + run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json - name: Execute dotnet run: dotnet build ``` @@ -178,10 +178,10 @@ In case of a single version installation, the `dotnet-version` output contains t ```yaml - uses: actions/setup-dotnet@v3 - id: cp310 + id: stepid with: dotnet-version: 3.1.422 - - run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 3.1.422 + - run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 3.1.422 ``` **Multiple version installation** @@ -190,12 +190,12 @@ In case of a multiple version installation, the `dotnet-version` output contains ```yaml - uses: actions/setup-dotnet@v3 - id: cp310 + id: stepid with: dotnet-version: | 3.1.422 5.0.408 - - run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 5.0.408 + - run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 5.0.408 ``` **Installation from global.json** @@ -203,13 +203,13 @@ When the `dotnet-version` input is used along with the `global-json-file` input, ```yaml - uses: actions/setup-dotnet@v3 - id: cp310 + id: stepid with: dotnet-version: | 3.1.422 5.0.408 global-json-file: "./global.json" # contains version 2.2.207 - - run: echo '${{ steps.cp310.outputs.dotnet-version }}' # outputs 2.2.207 + - run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 2.2.207 ``` ## Environment variables