6 Commits

Author SHA1 Message Date
Artur
a41619580c potential fix for #815 2023-03-11 14:00:45 +01:00
Artur
cdf70088b7 Merge pull request #814 from GitTools/feature/691 2023-03-11 13:46:49 +01:00
Artur
b30860fe81 Merge pull request #813 from GitTools/bug/730 2023-03-11 13:45:50 +01:00
Artur
1a99526cb9 Merge pull request #812 from GitTools/bug/prerelease
Made possible to install a pre-release version
2023-03-11 13:44:42 +01:00
Artur
efc58b37fa dist update 2023-03-11 13:42:20 +01:00
dependabot[bot]
f5dd295d84 Revert "Bump azure-pipelines-task-lib from 3.3.1 to 4.3.0"
This reverts commit 63ce78cb3b.

Revert "Bump azure-pipelines-task-lib from 4.1.0 to 4.2.0"

This reverts commit 0bed6f31b0.

Revert "Bump azure-pipelines-task-lib from 4.0.2 to 4.1.0"

This reverts commit a067ae8ab3.

Revert "Bump azure-pipelines-task-lib from 3.3.1 to 4.0.2"

This reverts commit 0c607cf87e.
2023-03-11 13:42:20 +01:00
84 changed files with 124467 additions and 98260 deletions

View File

@@ -8,6 +8,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = off
[*.yml]
indent_size = 2

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ node_modules/
*.js
!dist/**/*.js
*.vsix
.idea/

View File

