mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-14 20:55:11 +00:00
Merge 4456588b5efffeb2ff495375ad05553b81c39f57 into bf4cd79173c0290c09af17cf9003ca2f32edea40
This commit is contained in:
commit
656850e3c8
3
.github/workflows/basic-validation.yml
vendored
3
.github/workflows/basic-validation.yml
vendored
@ -5,9 +5,6 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
|
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@ -2,8 +2,6 @@ name: Check dist/
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -2,9 +2,7 @@ name: CodeQL analysis
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * 0'
|
- cron: '0 3 * * 0'
|
||||||
|
|
||||||
|
103
.github/workflows/e2e-tests.yml
vendored
103
.github/workflows/e2e-tests.yml
vendored
@ -5,9 +5,6 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
@ -367,6 +364,106 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
|
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
|
||||||
|
|
||||||
|
test-setup-global-json-rollforward-latestmajor:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-22.04, windows-latest, macos-13]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Clear toolcache
|
||||||
|
shell: pwsh
|
||||||
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||||
|
- name: Write global.json
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir subdirectory
|
||||||
|
echo '{"sdk":{"version": "3.1.0","rollForward": "latestMajor"}}' > ./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 "^(?!3)"
|
||||||
|
|
||||||
|
test-setup-global-json-rollforward-latestminor:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-22.04, windows-latest, macos-13]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Clear toolcache
|
||||||
|
shell: pwsh
|
||||||
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||||
|
- name: Write global.json
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir subdirectory
|
||||||
|
echo '{"sdk":{"version": "3.0.100","rollForward": "latestMinor"}}' > ./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 "^3.1"
|
||||||
|
|
||||||
|
test-setup-global-json-rollforward-latestfeature:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-22.04, windows-latest, macos-13]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Clear toolcache
|
||||||
|
shell: pwsh
|
||||||
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||||
|
- name: Write global.json
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir subdirectory
|
||||||
|
echo '{"sdk":{"version": "3.1.100","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 "^3.1.4"
|
||||||
|
|
||||||
|
test-setup-global-json-rollforward-latestpatch:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-22.04, windows-latest, macos-13]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Clear toolcache
|
||||||
|
shell: pwsh
|
||||||
|
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
|
||||||
|
- name: Write global.json
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir subdirectory
|
||||||
|
echo '{"sdk":{"version": "5.0.400","rollForward": "latestPatch"}}' > ./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 "^5.0.408$"
|
||||||
|
|
||||||
test-setup-global-json-only:
|
test-setup-global-json-only:
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
|
4
.github/workflows/licensed.yml
vendored
4
.github/workflows/licensed.yml
vendored
@ -2,11 +2,7 @@ name: Licensed
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
3
.github/workflows/test-dotnet.yml
vendored
3
.github/workflows/test-dotnet.yml
vendored
@ -5,9 +5,6 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ $dotnetPaths = @{
|
|||||||
|
|
||||||
foreach ($srcPath in $dotnetPaths[$args[0]]) {
|
foreach ($srcPath in $dotnetPaths[$args[0]]) {
|
||||||
if (Test-Path $srcPath) {
|
if (Test-Path $srcPath) {
|
||||||
Write-Host "Move $srcPath path"
|
$dstPath = "$srcPath-" + [IO.Path]::GetRandomFileName()
|
||||||
$dstPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
|
Write-Host "Moving $srcPath to $dstPath"
|
||||||
Move-Item -Path $srcPath -Destination $dstPath
|
Move-Item -Path $srcPath -Destination $dstPath
|
||||||
}
|
}
|
||||||
}
|
}
|
18
dist/setup/index.js
vendored
18
dist/setup/index.js
vendored
@ -99799,9 +99799,23 @@ function getVersionFromGlobalJson(globalJsonPath) {
|
|||||||
if (globalJson.sdk && globalJson.sdk.version) {
|
if (globalJson.sdk && globalJson.sdk.version) {
|
||||||
version = globalJson.sdk.version;
|
version = globalJson.sdk.version;
|
||||||
const rollForward = globalJson.sdk.rollForward;
|
const rollForward = globalJson.sdk.rollForward;
|
||||||
if (rollForward && rollForward === 'latestFeature') {
|
if (rollForward) {
|
||||||
const [major, minor] = version.split('.');
|
const [major, minor, featurePatch] = version.split('.');
|
||||||
|
const feature = featurePatch.substring(0, 1);
|
||||||
|
switch (rollForward) {
|
||||||
|
case 'latestMajor':
|
||||||
|
version = '';
|
||||||
|
break;
|
||||||
|
case 'latestMinor':
|
||||||
|
version = `${major}`;
|
||||||
|
break;
|
||||||
|
case 'latestFeature':
|
||||||
version = `${major}.${minor}`;
|
version = `${major}.${minor}`;
|
||||||
|
break;
|
||||||
|
case 'latestPatch':
|
||||||
|
version = `${major}.${minor}.${feature}xx`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
|
@ -110,9 +110,27 @@ function getVersionFromGlobalJson(globalJsonPath: string): string {
|
|||||||
if (globalJson.sdk && globalJson.sdk.version) {
|
if (globalJson.sdk && globalJson.sdk.version) {
|
||||||
version = globalJson.sdk.version;
|
version = globalJson.sdk.version;
|
||||||
const rollForward = globalJson.sdk.rollForward;
|
const rollForward = globalJson.sdk.rollForward;
|
||||||
if (rollForward && rollForward === 'latestFeature') {
|
if (rollForward) {
|
||||||
const [major, minor] = version.split('.');
|
const [major, minor, featurePatch] = version.split('.');
|
||||||
|
const feature = featurePatch.substring(0, 1);
|
||||||
|
|
||||||
|
switch (rollForward) {
|
||||||
|
case 'latestMajor':
|
||||||
|
version = '';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'latestMinor':
|
||||||
|
version = `${major}`;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'latestFeature':
|
||||||
version = `${major}.${minor}`;
|
version = `${major}.${minor}`;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'latestPatch':
|
||||||
|
version = `${major}.${minor}.${feature}xx`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user