#691 - made possible to force install the latest version matching versionSpec

This commit is contained in:
Artur
2023-03-11 06:11:00 +01:00
parent 364926b235
commit 6f17d14286
56 changed files with 644 additions and 429 deletions

File diff suppressed because one or more lines are too long

View File

@@ -21,47 +21,54 @@
}
},
"instanceNameFormat": "gitreleasemanager/addasset",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "tagName",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the release"
}, {
"name": "assets",
"type": "multiLine",
"label": "Path(s) to the file(s) to include in the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "tagName",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the release"
},
{
"name": "assets",
"type": "multiLine",
"label": "Path(s) to the file(s) to include in the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,40 +21,46 @@
}
},
"instanceNameFormat": "gitreleasemanager/close",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,75 +21,86 @@
}
},
"instanceNameFormat": "gitreleasemanager/create",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": false,
"helpMarkDown": "The milestone to use"
}, {
"name": "name",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "The name of the release"
}, {
"name": "inputFilePath",
"type": "string",
"label": "The path to the file to be used as the content of the release notes",
"defaultValue": "",
"required": false,
"helpMarkDown": "The path to the file to be used as the content of the release notes"
}, {
"name": "isPreRelease",
"type": "boolean",
"label": "Creates the release as a pre-release",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Creates the release as a pre-release"
}, {
"name": "targetcommitish",
"type": "string",
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
"defaultValue": "",
"required": false,
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}, {
"name": "assets",
"type": "multiLine",
"label": "Path(s) to the file(s) to include in the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": false,
"helpMarkDown": "The milestone to use"
},
{
"name": "name",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "The name of the release"
},
{
"name": "inputFilePath",
"type": "string",
"label": "The path to the file to be used as the content of the release notes",
"defaultValue": "",
"required": false,
"helpMarkDown": "The path to the file to be used as the content of the release notes"
},
{
"name": "isPreRelease",
"type": "boolean",
"label": "Creates the release as a pre-release",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Creates the release as a pre-release"
},
{
"name": "targetcommitish",
"type": "string",
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
"defaultValue": "",
"required": false,
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
},
{
"name": "assets",
"type": "multiLine",
"label": "Path(s) to the file(s) to include in the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,40 +21,46 @@
}
},
"instanceNameFormat": "gitreleasemanager/discard",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,40 +21,46 @@
}
},
"instanceNameFormat": "gitreleasemanager/open",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,40 +21,46 @@
}
},
"instanceNameFormat": "gitreleasemanager/publish",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "tagName",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the release"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
"inputs": [
{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
},
{
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
},
{
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
},
{
"name": "tagName",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the release"
},
{
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,7 +21,8 @@
}
},
"instanceNameFormat": "gitreleasemanager/setup",
"inputs": [{
"inputs": [
{
"name": "versionSpec",
"type": "string",
"label": "The version spec",
@@ -44,6 +45,14 @@
"defaultValue": "false",
"required": false,
"helpMarkDown": "Treat package source failures as warnings"
},
{
"name": "preferLatestVersion",
"type": "boolean",
"label": "Prefer latest version",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Prefer to download the latest version matching the versionSpec, even if there is a local cached version."
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -21,7 +21,8 @@
}
},
"instanceNameFormat": "gitversion/execute",
"groups": [{
"groups": [
{
"name": "gitversionDetails",
"displayName": "GitVersion details",
"isExpanded": true
@@ -32,7 +33,8 @@
"isExpanded": false
}
],
"inputs": [{
"inputs": [
{
"name": "targetPath",
"type": "string",
"label": "Working directory path",

File diff suppressed because one or more lines are too long

View File

@@ -21,7 +21,8 @@
}
},
"instanceNameFormat": "gitversion/setup",
"inputs": [{
"inputs": [
{
"name": "versionSpec",
"type": "string",
"label": "The version spec",
@@ -44,6 +45,14 @@
"defaultValue": "false",
"required": false,
"helpMarkDown": "Treat package source failures as warnings"
},
{
"name": "preferLatestVersion",
"type": "boolean",
"label": "Prefer latest version",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Prefer to download the latest version matching the versionSpec, even if there is a local cached version."
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- task: gitreleasemanager/close@0
- task: gitreleasemanager/close@0
inputs:
token: '$(GITHUB_TOKEN)'
owner: 'someOwner'

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- task: gitreleasemanager/open@0
- task: gitreleasemanager/open@0
inputs:
token: '$(GITHUB_TOKEN)'
owner: 'someOwner'

View File

@@ -226,18 +226,19 @@ steps:
Calculate the version for the build and use the `GitVersion.BranchName` variable in a condition for starting another job.
```yaml
job: CalculateVersion
displayName: Calculate version using GitVersion
steps:
# gitversion/setup@0 task omitted for brevity.
jobs:
- job: CalculateVersion
displayName: Calculate version using GitVersion
steps:
# gitversion/setup@0 task omitted for brevity.
- task: gitversion/execute@0
displayName: Use GitVersion
name: Version # the step MUST be named to access its output variables in another job.
- task: gitversion/execute@0
displayName: Use GitVersion
name: Version # the step MUST be named to access its output variables in another job.
job: CreateReleaseNotes
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion.BranchName'], 'main'))
dependsOn: CalculateVersion
- job: CreateReleaseNotes
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion.BranchName'], 'main'))
dependsOn: CalculateVersion
```
### Example 8
@@ -245,18 +246,19 @@ dependsOn: CalculateVersion
Calculate the version for the build and map the `GitVersion.SemVer` variable into a variable in another job.
```yaml
job: CalculateVersion
displayName: Calculate version using GitVersion
steps:
# gitversion/setup@0 task omitted for brevity.
jobs:
- job: CalculateVersion
displayName: Calculate version using GitVersion
steps:
# gitversion/setup@0 task omitted for brevity.
- task: gitversion/execute@0
displayName: Use GitVersion
name: Version # the step MUST be named to access its output variables in another job.
- task: gitversion/execute@0
displayName: Use GitVersion
name: Version # the step MUST be named to access its output variables in another job.
job: BuildAndPack
variables:
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion.MajorMinorPatch'] ]
- job: BuildAndPack
variables:
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion.MajorMinorPatch'] ]
```
### Example 9

View File

@@ -21,6 +21,10 @@ ignoreFailedSources:
description: Treat package source failures as warnings.
required: false
default: false
preferLatestVersion:
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
required: false
default: 'false'
```
---
@@ -63,3 +67,16 @@ steps:
versionSpec: '6.x'
includePrerelease: true
```
### Example 4
Install the latest GitVersion 5 version even it there is a cached version matching the versionSpec.
```yaml
steps:
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
preferLatestVersion: true
```

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/addasset@v0.9.2
- uses: gittools/actions/gitreleasemanager/addassetv0
name: Add asset to a release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/close@v0.9.2
- uses: gittools/actions/gitreleasemanager/closev0
name: Close release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/create@v0.9.2
- uses: gittools/actions/gitreleasemanager/createv0
name: Create release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/discard@v0.9.2
- uses: gittools/actions/gitreleasemanager/discardv0
name: Discard release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/open@v0.9.2
- uses: gittools/actions/gitreleasemanager/openv0
name: Open release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/publish@v0.9.2
- uses: gittools/actions/gitreleasemanager/publishv0
name: Publish release with GitReleaseManager
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,7 +2,7 @@
```yaml
steps:
- uses: gittools/actions/gitreleasemanager/setup@v0.9.2
- uses: gittools/actions/gitreleasemanager/setupv0
name: Install GitReleaseManager
with:
versionSpec: '0.10.x'

View File

@@ -100,10 +100,10 @@ Calculate the version for the build.
```yaml
steps:
# gitversion/setup@v0.9.7 action omitted for brevity.
# gitversion/setup@v0 action omitted for brevity.
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
```
### Example 2
@@ -113,7 +113,7 @@ Calculate the version for the build using a config file with the default name **
```yaml
steps:
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
```
@@ -135,10 +135,10 @@ Calculate the version for the build using a config file named **VersionConfig.ym
```yaml
steps:
# gitversion/setup@v0.9.7 action omitted for brevity.
# gitversion/setup@v0 action omitted for brevity.
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
configFilePath: VersionConfig.yml
@@ -150,10 +150,10 @@ Show the effective configuration for GitVersion by running the **/showConfig** c
```yaml
steps:
# gitversion/setup@v0.9.7 action omitted for brevity.
# gitversion/setup@v0 action omitted for brevity.
- name: Display GitVersion config
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
additionalArguments: '/showConfig'
@@ -165,11 +165,11 @@ Calculate the version for the build and display all the calculated variables in
```yaml
steps:
# gitversion/setup@v0.9.7 action omitted for brevity.
# gitversion/setup@v0 action omitted for brevity.
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
- name: Display GitVersion outputs
run: |
@@ -213,10 +213,10 @@ Calculate the version for the build and display the value of the `GITVERSION_SEM
```yaml
steps:
# gitversion/setup@v0.9.7 action omitted for brevity.
# gitversion/setup@v0 action omitted for brevity.
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
- name: Display SemVer
run: |
@@ -239,7 +239,7 @@ jobs:
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
create-release-notes:
name: Create Release Notes
@@ -268,7 +268,7 @@ jobs:
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0
display-semver:
name: Display Semantic Version

View File

@@ -34,7 +34,7 @@ Install the latest GitVersion 5 version.
```yaml
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
```
@@ -46,7 +46,7 @@ Install GitVersion 5.5.0.
```yaml
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.5.0'
```
@@ -58,8 +58,21 @@ Install the latest GitVersion 6 pre-release version. For example **6.0.0-beta1.
```yaml
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '6.x'
includePrerelease: true
```
### Example 4
Install the latest GitVersion 5 version even it there is a cached version matching the versionSpec.
```yaml
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
```

View File

@@ -20,3 +20,7 @@ inputs:
description: Treat package source failures as warnings.
required: false
default: 'false'
preferLatestVersion:
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
required: false
default: 'false'

View File

@@ -20,3 +20,7 @@ inputs:
description: Treat package source failures as warnings.
required: false
default: 'false'
preferLatestVersion:
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
required: false
default: 'false'

View File

@@ -4,13 +4,13 @@ import * as path from 'path'
import * as http from 'typed-rest-client/HttpClient'
import { inject, injectable } from 'inversify'
import { TYPES, IExecResult, IBuildAgent } from './models'
import { IBuildAgent, IExecResult, TYPES } from './models'
import { IVersionManager } from './versionManager'
import { ISetupSettings } from '../tools/common/models'
export interface IDotnetTool {
disableTelemetry(): void
toolInstall(toolName: string, checkLatest: boolean, setupSettings: ISetupSettings): Promise<string>
toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string>
}
@injectable()
@@ -37,13 +37,14 @@ export class DotnetTool implements IDotnetTool {
return this.buildAgent.exec(cmd, args)
}
public async toolInstall(toolName: string, checkLatest: boolean, setupSettings: ISetupSettings): Promise<string> {
public async toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string> {
console.log('')
console.log('--------------------------')
console.log(`Acquiring ${toolName} version spec: ${setupSettings.versionSpec}`)
console.log('--------------------------')
let version: string
let checkLatest = setupSettings.preferLatestVersion
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
checkLatest = false // check latest doesn't make sense when explicit version
version = setupSettings.versionSpec

View File

@@ -1,13 +1,15 @@
export enum SetupFields {
includePrerelease = 'includePrerelease',
versionSpec = 'versionSpec',
ignoreFailedSources = 'ignoreFailedSources'
ignoreFailedSources = 'ignoreFailedSources',
preferLatestVersion = 'preferLatestVersion'
}
export interface ISetupSettings {
[SetupFields.versionSpec]: string
[SetupFields.includePrerelease]: boolean
[SetupFields.ignoreFailedSources]: boolean
[SetupFields.preferLatestVersion]: boolean
}
export interface ISettingsProvider {

View File

@@ -10,11 +10,13 @@ export class SettingsProvider implements ISettingsProvider {
const versionSpec = this.buildAgent.getInput(SetupFields.versionSpec)
const includePrerelease = this.buildAgent.getBooleanInput(SetupFields.includePrerelease)
const ignoreFailedSources = this.buildAgent.getBooleanInput(SetupFields.ignoreFailedSources)
const preferLatestVersion = this.buildAgent.getBooleanInput(SetupFields.preferLatestVersion)
return {
versionSpec,
includePrerelease,
ignoreFailedSources
ignoreFailedSources,
preferLatestVersion
}
}
}

View File

@@ -33,7 +33,7 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
}
public async install(setupSettings: ISetupSettings): Promise<void> {
await this.toolInstall('GitReleaseManager.Tool', false, setupSettings)
await this.toolInstall('GitReleaseManager.Tool', setupSettings)
}
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {

View File

@@ -18,7 +18,7 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
}
public async install(setupSettings: ISetupSettings): Promise<void> {
await this.toolInstall('GitVersion.Tool', false, setupSettings)
await this.toolInstall('GitVersion.Tool', setupSettings)
}
public run(options: GitVersionSettings): Promise<IExecResult> {
@@ -149,7 +149,7 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
}
private toCamelCase(input: string): string {
return input.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, index) {
return input.replace(/^\w|[A-Z]|\b\w|\s+/g, function (match, index) {
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
return index == 0 ? match.toLowerCase() : match.toUpperCase()
})