mirror of
https://github.com/actions/setup-dotnet.git
synced 2026-06-17 14:35:58 +00:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0340d5064 |
4
.github/workflows/e2e-tests.yml
vendored
4
.github/workflows/e2e-tests.yml
vendored
@@ -273,14 +273,14 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir subdirectory
|
mkdir subdirectory
|
||||||
echo '{"sdk":{"version": "8.0.100","rollForward": "latestMajor"}}' > ./subdirectory/global.json
|
echo '{"sdk":{"version": "3.1.0","rollForward": "latestMajor"}}' > ./subdirectory/global.json
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
global-json-file: ./subdirectory/global.json
|
global-json-file: ./subdirectory/global.json
|
||||||
- name: Verify dotnet
|
- name: Verify dotnet
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: __tests__/verify-dotnet.ps1 -Patterns "^(?!8)"
|
run: __tests__/verify-dotnet.ps1 -Patterns "^(?!3)"
|
||||||
|
|
||||||
test-setup-global-json-rollforward-latestfeature:
|
test-setup-global-json-rollforward-latestfeature:
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ steps:
|
|||||||
working-directory: csharp
|
working-directory: csharp
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: The action supports `latest*` variants of the [rollForward](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#rollforward) field in `global.json`. When set to `latestPatch`, `latestFeature`, `latestMinor`, or `latestMajor`, the action installs the appropriate SDK version. For prerelease versions, the exact pinned version is always installed regardless of the `rollForward` setting.
|
> **Note**: The action supports `latest*` variants of the [rollForward](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#rollforward) field in `global.json`. When set to `latestPatch`, `latestFeature`, `latestMinor`, or `latestMajor`, the action installs the appropriate SDK version.
|
||||||
|
|
||||||
## Caching NuGet Packages
|
## Caching NuGet Packages
|
||||||
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching global packages data but requires less configuration settings. The `cache` input is optional, and caching is turned off by default.
|
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching global packages data but requires less configuration settings. The `cache` input is optional, and caching is turned off by default.
|
||||||
|
|||||||
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
@@ -79244,13 +79244,7 @@ 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 && !semver_1.default.prerelease(version)) {
|
if (rollForward) {
|
||||||
const versionPattern = /^\d+\.\d+\.[1-9]\d{2,}$/;
|
|
||||||
if (!versionPattern.test(version)) {
|
|
||||||
throw new Error(`Version '${version}' is not valid for the 'sdk.version' value in global.json. ` +
|
|
||||||
`When 'rollForward' is specified, a full SDK version is required. ` +
|
|
||||||
`See: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json`);
|
|
||||||
}
|
|
||||||
const [major, minor, featurePatch] = version.split('.');
|
const [major, minor, featurePatch] = version.split('.');
|
||||||
const feature = featurePatch.substring(0, 1);
|
const feature = featurePatch.substring(0, 1);
|
||||||
switch (rollForward) {
|
switch (rollForward) {
|
||||||
|
|||||||
30
package-lock.json
generated
30
package-lock.json
generated
@@ -3617,9 +3617,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-builder": {
|
"node_modules/fast-xml-builder": {
|
||||||
"version": "1.1.4",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz",
|
||||||
"integrity": "sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg==",
|
"integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -3628,7 +3628,8 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-expression-matcher": "^1.1.3"
|
"path-expression-matcher": "^1.5.0",
|
||||||
|
"xml-naming": "^0.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-parser": {
|
"node_modules/fast-xml-parser": {
|
||||||
@@ -5149,9 +5150,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-expression-matcher": {
|
"node_modules/path-expression-matcher": {
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz",
|
||||||
"integrity": "sha512-s4DQMxIdhj3jLFWd9LxHOplj4p9yQ4ffMGowFf3cpEgrrJjEhN0V5nxw4Ye1EViAGDoL4/1AeO6qHpqYPOzE4Q==",
|
"integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -6058,6 +6059,21 @@
|
|||||||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xml-naming": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/y18n": {
|
"node_modules/y18n": {
|
||||||
"version": "5.0.8",
|
"version": "5.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||||
|
|||||||
@@ -207,16 +207,7 @@ 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 && !semver.prerelease(version)) {
|
if (rollForward) {
|
||||||
const versionPattern = /^\d+\.\d+\.[1-9]\d{2,}$/;
|
|
||||||
if (!versionPattern.test(version)) {
|
|
||||||
throw new Error(
|
|
||||||
`Version '${version}' is not valid for the 'sdk.version' value in global.json. ` +
|
|
||||||
`When 'rollForward' is specified, a full SDK version is required. ` +
|
|
||||||
`See: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const [major, minor, featurePatch] = version.split('.');
|
const [major, minor, featurePatch] = version.split('.');
|
||||||
const feature = featurePatch.substring(0, 1);
|
const feature = featurePatch.substring(0, 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user