@@ -1,5 +1,5 @@
{
"printWidth": 80,
"printWidth": 160,
"tabWidth": 4,
"useTabs": false,
"semi": false,

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'

308
package-lock.json generated
View File

@@ -13,16 +13,17 @@
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1",
"azure-pipelines-task-lib": "^4.3.0",
"azure-pipelines-task-lib": "^3.3.1",
"azure-pipelines-tool-lib": "^1.3.2",
"inversify": "^6.0.1",
"semver": "^7.3.8",
"typed-rest-client": "^1.8.9",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.15.0",
"@types/q": "^1.5.5",
"@types/semver-compare": "^1.0.1",
"@types/semver": "^7.3.13",
"@types/uuid": "^9.0.1",
"minimist": "^1.2.8",
"prettier": "^2.8.4",
@@ -286,14 +287,9 @@
"integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA=="
},
"node_modules/@types/semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
},
"node_modules/@types/semver-compare": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/semver-compare/-/semver-compare-1.0.1.tgz",
"integrity": "sha512-wx2LQVvKlEkhXp/HoKIZ/aSL+TvfJdKco8i0xJS3aR877mg4qBHzNT6+B5a61vewZHo79EdZavskGnRXEC2H6A==",
"version": "7.3.13",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz",
"integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
"dev": true
},
"node_modules/@types/uuid": {
@@ -649,12 +645,12 @@
}
},
"node_modules/azure-pipelines-task-lib": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.3.0.tgz",
"integrity": "sha512-kmOyGE1kuRaWwXYZ5MfA8Q8Awt7aAUExG6w40aos6Y3G0/RlTCeB+5H4oYpoiNB0g8MPYhWG7SM5i6PLycWs1A==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.3.1.tgz",
"integrity": "sha512-56ZAr4MHIoa24VNVuwPL4iUQ5MKaigPoYXkBG8E8fiVmh8yZdatUo25meNoQwg77vDY22F63Q44UzXoMWmy7ag==",
"dependencies": {
"minimatch": "3.0.5",
"mockery": "^2.1.0",
"mockery": "^1.7.0",
"q": "^1.5.1",
"semver": "^5.1.0",
"shelljs": "^0.8.5",
@@ -662,6 +658,14 @@
"uuid": "^3.0.1"
}
},
"node_modules/azure-pipelines-task-lib/node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/azure-pipelines-task-lib/node_modules/uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
@@ -684,30 +688,24 @@
"uuid": "^3.3.2"
}
},
"node_modules/azure-pipelines-tool-lib/node_modules/@types/semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
},
"node_modules/azure-pipelines-tool-lib/node_modules/@types/uuid": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.9.tgz",
"integrity": "sha512-XDwyIlt/47l2kWLTzw/mtrpLdB+GPSskR2n/PIcPn+VYhVO77rGhRncIR5GPU0KRzXuqkDO+J5qqrG0Y8P6jzQ=="
},
"node_modules/azure-pipelines-tool-lib/node_modules/azure-pipelines-task-lib": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.3.1.tgz",
"integrity": "sha512-56ZAr4MHIoa24VNVuwPL4iUQ5MKaigPoYXkBG8E8fiVmh8yZdatUo25meNoQwg77vDY22F63Q44UzXoMWmy7ag==",
"dependencies": {
"minimatch": "3.0.5",
"mockery": "^1.7.0",
"q": "^1.5.1",
"semver": "^5.1.0",
"shelljs": "^0.8.5",
"sync-request": "6.1.0",
"uuid": "^3.0.1"
"node_modules/azure-pipelines-tool-lib/node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/azure-pipelines-tool-lib/node_modules/mockery": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz",
"integrity": "sha512-gUQA33ayi0tuAhr/rJNZPr7Q7uvlBt4gyJPbi0CDcAfIzIrDu1YgGMFgmAu3stJqBpK57m7+RxUbcS+pt59fKQ=="
},
"node_modules/azure-pipelines-tool-lib/node_modules/uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
@@ -2084,9 +2082,9 @@
}
},
"node_modules/mockery": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz",
"integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA=="
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz",
"integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8="
},
"node_modules/mute-stream": {
"version": "0.0.8",
@@ -2118,39 +2116,6 @@
"validate-npm-package-license": "^3.0.1"
}
},
"node_modules/normalize-package-data/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/normalize-package-data/node_modules/semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/normalize-package-data/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
@@ -2532,6 +2497,15 @@
"validate-npm-package-license": "^3.0.1"
}
},
"node_modules/read-pkg/node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true,
"bin": {
"semver": "bin/semver"
}
},
"node_modules/read-pkg/node_modules/type-fest": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
@@ -2674,11 +2648,17 @@
}
},
"node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver"
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/semver-compare": {
@@ -2686,6 +2666,22 @@
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w="
},
"node_modules/semver/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/semver/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/serialize-javascript": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
@@ -3249,33 +3245,6 @@
"node": ">=8"
}
},
"node_modules/ts-loader/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ts-loader/node_modules/semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ts-loader/node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -3288,12 +3257,6 @@
"node": ">=8"
}
},
"node_modules/ts-loader/node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
@@ -3977,14 +3940,9 @@
"integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA=="
},
"@types/semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
},
"@types/semver-compare": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/semver-compare/-/semver-compare-1.0.1.tgz",
"integrity": "sha512-wx2LQVvKlEkhXp/HoKIZ/aSL+TvfJdKco8i0xJS3aR877mg4qBHzNT6+B5a61vewZHo79EdZavskGnRXEC2H6A==",
"version": "7.3.13",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz",
"integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
"dev": true
},
"@types/uuid": {
@@ -4299,12 +4257,12 @@
}
},
"azure-pipelines-task-lib": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.3.0.tgz",
"integrity": "sha512-kmOyGE1kuRaWwXYZ5MfA8Q8Awt7aAUExG6w40aos6Y3G0/RlTCeB+5H4oYpoiNB0g8MPYhWG7SM5i6PLycWs1A==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.3.1.tgz",
"integrity": "sha512-56ZAr4MHIoa24VNVuwPL4iUQ5MKaigPoYXkBG8E8fiVmh8yZdatUo25meNoQwg77vDY22F63Q44UzXoMWmy7ag==",
"requires": {
"minimatch": "3.0.5",
"mockery": "^2.1.0",
"mockery": "^1.7.0",
"q": "^1.5.1",
"semver": "^5.1.0",
"shelljs": "^0.8.5",
@@ -4312,6 +4270,11 @@
"uuid": "^3.0.1"
},
"dependencies": {
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
@@ -4333,29 +4296,20 @@
"uuid": "^3.3.2"
},
"dependencies": {
"@types/semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
},
"@types/uuid": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.9.tgz",
"integrity": "sha512-XDwyIlt/47l2kWLTzw/mtrpLdB+GPSskR2n/PIcPn+VYhVO77rGhRncIR5GPU0KRzXuqkDO+J5qqrG0Y8P6jzQ=="
},
"azure-pipelines-task-lib": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.3.1.tgz",
"integrity": "sha512-56ZAr4MHIoa24VNVuwPL4iUQ5MKaigPoYXkBG8E8fiVmh8yZdatUo25meNoQwg77vDY22F63Q44UzXoMWmy7ag==",
"requires": {
"minimatch": "3.0.5",
"mockery": "^1.7.0",
"q": "^1.5.1",
"semver": "^5.1.0",
"shelljs": "^0.8.5",
"sync-request": "6.1.0",
"uuid": "^3.0.1"
}
},
"mockery": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz",
"integrity": "sha512-gUQA33ayi0tuAhr/rJNZPr7Q7uvlBt4gyJPbi0CDcAfIzIrDu1YgGMFgmAu3stJqBpK57m7+RxUbcS+pt59fKQ=="
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
},
"uuid": {
"version": "3.4.0",
@@ -5482,9 +5436,9 @@
"dev": true
},
"mockery": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz",
"integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA=="
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz",
"integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8="
},
"mute-stream": {
"version": "0.0.8",
@@ -5514,32 +5468,6 @@
"resolve": "^1.20.0",
"semver": "^7.3.4",
"validate-npm-package-license": "^3.0.1"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
}
}
},
"normalize-path": {
@@ -5815,6 +5743,12 @@
"validate-npm-package-license": "^3.0.1"
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"type-fest": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
@@ -5947,9 +5881,27 @@
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"requires": {
"lru-cache": "^6.0.0"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"semver-compare": {
"version": "1.0.0",
@@ -6397,24 +6349,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -6423,12 +6357,6 @@
"requires": {
"has-flag": "^4.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
}
}
},

View File

@@ -30,16 +30,17 @@
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1",
"azure-pipelines-task-lib": "^4.3.0",
"azure-pipelines-task-lib": "^3.3.1",
"azure-pipelines-tool-lib": "^1.3.2",
"inversify": "^6.0.1",
"semver": "^7.3.8",
"typed-rest-client": "^1.8.9",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.15.0",
"@types/q": "^1.5.5",
"@types/semver-compare": "^1.0.1",
"@types/semver": "^7.3.13",
"@types/uuid": "^9.0.1",
"minimist": "^1.2.8",
"prettier": "^2.8.4",

View File

@@ -24,12 +24,7 @@ class BuildAgent implements IBuildAgent {
return toolLib.findLocalTool(toolName, versionSpec, arch)
}
public cacheDir(
sourceDir: string,
tool: string,
version: string,
arch?: string
): Promise<string> {
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
return toolLib.cacheDir(sourceDir, tool, version, arch)
}

View File

@@ -12,10 +12,7 @@ import * as toolCache from '@actions/tool-cache'
import { injectable } from 'inversify'
import { IBuildAgent, IExecResult } from '../../core/models'
import {
IRequestOptions,
IProxyConfiguration
} from 'typed-rest-client/Interfaces'
import { IRequestOptions, IProxyConfiguration } from 'typed-rest-client/Interfaces'
@injectable()
class BuildAgent implements IBuildAgent {
@@ -58,12 +55,7 @@ class BuildAgent implements IBuildAgent {
return undefined
}
let proxyURL =
process.env.HTTP_PROXY ||
process.env.http_proxy ||
process.env.HTTPS_PROXY ||
process.env.https_proxy ||
null
let proxyURL = process.env.HTTP_PROXY || process.env.http_proxy || process.env.HTTPS_PROXY || process.env.https_proxy || null
if (proxyURL) {
let url = new urlApi.URL(requestedUrl)
@@ -78,12 +70,7 @@ class BuildAgent implements IBuildAgent {
return undefined
}
public cacheDir(
sourceDir: string,
tool: string,
version: string,
arch?: string
): Promise<string> {
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
return toolCache.cacheDir(sourceDir, tool, version, arch)
}

View File

@@ -19,12 +19,7 @@ class BuildAgent implements IBuildAgent {
return 'find'
}
public cacheDir(
sourceDir: string,
tool: string,
version: string,
arch?: string
): Promise<string> {
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
console.log('cacheDir')
return Promise.resolve('cacheDir')
}

View File

@@ -4,16 +4,13 @@ import * as path from 'path'
import * as http from 'typed-rest-client/HttpClient'
import { inject, injectable } from 'inversify'
import { TYPES, IExecResult, IBuildAgent, ISetupSettings } 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()
@@ -22,20 +19,12 @@ export class DotnetTool implements IDotnetTool {
protected versionManager: IVersionManager
private httpClient: http.HttpClient
private static readonly nugetRoot: string =
'https://api-v2v3search-0.nuget.org/'
private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/'
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@inject(TYPES.IVersionManager) versionManager: IVersionManager
) {
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
this.buildAgent = buildAgent
this.versionManager = versionManager
this.httpClient = new http.HttpClient(
'dotnet',
undefined,
this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot)
)
this.httpClient = new http.HttpClient('dotnet', undefined, this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot))
}
public disableTelemetry(): void {
@@ -48,20 +37,17 @@ 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(
`Installing ${toolName} version ` + setupSettings.versionSpec
)
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
}
let toolPath: string
@@ -73,10 +59,7 @@ export class DotnetTool implements IDotnetTool {
}
if (!toolPath) {
let version: string
if (
this.versionManager.isExplicitVersion(setupSettings.versionSpec)
) {
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
//
// Explicit version was specified. No need to query for list of versions.
//
@@ -88,15 +71,9 @@ export class DotnetTool implements IDotnetTool {
// If your tool doesn't offer a mechanism to query,
// then it can only support exact version inputs.
//
version = await this.queryLatestMatch(
toolName,
setupSettings.versionSpec,
setupSettings.includePrerelease
)
version = await this.queryLatestMatch(toolName, setupSettings.versionSpec, setupSettings.includePrerelease)
if (!version) {
throw new Error(
`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`
)
throw new Error(`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`)
}
//
@@ -108,24 +85,20 @@ export class DotnetTool implements IDotnetTool {
//
// Download, extract, cache
//
toolPath = await this.acquireTool(
toolName,
version,
setupSettings.ignoreFailedSources
)
toolPath = await this.acquireTool(toolName, version, setupSettings.ignoreFailedSources)
}
}
console.log('--------------------------')
console.log(`${toolName} version: ${version} installed.`)
console.log('--------------------------')
//
// Prepend the tools path. This prepends the PATH for the current process and
// instructs the agent to prepend for each task that follows.
//
this.buildAgent.debug(`toolPath: ${toolPath}`)
if (
os.platform() !== 'win32' &&
!this.buildAgent.getVariable('DOTNET_ROOT')
) {
if (os.platform() !== 'win32' && !this.buildAgent.getVariable('DOTNET_ROOT')) {
let dotnetPath = await this.buildAgent.which('dotnet')
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
const dotnetRoot = path.dirname(dotnetPath)
@@ -136,22 +109,14 @@ export class DotnetTool implements IDotnetTool {
return toolPath
}
private async queryLatestMatch(
toolName: string,
versionSpec: string,
includePrerelease: boolean
): Promise<string> {
private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise<string> {
this.buildAgent.debug(
`querying tool versions for ${toolName}${
versionSpec ? `@${versionSpec}` : ''
} ${includePrerelease ? 'including pre-releases' : ''}`
`querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ''} ${includePrerelease ? 'including pre-releases' : ''}`
)
const downloadPath = `${
DotnetTool.nugetRoot
}query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${
includePrerelease ? 'true' : 'false'
}&semVerLevel=2.0.0`
const toolNameParam = encodeURIComponent(toolName.toLowerCase())
const prereleaseParam = includePrerelease ? 'true' : 'false'
const downloadPath = `${DotnetTool.nugetRoot}query?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
const res = await this.httpClient.get(downloadPath)
@@ -162,23 +127,19 @@ export class DotnetTool implements IDotnetTool {
const body: string = await res.readBody()
const data = JSON.parse(body).data
const versions = (data[0].versions as { version: string }[]).map(
x => x.version
)
const versions = (data[0].versions as { version: string }[]).map(x => x.version)
if (!versions || !versions.length) {
return null
}
this.buildAgent.debug(`got versions: ${versions.join(', ')}`)
return this.versionManager.evaluateVersions(versions, versionSpec)
return this.versionManager.evaluateVersions(versions, versionSpec, {
includePrerelease
})
}
private async acquireTool(
toolName: string,
version: string,
ignoreFailedSources: boolean
): Promise<string> {
private async acquireTool(toolName: string, version: string, ignoreFailedSources: boolean): Promise<string> {
const tempDirectory = await this.buildAgent.createTempDir()
let args = ['tool', 'install', toolName, '--tool-path', tempDirectory]

View File

@@ -5,19 +5,9 @@ export const TYPES = {
IDotnetTool: Symbol.for('DotnetTool'),
IGitVersionTool: Symbol.for('GitVersionTool'),
IGitReleaseManagerTool: Symbol.for('GitReleaseManagerTool'),
IVersionManager: Symbol.for('VersionManager')
}
export enum SetupFields {
includePrerelease = 'includePrerelease',
versionSpec = 'versionSpec',
ignoreFailedSources = 'ignoreFailedSources'
}
export interface ISetupSettings {
[SetupFields.versionSpec]: string
[SetupFields.includePrerelease]: boolean
[SetupFields.ignoreFailedSources]: boolean
IVersionManager: Symbol.for('VersionManager'),
IGitVersionSettingsProvider: Symbol.for('GitVersionSettingsProvider'),
IGitReleaseManagerSettingsProvider: Symbol.for('GitReleaseManagerSettingsProvider')
}
export interface IExecResult {
@@ -26,17 +16,11 @@ export interface IExecResult {
code: number
error: Error
}
export interface IBuildAgent {
agentName: string
proxyConfiguration(url: string): IRequestOptions
find(toolName: string, versionSpec: string, arch?: string): string
cacheDir(
sourceDir: string,
tool: string,
version: string,
arch?: string
): Promise<string>
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>
createTempDir(): Promise<string>
debug(message: string): void
setFailed(message: string, done?: boolean): void

View File

@@ -1,19 +0,0 @@
import { IBuildAgent, SetupFields, ISetupSettings } from './models'
export class Settings {
public static getSetupSettings(buildAgent: IBuildAgent): ISetupSettings {
const versionSpec = buildAgent.getInput(SetupFields.versionSpec)
const includePrerelease = buildAgent.getBooleanInput(
SetupFields.includePrerelease
)
const ignoreFailedSources = buildAgent.getBooleanInput(
SetupFields.ignoreFailedSources
)
return {
versionSpec,
includePrerelease,
ignoreFailedSources
}
}
}

View File

@@ -1,4 +1,3 @@
import cmp from 'semver-compare'
import * as semver from 'semver'
import { injectable, inject } from 'inversify'
@@ -6,7 +5,7 @@ import { IBuildAgent, TYPES } from './models'
export interface IVersionManager {
isExplicitVersion(versionSpec: string): boolean
evaluateVersions(versions: string[], versionSpec: string): string
evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string
cleanVersion(version: string): string
}
@@ -27,13 +26,13 @@ export class VersionManager implements IVersionManager {
return valid
}
public evaluateVersions(versions: string[], versionSpec: string): string {
public evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string {
let version: string
this.buildAgent.debug('evaluating ' + versions.length + ' versions')
versions = versions.sort(cmp)
versions = semver.sort(versions)
for (let i = versions.length - 1; i >= 0; i--) {
const potential: string = versions[i]
const satisfied: boolean = semver.satisfies(potential, versionSpec)
const satisfied: boolean = semver.satisfies(potential, versionSpec, optionsOrLoose)
if (satisfied) {
version = potential
break

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { addAsset } from './main'
addAsset()
await addAsset()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { close } from './main'
close()
await close()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { create } from './main'
create()
await create()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { discard } from './main'
discard()
await discard()

View File

@@ -1,34 +1,26 @@
import { IBuildAgent, TYPES } from '../../core/models'
import {
IGitReleaseManagerTool,
GitReleaseManagerTool
} from '../../tools/gitreleasemanager/tool'
import { Settings as CommonSettings } from '../../core/settings'
import { Settings } from '../../tools/gitreleasemanager/settings'
import { IGitReleaseManagerTool, GitReleaseManagerTool } from '../../tools/gitreleasemanager/tool'
import { IGitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/models'
import { GitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/settings'
import container from '../../core/ioc'
container
.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
.to(GitReleaseManagerTool)
container.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool)
container.bind<IGitReleaseManagerSettingsProvider>(TYPES.IGitReleaseManagerSettingsProvider).to(GitReleaseManagerSettingsProvider)
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(
TYPES.IGitReleaseManagerTool
)
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
const settingsProvider = container.get<IGitReleaseManagerSettingsProvider>(TYPES.IGitReleaseManagerSettingsProvider)
export async function setup() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = CommonSettings.getSetupSettings(buildAgent)
const settings = settingsProvider.getSetupSettings()
await gitReleaseManagerTool.install(settings)
buildAgent.setSucceeded(
'GitVersionManager installed successfully',
true
)
buildAgent.setSucceeded('GitVersionManager installed successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -38,14 +30,11 @@ export async function create() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getCreateSettings(buildAgent)
const settings = settingsProvider.getCreateSettings()
await gitReleaseManagerTool.create(settings)
buildAgent.setSucceeded(
'GitVersionManager created release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager created release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -55,14 +44,11 @@ export async function discard() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getDiscardSettings(buildAgent)
const settings = settingsProvider.getDiscardSettings()
await gitReleaseManagerTool.discard(settings)
buildAgent.setSucceeded(
'GitVersionManager discarded release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager discarded release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -72,14 +58,11 @@ export async function close() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getCloseSettings(buildAgent)
const settings = settingsProvider.getCloseSettings()
await gitReleaseManagerTool.close(settings)
buildAgent.setSucceeded(
'GitVersionManager closed release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager closed release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -89,14 +72,11 @@ export async function open() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getOpenSettings(buildAgent)
const settings = settingsProvider.getOpenSettings()
await gitReleaseManagerTool.open(settings)
buildAgent.setSucceeded(
'GitVersionManager opened release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager opened release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -106,14 +86,11 @@ export async function publish() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getPublishSettings(buildAgent)
const settings = settingsProvider.getPublishSettings()
await gitReleaseManagerTool.publish(settings)
buildAgent.setSucceeded(
'GitVersionManager published release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager published release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}
@@ -123,14 +100,11 @@ export async function addAsset() {
try {
gitReleaseManagerTool.disableTelemetry()
const settings = Settings.getAddAssetSettings(buildAgent)
const settings = settingsProvider.getAddAssetSettings()
await gitReleaseManagerTool.addAsset(settings)
buildAgent.setSucceeded(
'GitVersionManager added assets to release successfully',
true
)
buildAgent.setSucceeded('GitVersionManager added assets to release successfully', true)
} catch (error) {
buildAgent.setFailed(error.message, true)
}

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { open } from './main'
open()
await open()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { publish } from './main'
publish()
await publish()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { setup } from './main'
setup()
await setup()

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { run } from './main'
run()
await run()

View File

@@ -1,24 +1,23 @@
import { IBuildAgent, TYPES } from '../../core/models'
import { Settings as CommonSettings } from '../../core/settings'
import { Settings } from '../../tools/gitversion/settings'
import { IGitVersionTool, GitVersionTool } from '../../tools/gitversion/tool'
import {
GitVersionSettings,
GitVersionOutput
} from '../../tools/gitversion/models'
import { GitVersionSettings, GitVersionOutput, IGitVersionSettingsProvider } from '../../tools/gitversion/models'
import { GitVersionSettingsProvider } from '../../tools/gitversion/settings'
import container from '../../core/ioc'
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
container.bind<IGitVersionSettingsProvider>(TYPES.IGitVersionSettingsProvider).to(GitVersionSettingsProvider)
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
const settingsProvider = container.get<IGitVersionSettingsProvider>(TYPES.IGitVersionSettingsProvider)
export async function setup() {
try {
gitVersionTool.disableTelemetry()
console.log(`Agent: '${buildAgent.agentName}'`)
const settings = CommonSettings.getSetupSettings(buildAgent)
const settings = settingsProvider.getSetupSettings()
await gitVersionTool.install(settings)
@@ -31,23 +30,24 @@ export async function setup() {
export async function run() {
try {
gitVersionTool.disableTelemetry()
console.log(`Agent: '${buildAgent.agentName}'`)
const settings: GitVersionSettings = Settings.getGitVersionSettings(
buildAgent
)
const settings: GitVersionSettings = settingsProvider.getGitVersionSettings()
const result = await gitVersionTool.run(settings)
const { stdout } = result
const jsonOutput = stdout.substring(
stdout.lastIndexOf('{'),
stdout.lastIndexOf('}') + 1
)
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
gitVersionTool.writeGitVersionToAgent(gitversion)
if (result.code === 0) {
buildAgent.setSucceeded('GitVersion executed successfully', true)
const { stdout } = result
if (stdout.lastIndexOf('{') === -1 || stdout.lastIndexOf('}') === -1) {
buildAgent.setFailed('GitVersion output is not valid JSON', true)
} else {
const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
gitVersionTool.writeGitVersionToAgent(gitversion)
}
} else {
buildAgent.setFailed(result.error.message, true)
}

View File

@@ -1,4 +1,4 @@
import 'reflect-metadata'
import { setup } from './main'
setup()
await setup()

View File

@@ -0,0 +1,17 @@
export enum SetupFields {
includePrerelease = 'includePrerelease',
versionSpec = 'versionSpec',
ignoreFailedSources = 'ignoreFailedSources',
preferLatestVersion = 'preferLatestVersion'
}
export interface ISetupSettings {
[SetupFields.versionSpec]: string
[SetupFields.includePrerelease]: boolean
[SetupFields.ignoreFailedSources]: boolean
[SetupFields.preferLatestVersion]: boolean
}
export interface ISettingsProvider {
getSetupSettings(): ISetupSettings
}

View File

@@ -0,0 +1,22 @@
import { injectable } from 'inversify'
import { ISettingsProvider, ISetupSettings, SetupFields } from './models'
import { IBuildAgent } from '../../core/models'
@injectable()
export class SettingsProvider implements ISettingsProvider {
constructor(protected buildAgent: IBuildAgent) {}
public getSetupSettings(): ISetupSettings {
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,
preferLatestVersion
}
}
}

View File

@@ -1,3 +1,5 @@
import { ISettingsProvider } from '../common/models'
export enum CommonFields {
repository = 'repository',
owner = 'owner',
@@ -35,6 +37,22 @@ export enum AddAssetFields {
assets = 'assets'
}
export interface IGitReleaseManagerSettingsProvider extends ISettingsProvider {
getCreateSettings(): GitReleaseManagerCreateSettings
getDiscardSettings(): GitReleaseManagerDiscardSettings
getCloseSettings(): GitReleaseManagerCloseSettings
getOpenSettings(): GitReleaseManagerOpenSettings
getPublishSettings(): GitReleaseManagerPublishSettings
getAddAssetSettings(): GitReleaseManagerAddAssetSettings
getCommonSettings(): GitReleaseManagerSettings
}
export interface GitReleaseManagerSettings {
[CommonFields.repository]: string
[CommonFields.owner]: string
@@ -42,8 +60,7 @@ export interface GitReleaseManagerSettings {
[CommonFields.targetDirectory]: string
}
export interface GitReleaseManagerCreateSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettings {
[CreateFields.milestone]: string
[CreateFields.name]: string
[CreateFields.inputFileName]: string
@@ -52,28 +69,23 @@ export interface GitReleaseManagerCreateSettings
[CreateFields.assets]?: string[]
}
export interface GitReleaseManagerDiscardSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
[DiscardFields.milestone]: string
}
export interface GitReleaseManagerCloseSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
[CloseFields.milestone]: string
}
export interface GitReleaseManagerOpenSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
[OpenFields.milestone]: string
}
export interface GitReleaseManagerPublishSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerPublishSettings extends GitReleaseManagerSettings {
[PublishFields.tagName]: string
}
export interface GitReleaseManagerAddAssetSettings
extends GitReleaseManagerSettings {
export interface GitReleaseManagerAddAssetSettings extends GitReleaseManagerSettings {
[AddAssetFields.tagName]: string
[AddAssetFields.assets]: string[]
}

View File

@@ -1,35 +1,39 @@
import { IBuildAgent } from '../../core/models'
import { IBuildAgent, TYPES } from '../../core/models'
import {
GitReleaseManagerSettings,
AddAssetFields,
CloseFields,
CommonFields,
CreateFields,
DiscardFields,
CloseFields,
OpenFields,
PublishFields,
AddAssetFields,
GitReleaseManagerAddAssetSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerCreateSettings,
GitReleaseManagerDiscardSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerOpenSettings,
GitReleaseManagerPublishSettings,
GitReleaseManagerAddAssetSettings
GitReleaseManagerSettings,
IGitReleaseManagerSettingsProvider,
OpenFields,
PublishFields
} from './models'
import { SettingsProvider } from '../common/settings'
import { inject, injectable } from 'inversify'
export class Settings {
public static getCreateSettings(
buildAgent: IBuildAgent
): GitReleaseManagerCreateSettings {
const milestone = buildAgent.getInput(CreateFields.milestone)
const name = buildAgent.getInput(CreateFields.name)
const inputFileName = buildAgent.getInput(CreateFields.inputFileName)
const isPreRelease = buildAgent.getBooleanInput(
CreateFields.isPreRelease
)
const commit = buildAgent.getInput(CreateFields.commit)
const assets = buildAgent.getListInput(CreateFields.assets)
@injectable()
export class GitReleaseManagerSettingsProvider extends SettingsProvider implements IGitReleaseManagerSettingsProvider {
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
super(buildAgent)
}
const commonSettings = Settings.getCommonSettings(buildAgent)
getCreateSettings(): GitReleaseManagerCreateSettings {
const milestone = this.buildAgent.getInput(CreateFields.milestone)
const name = this.buildAgent.getInput(CreateFields.name)
const inputFileName = this.buildAgent.getInput(CreateFields.inputFileName)
const isPreRelease = this.buildAgent.getBooleanInput(CreateFields.isPreRelease)
const commit = this.buildAgent.getInput(CreateFields.commit)
const assets = this.buildAgent.getListInput(CreateFields.assets)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
milestone,
@@ -41,61 +45,51 @@ export class Settings {
}
}
public static getDiscardSettings(
buildAgent: IBuildAgent
): GitReleaseManagerDiscardSettings {
const milestone = buildAgent.getInput(DiscardFields.milestone)
getDiscardSettings(): GitReleaseManagerDiscardSettings {
const milestone = this.buildAgent.getInput(DiscardFields.milestone)
const commonSettings = Settings.getCommonSettings(buildAgent)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
milestone
}
}
public static getCloseSettings(
buildAgent: IBuildAgent
): GitReleaseManagerCloseSettings {
const milestone = buildAgent.getInput(CloseFields.milestone)
getCloseSettings(): GitReleaseManagerCloseSettings {
const milestone = this.buildAgent.getInput(CloseFields.milestone)
const commonSettings = Settings.getCommonSettings(buildAgent)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
milestone
}
}
public static getOpenSettings(
buildAgent: IBuildAgent
): GitReleaseManagerOpenSettings {
const milestone = buildAgent.getInput(OpenFields.milestone)
getOpenSettings(): GitReleaseManagerOpenSettings {
const milestone = this.buildAgent.getInput(OpenFields.milestone)
const commonSettings = Settings.getCommonSettings(buildAgent)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
milestone
}
}
public static getPublishSettings(
buildAgent: IBuildAgent
): GitReleaseManagerPublishSettings {
const tagName = buildAgent.getInput(PublishFields.tagName)
getPublishSettings(): GitReleaseManagerPublishSettings {
const tagName = this.buildAgent.getInput(PublishFields.tagName)
const commonSettings = Settings.getCommonSettings(buildAgent)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
tagName
}
}
public static getAddAssetSettings(
buildAgent: IBuildAgent
): GitReleaseManagerAddAssetSettings {
const tagName = buildAgent.getInput(AddAssetFields.tagName)
const assets = buildAgent.getListInput(AddAssetFields.assets)
getAddAssetSettings(): GitReleaseManagerAddAssetSettings {
const tagName = this.buildAgent.getInput(AddAssetFields.tagName)
const assets = this.buildAgent.getListInput(AddAssetFields.assets)
const commonSettings = Settings.getCommonSettings(buildAgent)
const commonSettings = this.getCommonSettings()
return {
...commonSettings,
tagName,
@@ -103,15 +97,11 @@ export class Settings {
}
}
private static getCommonSettings(
buildAgent: IBuildAgent
): GitReleaseManagerSettings {
const owner = buildAgent.getInput(CommonFields.owner, true)
const repository = buildAgent.getInput(CommonFields.repository, true)
const token = buildAgent.getInput(CommonFields.token, true)
const targetDirectory = buildAgent.getInput(
CommonFields.targetDirectory
)
getCommonSettings(): GitReleaseManagerSettings {
const owner = this.buildAgent.getInput(CommonFields.owner, true)
const repository = this.buildAgent.getInput(CommonFields.repository, true)
const token = this.buildAgent.getInput(CommonFields.token, true)
const targetDirectory = this.buildAgent.getInput(CommonFields.targetDirectory)
return {
owner,

View File

@@ -1,19 +1,20 @@
import path = require('path')
import * as path from 'path'
import { TYPES, IBuildAgent, IExecResult, ISetupSettings } from '../../core/models'
import { injectable, inject } from 'inversify'
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
import { inject, injectable } from 'inversify'
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
import { IVersionManager } from '../../core/versionManager'
import {
GitReleaseManagerSettings,
GitReleaseManagerAddAssetSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerCreateSettings,
GitReleaseManagerDiscardSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerOpenSettings,
GitReleaseManagerPublishSettings,
GitReleaseManagerAddAssetSettings
GitReleaseManagerSettings
} from './models'
import { ISetupSettings } from '../common/models'
export interface IGitReleaseManagerTool extends IDotnetTool {
install(setupSettings: ISetupSettings): Promise<void>
@@ -26,43 +27,28 @@ export interface IGitReleaseManagerTool extends IDotnetTool {
}
@injectable()
export class GitReleaseManagerTool
extends DotnetTool
implements IGitReleaseManagerTool {
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@inject(TYPES.IVersionManager) versionManager: IVersionManager
) {
export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseManagerTool {
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
super(buildAgent, versionManager)
}
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> {
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {
const args = this.getCreateArguments(settings)
return this.execute('dotnet-gitreleasemanager', args)
}
public discard(
settings: GitReleaseManagerDiscardSettings
): Promise<IExecResult> {
public discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult> {
const args = this.getDiscardArguments(settings)
return this.execute('dotnet-gitreleasemanager', args)
}
public close(
settings: GitReleaseManagerCloseSettings
): Promise<IExecResult> {
public close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult> {
const args = this.getCloseArguments(settings)
return this.execute('dotnet-gitreleasemanager', args)
@@ -74,17 +60,13 @@ export class GitReleaseManagerTool
return this.execute('dotnet-gitreleasemanager', args)
}
public publish(
settings: GitReleaseManagerPublishSettings
): Promise<IExecResult> {
public publish(settings: GitReleaseManagerPublishSettings): Promise<IExecResult> {
const args = this.getPublishArguments(settings)
return this.execute('dotnet-gitreleasemanager', args)
}
public addAsset(
settings: GitReleaseManagerAddAssetSettings
): Promise<IExecResult> {
public addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult> {
const args = this.getAddAssetArguments(settings)
return this.execute('dotnet-gitreleasemanager', args)
@@ -104,9 +86,7 @@ export class GitReleaseManagerTool
return args
}
private getCreateArguments(
settings: GitReleaseManagerCreateSettings
): string[] {
private getCreateArguments(settings: GitReleaseManagerCreateSettings): string[] {
const args: string[] = ['create', ...this.getCommonArguments(settings)]
if (settings.milestone) {
@@ -123,10 +103,7 @@ export class GitReleaseManagerTool
if (this.buildAgent.fileExists(settings.inputFileName)) {
args.push('--inputFilePath', settings.inputFileName)
} else {
throw new Error(
'GitReleaseManager inputFilePath not found at ' +
settings.inputFileName
)
throw new Error('GitReleaseManager inputFilePath not found at ' + settings.inputFileName)
}
}
if (settings.isPreRelease) {
@@ -143,9 +120,7 @@ export class GitReleaseManagerTool
return args
}
private getDiscardArguments(
settings: GitReleaseManagerDiscardSettings
): string[] {
private getDiscardArguments(settings: GitReleaseManagerDiscardSettings): string[] {
const args: string[] = ['discard', ...this.getCommonArguments(settings)]
if (settings.milestone) {
@@ -155,9 +130,7 @@ export class GitReleaseManagerTool
return args
}
private getCloseArguments(
settings: GitReleaseManagerCloseSettings
): string[] {
private getCloseArguments(settings: GitReleaseManagerCloseSettings): string[] {
const args: string[] = ['close', ...this.getCommonArguments(settings)]
if (settings.milestone) {
@@ -167,9 +140,7 @@ export class GitReleaseManagerTool
return args
}
private getOpenArguments(
settings: GitReleaseManagerOpenSettings
): string[] {
private getOpenArguments(settings: GitReleaseManagerOpenSettings): string[] {
const args: string[] = ['open', ...this.getCommonArguments(settings)]
if (settings.milestone) {
@@ -179,9 +150,7 @@ export class GitReleaseManagerTool
return args
}
private getPublishArguments(
settings: GitReleaseManagerPublishSettings
): string[] {
private getPublishArguments(settings: GitReleaseManagerPublishSettings): string[] {
const args: string[] = ['publish', ...this.getCommonArguments(settings)]
if (settings.tagName) {
@@ -191,13 +160,8 @@ export class GitReleaseManagerTool
return args
}
private getAddAssetArguments(
settings: GitReleaseManagerAddAssetSettings
): string[] {
const args: string[] = [
'addasset',
...this.getCommonArguments(settings)
]
private getAddAssetArguments(settings: GitReleaseManagerAddAssetSettings): string[] {
const args: string[] = ['addasset', ...this.getCommonArguments(settings)]
if (settings.tagName) {
args.push('--tagName', settings.tagName)

View File

@@ -1,3 +1,5 @@
import { ISettingsProvider } from '../common/models'
export enum ExecuteFields {
targetPath = 'targetPath',
useConfigFile = 'useConfigFile',
@@ -18,6 +20,10 @@ export interface GitVersionSettings {
[ExecuteFields.srcDir]: string
}
export interface IGitVersionSettingsProvider extends ISettingsProvider {
getGitVersionSettings(): GitVersionSettings
}
export interface GitVersionOutput {
Major: number
Minor: number

View File

@@ -1,30 +1,27 @@
import { IBuildAgent } from '../../core/models'
import { IBuildAgent, TYPES } from '../../core/models'
import { GitVersionSettings, ExecuteFields } from './models'
import { ExecuteFields, GitVersionSettings, IGitVersionSettingsProvider } from './models'
import { SettingsProvider } from '../common/settings'
import { inject, injectable } from 'inversify'
export class Settings {
public static getGitVersionSettings(
buildAgent: IBuildAgent
): GitVersionSettings {
const targetPath = buildAgent.getInput(ExecuteFields.targetPath)
@injectable()
export class GitVersionSettingsProvider extends SettingsProvider implements IGitVersionSettingsProvider {
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
super(buildAgent)
}
const useConfigFile = buildAgent.getBooleanInput(
ExecuteFields.useConfigFile
)
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath)
public getGitVersionSettings(): GitVersionSettings {
const targetPath = this.buildAgent.getInput(ExecuteFields.targetPath)
const updateAssemblyInfo = buildAgent.getBooleanInput(
ExecuteFields.updateAssemblyInfo
)
const updateAssemblyInfoFilename = buildAgent.getInput(
ExecuteFields.updateAssemblyInfoFilename
)
const useConfigFile = this.buildAgent.getBooleanInput(ExecuteFields.useConfigFile)
const configFilePath = this.buildAgent.getInput(ExecuteFields.configFilePath)
const additionalArguments = buildAgent.getInput(
ExecuteFields.additionalArguments
)
const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo)
const updateAssemblyInfoFilename = this.buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename)
const srcDir = buildAgent.getSourceDir()?.replace(/\\/g, '/')
const additionalArguments = this.buildAgent.getInput(ExecuteFields.additionalArguments)
const srcDir = this.buildAgent.getSourceDir()?.replace(/\\/g, '/')
return {
targetPath,

View File

@@ -1,10 +1,9 @@
import path = require('path')
import { injectable, inject } from 'inversify'
import { IExecResult, IBuildAgent, TYPES, ISetupSettings } from '../../core/models'
import { inject, injectable } from 'inversify'
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
import { GitVersionSettings, GitVersionOutput } from './models'
import { GitVersionOutput, GitVersionSettings } from './models'
import { IVersionManager } from '../../core/versionManager'
import { ISetupSettings } from '../common/models'
export interface IGitVersionTool extends IDotnetTool {
install(setupSettings: ISetupSettings): Promise<void>
@@ -14,19 +13,12 @@ export interface IGitVersionTool extends IDotnetTool {
@injectable()
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@inject(TYPES.IVersionManager) versionManager: IVersionManager
) {
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
super(buildAgent, versionManager)
}
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> {
@@ -52,33 +44,16 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
return workDir.replace(/\\/g, '/')
}
private getArguments(
workDir: string,
options: GitVersionSettings
): string[] {
private getArguments(workDir: string, options: GitVersionSettings): string[] {
let args = [workDir, '/output', 'json', '/output', 'buildserver']
const {
useConfigFile,
configFilePath,
updateAssemblyInfo,
updateAssemblyInfoFilename,
additionalArguments
} = options
const { useConfigFile, configFilePath, updateAssemblyInfo, updateAssemblyInfoFilename, additionalArguments } = options
if (useConfigFile) {
if (
this.buildAgent.isValidInputFile(
'configFilePath',
configFilePath
)
) {
if (this.buildAgent.isValidInputFile('configFilePath', configFilePath)) {
args.push('/config', configFilePath)
} else {
throw new Error(
'GitVersion configuration file not found at ' +
configFilePath
)
throw new Error('GitVersion configuration file not found at ' + configFilePath)
}
}
if (updateAssemblyInfo) {
@@ -86,18 +61,10 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
// You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.
if (updateAssemblyInfoFilename?.length > 0) {
if (
this.buildAgent.isValidInputFile(
'updateAssemblyInfoFilename',
updateAssemblyInfoFilename
)
) {
if (this.buildAgent.isValidInputFile('updateAssemblyInfoFilename', updateAssemblyInfoFilename)) {
args.push(updateAssemblyInfoFilename)
} else {
throw new Error(
'AssemblyInfoFilename file not found at ' +
updateAssemblyInfoFilename
)
throw new Error('AssemblyInfoFilename file not found at ' + updateAssemblyInfoFilename)
}
}
}
@@ -182,12 +149,9 @@ 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) {
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
return index == 0 ? match.toLowerCase() : match.toUpperCase()
}
)
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()
})
}
}

View File

@@ -1,13 +1,13 @@
{
"compilerOptions": {
"module": "CommonJS",
"module": "ES2022",
"moduleResolution": "node",
"target": "ES2016",
"target": "es2017",
"noImplicitAny": true,
"sourceMap": true,
"lib": ["ES2016"],
"types": ["reflect-metadata"],
"esModuleInterop":true,
"lib": [ "ES2016" ],
"types": [ "reflect-metadata" ],
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}

View File

@@ -7,7 +7,7 @@ function getConfig(mode, agent, entry) {
entry: entry,
target: 'node',
mode: mode,
devtool: mode == 'development' ? 'inline-source-map' : false,
devtool: mode === 'development' ? 'inline-source-map' : false,
module: {
rules: [{
test: /\.tsx?$/,
@@ -43,7 +43,10 @@ function getConfig(mode, agent, entry) {
replace: 'let pkg = { version: "1.2.3" };'
}]
}])
]
],
experiments: {
topLevelAwait: true
}
}
}
@@ -62,12 +65,12 @@ const entryPoints = [
module.exports = (env) => {
const task = env.task || 'compile';
const agent = env.agent || 'mock';
const mode = task == 'compile' ? 'development' : 'production';
const mode = task === 'compile' ? 'development' : 'production';
const entry = {};
entryPoints.forEach(key => {
const resource = task == 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
const resource = task === 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
entry[key] = path.resolve(__dirname, resource);
});
return getConfig(mode, agent, entry);
};
};