Compare commits
228 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea3b60afaa | ||
|
|
fd856af2cd | ||
|
|
51169613c9 | ||
|
|
02ac2511c1 | ||
|
|
46bb297e3e | ||
|
|
e211644340 | ||
|
|
ccedb16304 | ||
|
|
314873afa2 | ||
|
|
69f493254d | ||
|
|
b93fdb9f59 | ||
|
|
4a23953d2e | ||
|
|
00539659e4 | ||
|
|
8d90ff1842 | ||
|
|
1778633d62 | ||
|
|
87f80d7685 | ||
|
|
9215444fd4 | ||
|
|
560c7a0e96 | ||
|
|
c905369287 | ||
|
|
1fd1ca1fb0 | ||
|
|
1e6fbb3acf | ||
|
|
46a847d957 | ||
|
|
3fd28bf770 | ||
|
|
693e190368 | ||
|
|
d8d401d400 | ||
|
|
8050d189d9 | ||
|
|
9be5ab0ab2 | ||
|
|
5d833b4a30 | ||
|
|
79ec260c7b | ||
|
|
143cd1d6b4 | ||
|
|
94bad18ff9 | ||
|
|
1ffab4eee7 | ||
|
|
889421767e | ||
|
|
1b4a8605bf | ||
|
|
b2242eacc7 | ||
|
|
ec05ff6110 | ||
|
|
25b76a02c4 | ||
|
|
a4fbf1640e | ||
|
|
ef496a434c | ||
|
|
bb50ca9d18 | ||
|
|
2477022a3e | ||
|
|
b7ffed5010 | ||
|
|
8af03f1f61 | ||
|
|
d779553309 | ||
|
|
9c7d40885e | ||
|
|
8603a1a43d | ||
|
|
6aebf267ef | ||
|
|
d33c84fe71 | ||
|
|
81b9d1c9e4 | ||
|
|
cd5cff4f8f | ||
|
|
74aff34782 | ||
|
|
5c061609d3 | ||
|
|
0642b32d33 | ||
|
|
cadfeb7381 | ||
|
|
f0bb3abe8b | ||
|
|
678e06d463 | ||
|
|
a679eac749 | ||
|
|
4cd49e821c | ||
|
|
a975b7f89d | ||
|
|
af225a20cb | ||
|
|
d9f24aeafb | ||
|
|
51e458281f | ||
|
|
02941dc41f | ||
|
|
b283fb5ad9 | ||
|
|
9f1f69cf98 | ||
|
|
f0e34f135f | ||
|
|
b27c54fee2 | ||
|
|
57b8ebc3ab | ||
|
|
210baa122f | ||
|
|
3403009677 | ||
|
|
e257e839f9 | ||
|
|
7a13923831 | ||
|
|
36d1781472 | ||
|
|
0333200fa7 | ||
|
|
31856d2b28 | ||
|
|
a80f1b0a3e | ||
|
|
9d4de0b88b | ||
|
|
e0d031e9d5 | ||
|
|
7c8ff03895 | ||
|
|
c123b50f14 | ||
|
|
55568d7bb0 | ||
|
|
99a374272e | ||
|
|
c564e77502 | ||
|
|
cb93186e87 | ||
|
|
79a82ba1df | ||
|
|
2fcc9edf8b | ||
|
|
48f9f6b568 | ||
|
|
3e1a1ed2b2 | ||
|
|
75f1739323 | ||
|
|
94003bfe72 | ||
|
|
e4f76d5322 | ||
|
|
5d34586e84 | ||
|
|
25ca642ba4 | ||
|
|
80fb4befd7 | ||
|
|
af9c916619 | ||
|
|
6833f4f03e | ||
|
|
e710d248d1 | ||
|
|
b5f0884321 | ||
|
|
30b450f49e | ||
|
|
706774a012 | ||
|
|
0949b64a2c | ||
|
|
22c4681f06 | ||
|
|
b7f3901fab | ||
|
|
7f0e122205 | ||
|
|
46ab5bb847 | ||
|
|
574e4bf6f9 | ||
|
|
b5e771cb02 | ||
|
|
e136053d89 | ||
|
|
2112274715 | ||
|
|
b37803bb5e | ||
|
|
f9c8e9afff | ||
|
|
58bd1df6a6 | ||
|
|
527a545c36 | ||
|
|
00a24c1bef | ||
|
|
8f2f18a70f | ||
|
|
88fd806149 | ||
|
|
fe551402c3 | ||
|
|
7f5d753447 | ||
|
|
6f8028bc82 | ||
|
|
0c1bb4d811 | ||
|
|
d8b87a0f36 | ||
|
|
732f4928bc | ||
|
|
58e3f4e1e6 | ||
|
|
3257d5bf64 | ||
|
|
f67ed1ef28 | ||
|
|
13f5ac7408 | ||
|
|
fbb7ca09b3 | ||
|
|
376893bf5b | ||
|
|
e3cd5eb8a5 | ||
|
|
d8787a4268 | ||
|
|
6317db89ba | ||
|
|
3b79697c05 | ||
|
|
27367974e6 | ||
|
|
1788cd4d6f | ||
|
|
38272c0592 | ||
|
|
81152314d4 | ||
|
|
36209f8002 | ||
|
|
6260a6a905 | ||
|
|
28404d0be2 | ||
|
|
b6960d1589 | ||
|
|
1909d0d4e5 | ||
|
|
22dbdffab4 | ||
|
|
48369d0af8 | ||
|
|
12d86ff2f0 | ||
|
|
4a7338f45a | ||
|
|
07d42eefcf | ||
|
|
6dfe406088 | ||
|
|
2859f8cbd1 | ||
|
|
3122616c1f | ||
|
|
4a4ebd466e | ||
|
|
10703e9467 | ||
|
|
9ae211b0cb | ||
|
|
3020c81b28 | ||
|
|
f2089bbb35 | ||
|
|
6e71cfb6b1 | ||
|
|
712b542d47 | ||
|
|
5b15fd4add | ||
|
|
60fd097914 | ||
|
|
960338bcea | ||
|
|
c31907ac18 | ||
|
|
a2f365cab2 | ||
|
|
e1e31a379b | ||
|
|
2057da769f | ||
|
|
1d85c561e4 | ||
|
|
1dc5944fee | ||
|
|
571e3c886e | ||
|
|
a3dec8d073 | ||
|
|
b8d27e460b | ||
|
|
3172154079 | ||
|
|
4e4d5479ae | ||
|
|
fd04b1fa3b | ||
|
|
f930092d92 | ||
|
|
13f6391e78 | ||
|
|
99fed08849 | ||
|
|
05eb2a3d8f | ||
|
|
604290d0b3 | ||
|
|
5ae1e49b30 | ||
|
|
c9e3bd0125 | ||
|
|
593f0ef445 | ||
|
|
631e55cbf4 | ||
|
|
3318dd5073 | ||
|
|
274da1a0fa | ||
|
|
b6034fb7e2 | ||
|
|
627d003757 | ||
|
|
343eabb4e2 | ||
|
|
a049e9b6f6 | ||
|
|
0d5d730d0d | ||
|
|
7f9dcba752 | ||
|
|
e80e47e735 | ||
|
|
2690f37786 | ||
|
|
5c4fb6ec6b | ||
|
|
0ccd60100c | ||
|
|
acb8ced58e | ||
|
|
726a0a0b41 | ||
|
|
b06083a2ec | ||
|
|
ddf73f09cf | ||
|
|
cf81750a11 | ||
|
|
0e8b523250 | ||
|
|
80481e6170 | ||
|
|
9ae03b1577 | ||
|
|
612f8717b5 | ||
|
|
13805f8688 | ||
|
|
985de5714f | ||
|
|
a2f3ef0512 | ||
|
|
7c15c4c3da | ||
|
|
1bd0d6ca81 | ||
|
|
038decac79 | ||
|
|
7a3398fc19 | ||
|
|
4b0b5d7ab5 | ||
|
|
7768b44eb7 | ||
|
|
788800ab1d | ||
|
|
e778ede2d1 | ||
|
|
5718f250af | ||
|
|
e282982f62 | ||
|
|
d95dee3516 | ||
|
|
c390b904c1 | ||
|
|
346e27f10b | ||
|
|
88be0184aa | ||
|
|
7514ca5282 | ||
|
|
2d2a17becd | ||
|
|
0f2ff05586 | ||
|
|
641823aef3 | ||
|
|
fe485e5aab | ||
|
|
b0dbca979a | ||
|
|
916fe8cd22 | ||
|
|
e833ebcfce | ||
|
|
4dc8ca33d2 | ||
|
|
cf8a2d8310 | ||
|
|
6643846bbb |
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_size = 2
|
||||||
14
.eslintrc.js
14
.eslintrc.js
@@ -1,14 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: [
|
|
||||||
'@typescript-eslint',
|
|
||||||
'sort-keys-fix'
|
|
||||||
],
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/eslint-recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'prettier/@typescript-eslint',
|
|
||||||
],
|
|
||||||
};
|
|
||||||
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
18
.github/stale.yml
vendored
Normal file
18
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 90
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 30
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
- bug
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: stale
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. After 30 days from now, it will be closed if no further
|
||||||
|
activity occurs. Thank you for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
||||||
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -1,5 +1,12 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -16,13 +23,14 @@ jobs:
|
|||||||
git fetch --prune --unshallow
|
git fetch --prune --unshallow
|
||||||
- run: |
|
- run: |
|
||||||
npm install
|
npm install
|
||||||
npm run build:github
|
npm run format-check
|
||||||
|
npm run build:github
|
||||||
npm run build:azure
|
npm run build:azure
|
||||||
name: Build code
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: ./gitversion/setup
|
uses: ./gitversion/setup
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.2'
|
versionSpec: '5.x'
|
||||||
- name: Use GitVersion
|
- name: Use GitVersion
|
||||||
id: gitversion # step id used as reference for output values
|
id: gitversion # step id used as reference for output values
|
||||||
uses: ./gitversion/execute
|
uses: ./gitversion/execute
|
||||||
|
|||||||
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -17,13 +17,16 @@ jobs:
|
|||||||
git fetch --prune --unshallow
|
git fetch --prune --unshallow
|
||||||
- run: |
|
- run: |
|
||||||
npm install
|
npm install
|
||||||
npm run build:github
|
npm run build:github
|
||||||
npm run build:azure
|
npm run build:azure
|
||||||
|
|
||||||
|
# npm run compress:github
|
||||||
|
# npm run compress:azure
|
||||||
name: Build code
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: ./gitversion/setup
|
uses: ./gitversion/setup
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.2'
|
versionSpec: '5.x'
|
||||||
- name: Use GitVersion
|
- name: Use GitVersion
|
||||||
id: gitversion # step id used as reference for output values
|
id: gitversion # step id used as reference for output values
|
||||||
uses: ./gitversion/execute
|
uses: ./gitversion/execute
|
||||||
@@ -32,11 +35,13 @@ jobs:
|
|||||||
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
||||||
$major = "${{steps.gitversion.outputs.major}}"
|
$major = "${{steps.gitversion.outputs.major}}"
|
||||||
$minor = "${{steps.gitversion.outputs.minor}}"
|
$minor = "${{steps.gitversion.outputs.minor}}"
|
||||||
|
$patch = "${{steps.gitversion.outputs.patch}}"
|
||||||
|
|
||||||
. .\dist\azure\update-version.ps1
|
. .\dist\azure\update-version.ps1
|
||||||
update-manifest .\dist\azure\vss-extension.json -Version $version
|
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor }
|
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
|
||||||
|
|
||||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||||
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
name: Publish Azure extension
|
name: Publish Azure extension
|
||||||
|
|||||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
src/*/node_modules/
|
||||||
11
.prettierrc.json
Normal file
11
.prettierrc.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 80,
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"parser": "typescript"
|
||||||
|
}
|
||||||
86
README.md
86
README.md
@@ -2,88 +2,26 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
GitHub Actions that allow to install and use the GitVersion and GitReleaseManager tools
|
GitHub Actions that allow to install and use the [GitVersion](https://github.com/GitTools/GitVersion) and [GitReleaseManager](https://github.com/GitTools/GitReleaseManager) tools
|
||||||
|
|
||||||
[](https://github.com/GitTools/actions/actions)
|
[](https://github.com/GitTools/actions/actions)
|
||||||
[](https://github.com/GitTools/actions/actions)
|
[](https://github.com/GitTools/actions/actions)
|
||||||
|
|
||||||
|
[](https://marketplace.visualstudio.com/items?itemName=gittools.gittools)
|
||||||
|
[](https://github.com/marketplace/actions/use-actions)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
See [setup](gitversion/setup/action.yml) and [usage](gitversion/execute/action.yml) for GitVersion
|
### GitVersion
|
||||||
|
|
||||||
and [setup](gitreleasemanager/setup/action.yml) for GitReleaseManager
|
Examples for usage of **GitVersion**:
|
||||||
|
|
||||||
## Dependency
|
- [GitHub Actions](docs/examples/github/gitversion/index.md)
|
||||||
|
- [Azure Pipeline tasks](docs/examples/azure/gitversion/index.md)
|
||||||
|
|
||||||
There are two step dependencies that are required in your workflow before running this action. You must checkout your Git repository and then fetch the master branch and tags.
|
### GitReleaseManager
|
||||||
|
|
||||||
```yaml
|
Examples for usage of **GitReleaseManager**:
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Fetch all history for all tags and branches
|
|
||||||
run: git fetch --prune --unshallow
|
|
||||||
```
|
|
||||||
|
|
||||||
Basic:
|
- [GitHub Actions](docs/examples/github/gitreleasemanager/index.md)
|
||||||
|
- [Azure Pipeline tasks](docs/examples/azure/gitreleasemanager/index.md)
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Fetch all history for all tags and branches
|
|
||||||
run: git fetch --prune --unshallow
|
|
||||||
- name: Install GitVersion
|
|
||||||
uses: gittools/actions/gitversion/setup@v0.6.1
|
|
||||||
with:
|
|
||||||
versionSpec: '5.1.x'
|
|
||||||
- name: Use GitVersion
|
|
||||||
id: gitversion # step id used as reference for output values
|
|
||||||
uses: gittools/actions/gitversion/execute@v0.6.1
|
|
||||||
- run: |
|
|
||||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
|
||||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
|
||||||
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
|
|
||||||
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
|
|
||||||
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
|
|
||||||
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
|
|
||||||
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
|
|
||||||
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
|
|
||||||
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
|
|
||||||
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
|
|
||||||
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
|
|
||||||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
|
|
||||||
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
|
|
||||||
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
|
|
||||||
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
|
|
||||||
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
|
|
||||||
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
|
|
||||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
|
||||||
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
|
|
||||||
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
|
|
||||||
echo "Sha: ${{ steps.gitversion.outputs.sha }}"
|
|
||||||
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
|
|
||||||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
|
|
||||||
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
|
|
||||||
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
|
|
||||||
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
|
|
||||||
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
|
|
||||||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
|
|
||||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
|
||||||
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Private Repositories
|
|
||||||
|
|
||||||
Private repos require credentials before you can fetch the master branch and tags.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Fetch all history for all tags and branches
|
|
||||||
run: |
|
|
||||||
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
|
||||||
git fetch --prune --unshallow
|
|
||||||
```
|
|
||||||
|
|||||||
19231
dist/azure/gitreleasemanager/addasset/bundle.js
vendored
Normal file
19231
dist/azure/gitreleasemanager/addasset/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/addasset/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/addasset/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
46
dist/azure/gitreleasemanager/addasset/lib.json
vendored
Normal file
46
dist/azure/gitreleasemanager/addasset/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"messages": {
|
||||||
|
"LIB_UnhandledEx": "Unhandled: %s",
|
||||||
|
"LIB_FailOnCode": "Failure return code: %d",
|
||||||
|
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
|
||||||
|
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
|
||||||
|
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
|
||||||
|
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
|
||||||
|
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
|
||||||
|
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
|
||||||
|
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
|
||||||
|
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
|
||||||
|
"LIB_ReturnCode": "Return code: %d",
|
||||||
|
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
|
||||||
|
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
|
||||||
|
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
|
||||||
|
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
|
||||||
|
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
|
||||||
|
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
|
||||||
|
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
|
||||||
|
"LIB_ParameterIsRequired": "%s not supplied",
|
||||||
|
"LIB_InputRequired": "Input required: %s",
|
||||||
|
"LIB_InvalidPattern": "Invalid pattern: '%s'",
|
||||||
|
"LIB_EndpointNotExist": "Endpoint not present: %s",
|
||||||
|
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
|
||||||
|
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
|
||||||
|
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
|
||||||
|
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
|
||||||
|
"LIB_PathNotFound": "Not found %s: %s",
|
||||||
|
"LIB_PathHasNullByte": "Path cannot contain null bytes",
|
||||||
|
"LIB_OperationFailed": "Failed %s: %s",
|
||||||
|
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
|
||||||
|
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
|
||||||
|
"LIB_PlatformNotSupported": "Platform not supported: %s",
|
||||||
|
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
|
||||||
|
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||||
|
"TOOL_LIB_Downloading": "Downloading: %s",
|
||||||
|
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
|
||||||
|
"TOOL_LIB_ExtractingArchive": "Extracting archive",
|
||||||
|
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
|
||||||
|
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
|
||||||
|
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||||
|
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
|
||||||
|
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
|
||||||
|
}
|
||||||
|
}
|
||||||
67
dist/azure/gitreleasemanager/addasset/task.json
vendored
Normal file
67
dist/azure/gitreleasemanager/addasset/task.json
vendored
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"id": "b803651c-21ac-4851-9fbf-c75b0e82e4c5",
|
||||||
|
"name": "gitreleasemanager/addasset",
|
||||||
|
"friendlyName": "Add Asset GitReleaseManager Task",
|
||||||
|
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||||
|
"author": "GitTools Contributors",
|
||||||
|
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||||
|
"category": "Build",
|
||||||
|
"demands": [],
|
||||||
|
"version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}]
|
||||||
|
}
|
||||||
4666
dist/azure/gitreleasemanager/close/bundle.js
vendored
4666
dist/azure/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
4666
dist/azure/gitreleasemanager/create/bundle.js
vendored
4666
dist/azure/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -64,7 +64,7 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
||||||
}, {
|
}, {
|
||||||
"name": "pre",
|
"name": "isPreRelease",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"label": "Creates the release as a pre-release",
|
"label": "Creates the release as a pre-release",
|
||||||
"defaultValue": "false",
|
"defaultValue": "false",
|
||||||
|
|||||||
4666
dist/azure/gitreleasemanager/discard/bundle.js
vendored
4666
dist/azure/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
4666
dist/azure/gitreleasemanager/open/bundle.js
vendored
4666
dist/azure/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/azure/gitreleasemanager/open/task.json
vendored
2
dist/azure/gitreleasemanager/open/task.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "5d437bf5-f193-4449-b531-c4c69eebaa48",
|
"id": "5d437bf5-f193-4449-b531-c4c69eebaa48",
|
||||||
"name": "gitreleasemanager/open",
|
"name": "gitreleasemanager/open",
|
||||||
"friendlyName": "Discard GitReleaseManager Task",
|
"friendlyName": "Open GitReleaseManager Task",
|
||||||
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||||
"author": "GitTools Contributors",
|
"author": "GitTools Contributors",
|
||||||
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||||
|
|||||||
19231
dist/azure/gitreleasemanager/publish/bundle.js
vendored
Normal file
19231
dist/azure/gitreleasemanager/publish/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/publish/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/publish/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
46
dist/azure/gitreleasemanager/publish/lib.json
vendored
Normal file
46
dist/azure/gitreleasemanager/publish/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"messages": {
|
||||||
|
"LIB_UnhandledEx": "Unhandled: %s",
|
||||||
|
"LIB_FailOnCode": "Failure return code: %d",
|
||||||
|
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
|
||||||
|
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
|
||||||
|
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
|
||||||
|
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
|
||||||
|
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
|
||||||
|
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
|
||||||
|
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
|
||||||
|
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
|
||||||
|
"LIB_ReturnCode": "Return code: %d",
|
||||||
|
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
|
||||||
|
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
|
||||||
|
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
|
||||||
|
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
|
||||||
|
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
|
||||||
|
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
|
||||||
|
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
|
||||||
|
"LIB_ParameterIsRequired": "%s not supplied",
|
||||||
|
"LIB_InputRequired": "Input required: %s",
|
||||||
|
"LIB_InvalidPattern": "Invalid pattern: '%s'",
|
||||||
|
"LIB_EndpointNotExist": "Endpoint not present: %s",
|
||||||
|
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
|
||||||
|
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
|
||||||
|
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
|
||||||
|
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
|
||||||
|
"LIB_PathNotFound": "Not found %s: %s",
|
||||||
|
"LIB_PathHasNullByte": "Path cannot contain null bytes",
|
||||||
|
"LIB_OperationFailed": "Failed %s: %s",
|
||||||
|
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
|
||||||
|
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
|
||||||
|
"LIB_PlatformNotSupported": "Platform not supported: %s",
|
||||||
|
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
|
||||||
|
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||||
|
"TOOL_LIB_Downloading": "Downloading: %s",
|
||||||
|
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
|
||||||
|
"TOOL_LIB_ExtractingArchive": "Extracting archive",
|
||||||
|
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
|
||||||
|
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
|
||||||
|
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||||
|
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
|
||||||
|
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
|
||||||
|
}
|
||||||
|
}
|
||||||
60
dist/azure/gitreleasemanager/publish/task.json
vendored
Normal file
60
dist/azure/gitreleasemanager/publish/task.json
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"id": "b3c54483-4140-45d8-b442-3a0b096b5f7f",
|
||||||
|
"name": "gitreleasemanager/publish",
|
||||||
|
"friendlyName": "Publish GitReleaseManager Task",
|
||||||
|
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||||
|
"author": "GitTools Contributors",
|
||||||
|
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||||
|
"category": "Build",
|
||||||
|
"demands": [],
|
||||||
|
"version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}]
|
||||||
|
}
|
||||||
4666
dist/azure/gitreleasemanager/setup/bundle.js
vendored
4666
dist/azure/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
4388
dist/azure/gitversion/execute/bundle.js
vendored
4388
dist/azure/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
4388
dist/azure/gitversion/setup/bundle.js
vendored
4388
dist/azure/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
11
dist/azure/update-version.ps1
vendored
11
dist/azure/update-version.ps1
vendored
@@ -10,14 +10,19 @@ function update-task() {
|
|||||||
|
|
||||||
[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false)]
|
[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false)]
|
||||||
[System.String]
|
[System.String]
|
||||||
$minor
|
$minor,
|
||||||
|
|
||||||
|
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false)]
|
||||||
|
[System.String]
|
||||||
|
$patch
|
||||||
)
|
)
|
||||||
$file = Resolve-Path $file
|
$file = Resolve-Path $file
|
||||||
$jqMajor = '.version.Major=\"' + $major +'\"';
|
$jqMajor = '.version.Major=\"' + $major +'\"';
|
||||||
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
||||||
Write-Host "Update task from $file to version $major.$minor"
|
$jqPatch = '.version.Patch=\"' + $patch +'\"';
|
||||||
|
Write-Host "Update task from $file to version $major.$minor.$patch"
|
||||||
|
|
||||||
Get-Content $file | jq $jqMajor | jq $jqMinor | Set-Content $file
|
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
|
||||||
}
|
}
|
||||||
|
|
||||||
function update-manifest() {
|
function update-manifest() {
|
||||||
|
|||||||
25
dist/azure/vss-extension.json
vendored
25
dist/azure/vss-extension.json
vendored
@@ -17,7 +17,9 @@
|
|||||||
{ "path": "gitreleasemanager/create" },
|
{ "path": "gitreleasemanager/create" },
|
||||||
{ "path": "gitreleasemanager/discard" },
|
{ "path": "gitreleasemanager/discard" },
|
||||||
{ "path": "gitreleasemanager/close" },
|
{ "path": "gitreleasemanager/close" },
|
||||||
{ "path": "gitreleasemanager/open" }
|
{ "path": "gitreleasemanager/open" },
|
||||||
|
{ "path": "gitreleasemanager/publish" },
|
||||||
|
{ "path": "gitreleasemanager/addasset" }
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"Azure Pipelines"
|
"Azure Pipelines"
|
||||||
@@ -33,7 +35,8 @@
|
|||||||
"git",
|
"git",
|
||||||
"versioning",
|
"versioning",
|
||||||
"gitflow",
|
"gitflow",
|
||||||
"githubflow"
|
"githubflow",
|
||||||
|
"release"
|
||||||
],
|
],
|
||||||
"links": {
|
"links": {
|
||||||
"learn": {
|
"learn": {
|
||||||
@@ -127,5 +130,23 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"name": "gitreleasemanager/open"
|
"name": "gitreleasemanager/open"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"id": "publish-gitreleasemanager-task",
|
||||||
|
"type": "ms.vss-distributed-task.task",
|
||||||
|
"targets": [
|
||||||
|
"ms.vss-distributed-task.tasks"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"name": "gitreleasemanager/publish"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"id": "addasset-gitreleasemanager-task",
|
||||||
|
"type": "ms.vss-distributed-task.task",
|
||||||
|
"targets": [
|
||||||
|
"ms.vss-distributed-task.tasks"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"name": "gitreleasemanager/addasset"
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
14354
dist/github/gitreleasemanager/addasset/bundle.js
vendored
Normal file
14354
dist/github/gitreleasemanager/addasset/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5175
dist/github/gitreleasemanager/close/bundle.js
vendored
5175
dist/github/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
5155
dist/github/gitreleasemanager/create/bundle.js
vendored
5155
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
5175
dist/github/gitreleasemanager/discard/bundle.js
vendored
5175
dist/github/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
5175
dist/github/gitreleasemanager/open/bundle.js
vendored
5175
dist/github/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
14354
dist/github/gitreleasemanager/publish/bundle.js
vendored
Normal file
14354
dist/github/gitreleasemanager/publish/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5175
dist/github/gitreleasemanager/setup/bundle.js
vendored
5175
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
4903
dist/github/gitversion/execute/bundle.js
vendored
4903
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
4903
dist/github/gitversion/setup/bundle.js
vendored
4903
dist/github/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
8410
dist/mock/gitreleasemanager/addasset/bundle.js
vendored
Normal file
8410
dist/mock/gitreleasemanager/addasset/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3070
dist/mock/gitreleasemanager/close/bundle.js
vendored
3070
dist/mock/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
3070
dist/mock/gitreleasemanager/create/bundle.js
vendored
3070
dist/mock/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
3070
dist/mock/gitreleasemanager/discard/bundle.js
vendored
3070
dist/mock/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
3070
dist/mock/gitreleasemanager/open/bundle.js
vendored
3070
dist/mock/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
8410
dist/mock/gitreleasemanager/publish/bundle.js
vendored
Normal file
8410
dist/mock/gitreleasemanager/publish/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3070
dist/mock/gitreleasemanager/setup/bundle.js
vendored
3070
dist/mock/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
2800
dist/mock/gitversion/execute/bundle.js
vendored
2800
dist/mock/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
2800
dist/mock/gitversion/setup/bundle.js
vendored
2800
dist/mock/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
14
docs/examples/azure/gitreleasemanager/addasset.md
Normal file
14
docs/examples/azure/gitreleasemanager/addasset.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/addasset@0
|
||||||
|
inputs:
|
||||||
|
token: '$(GITHUB_TOKEN)'
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
tagName: '0.1.0'
|
||||||
|
assets: |
|
||||||
|
src/test.txt
|
||||||
|
src/test1.txt
|
||||||
|
```
|
||||||
11
docs/examples/azure/gitreleasemanager/close.md
Normal file
11
docs/examples/azure/gitreleasemanager/close.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/close@0
|
||||||
|
inputs:
|
||||||
|
token: '$(GITHUB_TOKEN)'
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
16
docs/examples/azure/gitreleasemanager/create.md
Normal file
16
docs/examples/azure/gitreleasemanager/create.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/create@0
|
||||||
|
displayName: Create release with GitReleaseManager
|
||||||
|
inputs:
|
||||||
|
token: $(GITHUB_TOKEN)
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
name: 'v0.1.0'
|
||||||
|
assets: |
|
||||||
|
src/test.txt
|
||||||
|
src/test1.txt
|
||||||
|
```
|
||||||
11
docs/examples/azure/gitreleasemanager/discard.md
Normal file
11
docs/examples/azure/gitreleasemanager/discard.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/discard@0
|
||||||
|
inputs:
|
||||||
|
token: '$(GITHUB_TOKEN)'
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
11
docs/examples/azure/gitreleasemanager/index.md
Normal file
11
docs/examples/azure/gitreleasemanager/index.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GitReleaseManager Azure DevOps Action
|
||||||
|
|
||||||
|
Below you'll find examples of how to do particular actions with GitReleaseManager:
|
||||||
|
|
||||||
|
* [Add asset](addasset.md)
|
||||||
|
* [Close](close.md)
|
||||||
|
* [Create](create.md)
|
||||||
|
* [Discard](discard.md)
|
||||||
|
* [Open](open.md)
|
||||||
|
* [Publish](publish.md)
|
||||||
|
* [Setup](setup.md)
|
||||||
11
docs/examples/azure/gitreleasemanager/open.md
Normal file
11
docs/examples/azure/gitreleasemanager/open.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/open@0
|
||||||
|
inputs:
|
||||||
|
token: '$(GITHUB_TOKEN)'
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
11
docs/examples/azure/gitreleasemanager/publish.md
Normal file
11
docs/examples/azure/gitreleasemanager/publish.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/publish@0
|
||||||
|
inputs:
|
||||||
|
token: '$(GITHUB_TOKEN)'
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepo'
|
||||||
|
tagName: '0.1.0'
|
||||||
|
```
|
||||||
9
docs/examples/azure/gitreleasemanager/setup.md
Normal file
9
docs/examples/azure/gitreleasemanager/setup.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitreleasemanager/setup@0
|
||||||
|
displayName: Install GitReleaseManager
|
||||||
|
inputs:
|
||||||
|
versionSpec: '0.10.x'
|
||||||
|
```
|
||||||
43
docs/examples/azure/gitversion/index.md
Normal file
43
docs/examples/azure/gitversion/index.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- task: gitversion/setup@0
|
||||||
|
displayName: Install GitVersion
|
||||||
|
inputs:
|
||||||
|
versionSpec: '5.1.3'
|
||||||
|
- task: gitversion/execute@0
|
||||||
|
displayName: Use GitVersion
|
||||||
|
- script: |
|
||||||
|
echo FullSemVer: $(fullSemVer)
|
||||||
|
echo ##vso[build.updatebuildnumber]$(fullSemVer)
|
||||||
|
echo Major: ${{ steps.gitversion.outputs.major }}
|
||||||
|
echo Minor: ${{ steps.gitversion.outputs.minor }}
|
||||||
|
echo Patch: ${{ steps.gitversion.outputs.patch }}
|
||||||
|
echo PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}
|
||||||
|
echo PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}
|
||||||
|
echo PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
|
||||||
|
echo PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}
|
||||||
|
echo WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}
|
||||||
|
echo BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}
|
||||||
|
echo BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}
|
||||||
|
echo FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}
|
||||||
|
echo MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
|
||||||
|
echo SemVer: ${{ steps.gitversion.outputs.semVer }}
|
||||||
|
echo LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}
|
||||||
|
echo LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}
|
||||||
|
echo AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}
|
||||||
|
echo AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}
|
||||||
|
echo InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}
|
||||||
|
echo BranchName: ${{ steps.gitversion.outputs.branchName }}
|
||||||
|
echo Sha: ${{ steps.gitversion.outputs.sha }}
|
||||||
|
echo ShortSha: ${{ steps.gitversion.outputs.shortSha }}
|
||||||
|
echo NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
|
||||||
|
echo NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}
|
||||||
|
echo NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}
|
||||||
|
echo NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}
|
||||||
|
echo VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}
|
||||||
|
echo CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}
|
||||||
|
echo CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
|
||||||
|
echo CommitDate: ${{ steps.gitversion.outputs.commitDate }}
|
||||||
|
```
|
||||||
15
docs/examples/github/gitreleasemanager/addasset.md
Normal file
15
docs/examples/github/gitreleasemanager/addasset.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/addasset@v0.9.2
|
||||||
|
name: Add asset to a release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
tagName: '0.1.0'
|
||||||
|
assets: |
|
||||||
|
src/test.txt
|
||||||
|
src/test1.txt
|
||||||
|
```
|
||||||
12
docs/examples/github/gitreleasemanager/close.md
Normal file
12
docs/examples/github/gitreleasemanager/close.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/close@v0.9.2
|
||||||
|
name: Close release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
16
docs/examples/github/gitreleasemanager/create.md
Normal file
16
docs/examples/github/gitreleasemanager/create.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/create@v0.9.2
|
||||||
|
name: Create release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
name: 'v0.1.0'
|
||||||
|
assets: |
|
||||||
|
src/test.txt
|
||||||
|
src/test1.txt
|
||||||
|
```
|
||||||
12
docs/examples/github/gitreleasemanager/discard.md
Normal file
12
docs/examples/github/gitreleasemanager/discard.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/discard@v0.9.2
|
||||||
|
name: Discard release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
11
docs/examples/github/gitreleasemanager/index.md
Normal file
11
docs/examples/github/gitreleasemanager/index.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GitReleaseManager GitHub Action
|
||||||
|
|
||||||
|
Below you'll find examples of how to do particular actions with GitReleaseManager:
|
||||||
|
|
||||||
|
* [Add asset](addasset.md)
|
||||||
|
* [Close](close.md)
|
||||||
|
* [Create](create.md)
|
||||||
|
* [Discard](discard.md)
|
||||||
|
* [Open](open.md)
|
||||||
|
* [Publish](publish.md)
|
||||||
|
* [Setup](setup.md)
|
||||||
12
docs/examples/github/gitreleasemanager/open.md
Normal file
12
docs/examples/github/gitreleasemanager/open.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/open@v0.9.2
|
||||||
|
name: Open release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
milestone: '0.1.0'
|
||||||
|
```
|
||||||
12
docs/examples/github/gitreleasemanager/publish.md
Normal file
12
docs/examples/github/gitreleasemanager/publish.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/publish@v0.9.2
|
||||||
|
name: Publish release with GitReleaseManager
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
owner: 'someOwner'
|
||||||
|
repository: 'someRepository'
|
||||||
|
tagName: '0.1.0'
|
||||||
|
```
|
||||||
9
docs/examples/github/gitreleasemanager/setup.md
Normal file
9
docs/examples/github/gitreleasemanager/setup.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: gittools/actions/gitreleasemanager/setup@v0.9.2
|
||||||
|
name: Install GitReleaseManager
|
||||||
|
with:
|
||||||
|
versionSpec: '0.10.x'
|
||||||
|
```
|
||||||
50
docs/examples/github/gitversion/index.md
Normal file
50
docs/examples/github/gitversion/index.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# GitVersion
|
||||||
|
|
||||||
|
For the GitVersion workflow to execute successfully, you must checkout your Git
|
||||||
|
repository with `fetch-depth: 0` to fetch all history for all tags and branches.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install GitVersion
|
||||||
|
uses: gittools/actions/gitversion/setup@v0.9.4
|
||||||
|
with:
|
||||||
|
versionSpec: '5.3.x'
|
||||||
|
- name: Use GitVersion
|
||||||
|
id: gitversion # step id used as reference for output values
|
||||||
|
uses: gittools/actions/gitversion/execute@v0.9.4
|
||||||
|
- run: |
|
||||||
|
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||||
|
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||||
|
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
|
||||||
|
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
|
||||||
|
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
|
||||||
|
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
|
||||||
|
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
|
||||||
|
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
|
||||||
|
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
|
||||||
|
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
|
||||||
|
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
|
||||||
|
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
|
||||||
|
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
|
||||||
|
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
|
||||||
|
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
|
||||||
|
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
|
||||||
|
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
|
||||||
|
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||||
|
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
|
||||||
|
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
|
||||||
|
echo "Sha: ${{ steps.gitversion.outputs.sha }}"
|
||||||
|
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
|
||||||
|
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
|
||||||
|
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
|
||||||
|
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
|
||||||
|
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
|
||||||
|
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
|
||||||
|
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
|
||||||
|
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
||||||
|
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
||||||
|
```
|
||||||
34
gitreleasemanager/addasset/action.yml
Normal file
34
gitreleasemanager/addasset/action.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: gitreleasemanager-addasset
|
||||||
|
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Adds assets to a release
|
||||||
|
author: GitTools
|
||||||
|
branding:
|
||||||
|
color: gray-dark
|
||||||
|
icon: git-pull-request
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../../dist/github/gitreleasemanager/addasset/bundle.js
|
||||||
|
inputs:
|
||||||
|
owner:
|
||||||
|
description: The owner of the repository
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
repository:
|
||||||
|
description: The name of the repository
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
token:
|
||||||
|
description: The access token to access GitHub with
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
milestone:
|
||||||
|
description: The milestone to use
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
assets:
|
||||||
|
description: Path(s) to the file(s) to include in the release
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
targetDirectory:
|
||||||
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
@@ -23,8 +23,8 @@ inputs:
|
|||||||
milestone:
|
milestone:
|
||||||
description: The milestone to use
|
description: The milestone to use
|
||||||
required: true
|
required: true
|
||||||
default: ''
|
default: ''
|
||||||
targetDirectory:
|
targetDirectory:
|
||||||
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ inputs:
|
|||||||
milestone:
|
milestone:
|
||||||
description: The milestone to use
|
description: The milestone to use
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
name:
|
name:
|
||||||
description: The name of the release
|
description: The name of the release
|
||||||
required: false
|
required: false
|
||||||
@@ -32,7 +32,7 @@ inputs:
|
|||||||
description: The path to the file to be used as the content of the release notes
|
description: The path to the file to be used as the content of the release notes
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
pre:
|
isPreRelease:
|
||||||
description: Creates the release as a pre-release
|
description: Creates the release as a pre-release
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
@@ -40,7 +40,11 @@ inputs:
|
|||||||
description: The commit to tag. Can be a branch or SHA. Defaults to repository's default branch
|
description: The commit to tag. Can be a branch or SHA. Defaults to repository's default branch
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
assets:
|
||||||
|
description: Path(s) to the file(s) to include in the release
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
targetDirectory:
|
targetDirectory:
|
||||||
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ inputs:
|
|||||||
milestone:
|
milestone:
|
||||||
description: The milestone to use
|
description: The milestone to use
|
||||||
required: true
|
required: true
|
||||||
default: ''
|
default: ''
|
||||||
targetDirectory:
|
targetDirectory:
|
||||||
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ inputs:
|
|||||||
milestone:
|
milestone:
|
||||||
description: The milestone to use
|
description: The milestone to use
|
||||||
required: true
|
required: true
|
||||||
default: ''
|
default: ''
|
||||||
targetDirectory:
|
targetDirectory:
|
||||||
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
30
gitreleasemanager/publish/action.yml
Normal file
30
gitreleasemanager/publish/action.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: gitreleasemanager-publish
|
||||||
|
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Publish a release
|
||||||
|
author: GitTools
|
||||||
|
branding:
|
||||||
|
color: gray-dark
|
||||||
|
icon: git-pull-request
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../../dist/github/gitreleasemanager/publish/bundle.js
|
||||||
|
inputs:
|
||||||
|
owner:
|
||||||
|
description: The owner of the repository
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
repository:
|
||||||
|
description: The name of the repository
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
token:
|
||||||
|
description: The access token to access GitHub with
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
milestone:
|
||||||
|
description: The milestone to use
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
targetDirectory:
|
||||||
|
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
@@ -13,6 +13,6 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
default: ''
|
default: ''
|
||||||
includePrerelease:
|
includePrerelease:
|
||||||
description: Include pre-release versions when matching a version
|
description: Include pre-release versions when matching a version
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: 'false'
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
default: ''
|
default: ''
|
||||||
includePrerelease:
|
includePrerelease:
|
||||||
description: Include pre-release versions when matching a version
|
description: Include pre-release versions when matching a version
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: 'false'
|
||||||
|
|||||||
5594
package-lock.json
generated
5594
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
51
package.json
51
package.json
@@ -8,14 +8,16 @@
|
|||||||
},
|
},
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:mock": "webpack --config webpack.config.js --env.agent=mock",
|
"format": "prettier --write src/**/*.ts",
|
||||||
"build:azure": "webpack --config webpack.config.js --env.agent=azure",
|
"format-check": "prettier --check src/**/*.ts",
|
||||||
"build:github": "webpack --config webpack.config.js --env.agent=github",
|
"build:mock": "webpack --config webpack.config.js --env agent=mock",
|
||||||
"build:mock:prod": "npm run build:mock -- --env.mode=production",
|
"build:azure": "webpack --config webpack.config.js --env agent=azure",
|
||||||
"build:azure:prod": "npm run build:azure -- --env.mode=production",
|
"build:github": "webpack --config webpack.config.js --env agent=github",
|
||||||
"build:github:prod": "npm run build:github -- --env.mode=production",
|
"compress:mock": "npm run build:mock -- --env task=compress",
|
||||||
|
"compress:azure": "npm run build:azure -- --env task=compress",
|
||||||
|
"compress:github": "npm run build:github -- --env task=compress",
|
||||||
"build": "npm run build:mock && npm run build:azure && npm run build:github",
|
"build": "npm run build:mock && npm run build:azure && npm run build:github",
|
||||||
"build:prod": "npm run build:mock:prod && npm run build:azure:prod && npm run build:github:prod",
|
"compress": "npm run compress:mock && npm run compress:azure && npm run compress:github",
|
||||||
"publish:azure": "tfx extension publish --root ./dist/azure --no-wait-validation --auth-type pat"
|
"publish:azure": "tfx extension publish --root ./dist/azure --no-wait-validation --auth-type pat"
|
||||||
},
|
},
|
||||||
"author": "GitTools",
|
"author": "GitTools",
|
||||||
@@ -24,29 +26,30 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.2",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.3",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"@actions/tool-cache": "^1.3.1",
|
"@actions/tool-cache": "^1.6.0",
|
||||||
"azure-pipelines-task-lib": "^2.9.3",
|
"azure-pipelines-task-lib": "^2.11.3",
|
||||||
"azure-pipelines-tool-lib": "^0.12.0",
|
"azure-pipelines-tool-lib": "^0.13.2",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"typed-rest-client": "^1.7.1",
|
"typed-rest-client": "^1.7.3",
|
||||||
"uuid": "^3.4.0"
|
"uuid": "^8.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^13.7.0",
|
"@types/node": "^14.14.6",
|
||||||
"@types/q": "^1.5.2",
|
"@types/q": "^1.5.4",
|
||||||
"@types/semver-compare": "^1.0.1",
|
"@types/semver-compare": "^1.0.1",
|
||||||
"@types/uuid": "^3.4.7",
|
"@types/uuid": "^8.3.0",
|
||||||
"json-update": "^5.3.0",
|
"minimist": "^1.2.5",
|
||||||
|
"prettier": "^2.1.2",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"replace-in-file-webpack-plugin": "^1.0.6",
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||||
"tfx-cli": "^0.7.11",
|
"terser-webpack-plugin": "^4.2.3",
|
||||||
"ts-loader": "^6.2.1",
|
"tfx-cli": "^0.8.3",
|
||||||
"tslint": "^6.0.0",
|
"ts-loader": "^8.0.9",
|
||||||
"typescript": "^3.7.5",
|
"typescript": "^4.0.5",
|
||||||
"webpack": "^4.41.5",
|
"webpack": "^5.4.0",
|
||||||
"webpack-cli": "^3.3.10"
|
"webpack-cli": "^4.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,106 +1,117 @@
|
|||||||
import { injectable } from "inversify";
|
import { injectable } from 'inversify'
|
||||||
|
|
||||||
import * as taskLib from "azure-pipelines-task-lib/task";
|
import * as taskLib from 'azure-pipelines-task-lib/task'
|
||||||
import * as toolLib from "azure-pipelines-tool-lib/tool";
|
import * as toolLib from 'azure-pipelines-tool-lib/tool'
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../../core/models";
|
import { IBuildAgent, IExecResult } from '../../core/models'
|
||||||
|
import { IRequestOptions } from 'typed-rest-client/Interfaces'
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|
||||||
public get agentName(): string {
|
public get agentName(): string {
|
||||||
return "Azure Pipelines";
|
return 'Azure Pipelines'
|
||||||
|
}
|
||||||
|
|
||||||
|
public proxyConfiguration(url: string): IRequestOptions {
|
||||||
|
return {
|
||||||
|
proxy: taskLib.getHttpProxyConfiguration(url),
|
||||||
|
cert: taskLib.getHttpCertConfiguration(),
|
||||||
|
ignoreSslError: !!taskLib.getVariable('Agent.SkipCertValidation')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public find(toolName: string, versionSpec: string, arch?: string): string {
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
return toolLib.findLocalTool(toolName, versionSpec, arch);
|
return toolLib.findLocalTool(toolName, versionSpec, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
public cacheDir(
|
||||||
return toolLib.cacheDir(sourceDir, tool, version, arch);
|
sourceDir: string,
|
||||||
|
tool: string,
|
||||||
|
version: string,
|
||||||
|
arch?: string
|
||||||
|
): Promise<string> {
|
||||||
|
return toolLib.cacheDir(sourceDir, tool, version, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
public createTempDir(): Promise<string> {
|
public createTempDir(): Promise<string> {
|
||||||
return Promise.resolve(taskLib.getVariable("Agent.TempDirectory"));
|
return Promise.resolve(taskLib.getVariable('Agent.TempDirectory'))
|
||||||
}
|
}
|
||||||
|
|
||||||
public debug(message: string): void {
|
public debug(message: string): void {
|
||||||
taskLib.debug(message);
|
taskLib.debug(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
public setFailed(message: string, done?: boolean): void {
|
public setFailed(message: string, done?: boolean): void {
|
||||||
taskLib.setResult(taskLib.TaskResult.Failed, message, done);
|
taskLib.setResult(taskLib.TaskResult.Failed, message, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
public setSucceeded(message: string, done?: boolean): void {
|
public setSucceeded(message: string, done?: boolean): void {
|
||||||
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done);
|
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
public exportVariable(name: string, val: string): void {
|
public exportVariable(name: string, val: string): void {
|
||||||
taskLib.setVariable(name, val);
|
taskLib.setVariable(name, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVariable(name: string): string {
|
public getVariable(name: string): string {
|
||||||
return taskLib.getVariable(name);
|
return taskLib.getVariable(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
public addPath(inputPath: string): void {
|
public addPath(inputPath: string): void {
|
||||||
toolLib.prependPath(inputPath);
|
toolLib.prependPath(inputPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
public which(tool: string, check?: boolean): Promise<string> {
|
public which(tool: string, check?: boolean): Promise<string> {
|
||||||
return Promise.resolve(taskLib.which(tool, check));
|
return Promise.resolve(taskLib.which(tool, check))
|
||||||
}
|
}
|
||||||
|
|
||||||
public exec(exec: string, args: string[]): Promise<IExecResult> {
|
public exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
const tr = taskLib.tool(exec);
|
const tr = taskLib.tool(exec)
|
||||||
tr.arg(args);
|
tr.arg(args)
|
||||||
|
|
||||||
const result = tr.execSync();
|
const result = tr.execSync()
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
code: result.code,
|
code: result.code,
|
||||||
error: result.error,
|
error: result.error,
|
||||||
stderr: result.stderr,
|
stderr: result.stderr,
|
||||||
stdout: result.stdout,
|
stdout: result.stdout
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSourceDir(): string {
|
public getSourceDir(): string {
|
||||||
return this.getVariable("Build.SourcesDirectory");
|
return this.getVariable('Build.SourcesDirectory')
|
||||||
}
|
}
|
||||||
|
|
||||||
public setOutput(name: string, value: string): void {
|
public setOutput(name: string, value: string): void {
|
||||||
taskLib.setVariable(name, value);
|
taskLib.setVariable(name, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInput(input: string, required?: boolean): string {
|
public getInput(input: string, required?: boolean): string {
|
||||||
return taskLib.getInput(input, required);
|
return taskLib.getInput(input, required)?.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
public getListInput(input: string, required?: boolean): string[] {
|
public getListInput(input: string, required?: boolean): string[] {
|
||||||
return taskLib
|
return taskLib
|
||||||
.getInput(input, required)
|
.getInput(input, required)
|
||||||
.split("\n")
|
.split('\n')
|
||||||
.filter(x => x !== "");
|
.filter(x => x !== '')
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBooleanInput(input: string, required?: boolean): boolean {
|
public getBooleanInput(input: string, required?: boolean): boolean {
|
||||||
return taskLib.getBoolInput(input, required);
|
return taskLib.getBoolInput(input, required)
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidInputFile(input: string, file: string): boolean {
|
public isValidInputFile(input: string, file: string): boolean {
|
||||||
return taskLib.filePathSupplied(input) && this.fileExists(file);
|
return taskLib.filePathSupplied(input) && this.fileExists(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fileExists(file: string): boolean {
|
public fileExists(file: string): boolean {
|
||||||
return taskLib.exist(file) && taskLib.stats(file).isFile();
|
return taskLib.exist(file) && taskLib.stats(file).isFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
public directoryExists(file: string): boolean {
|
public directoryExists(file: string): boolean {
|
||||||
return taskLib.exist(file) && taskLib.stats(file).isDirectory();
|
return taskLib.exist(file) && taskLib.stats(file).isDirectory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { BuildAgent }
|
||||||
BuildAgent,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,62 +1,122 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from 'fs'
|
||||||
import * as path from "path";
|
import * as path from 'path'
|
||||||
|
import * as urlApi from 'url'
|
||||||
|
|
||||||
import uuidv4 from "uuid";
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from '@actions/core'
|
||||||
import * as exe from "@actions/exec";
|
import * as exe from '@actions/exec'
|
||||||
import * as io from "@actions/io";
|
import * as io from '@actions/io'
|
||||||
import * as toolCache from "@actions/tool-cache";
|
import * as toolCache from '@actions/tool-cache'
|
||||||
|
|
||||||
import { injectable } from "inversify";
|
import { injectable } from 'inversify'
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../../core/models";
|
import { IBuildAgent, IExecResult } from '../../core/models'
|
||||||
|
import {
|
||||||
|
IRequestOptions,
|
||||||
|
IProxyConfiguration
|
||||||
|
} from 'typed-rest-client/Interfaces'
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|
||||||
public get agentName(): string {
|
public get agentName(): string {
|
||||||
return "GitHub Actions";
|
return 'GitHub Actions'
|
||||||
}
|
}
|
||||||
|
|
||||||
public find(toolName: string, versionSpec: string, arch?: string): string {
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
return toolCache.find(toolName, versionSpec, arch);
|
return toolCache.find(toolName, versionSpec, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
public proxyConfiguration(url: string): IRequestOptions {
|
||||||
return toolCache.cacheDir(sourceDir, tool, version, arch);
|
return {
|
||||||
|
proxy: this.getProxyConfiguration(url),
|
||||||
|
cert: undefined,
|
||||||
|
ignoreSslError: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private getProxyConfiguration(requestedUrl: string): IProxyConfiguration {
|
||||||
|
let noProxy = process.env.NO_PROXY || process.env.no_proxy || null
|
||||||
|
let allowedHostsWithoutProxy
|
||||||
|
let dontUseProxy = false
|
||||||
|
if (noProxy) {
|
||||||
|
if (noProxy === '*') {
|
||||||
|
dontUseProxy = true
|
||||||
|
} else {
|
||||||
|
allowedHostsWithoutProxy = noProxy.split(',')
|
||||||
|
if (requestedUrl) {
|
||||||
|
allowedHostsWithoutProxy.forEach(host => {
|
||||||
|
if (new RegExp(host, 'i').test(requestedUrl)) {
|
||||||
|
dontUseProxy = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dontUseProxy) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
return {
|
||||||
|
proxyUrl: `${url.protocol}//${url.hostname}:${url.port}`,
|
||||||
|
proxyUsername: url.username,
|
||||||
|
proxyPassword: url.password,
|
||||||
|
proxyBypassHosts: allowedHostsWithoutProxy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
public cacheDir(
|
||||||
|
sourceDir: string,
|
||||||
|
tool: string,
|
||||||
|
version: string,
|
||||||
|
arch?: string
|
||||||
|
): Promise<string> {
|
||||||
|
return toolCache.cacheDir(sourceDir, tool, version, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async createTempDir(): Promise<string> {
|
public async createTempDir(): Promise<string> {
|
||||||
const IS_WINDOWS = process.platform === "win32";
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
|
|
||||||
let tempDirectory: string = process.env.RUNNER_TEMP || "";
|
let tempDirectory: string = process.env.RUNNER_TEMP || ''
|
||||||
|
|
||||||
if (!tempDirectory) {
|
if (!tempDirectory) {
|
||||||
let baseLocation: string;
|
let baseLocation: string
|
||||||
if (IS_WINDOWS) {
|
if (IS_WINDOWS) {
|
||||||
// On Windows use the USERPROFILE env variable
|
// On Windows use the USERPROFILE env variable
|
||||||
baseLocation = process.env.USERPROFILE || "C:\\";
|
baseLocation = process.env.USERPROFILE || 'C:\\'
|
||||||
} else {
|
} else {
|
||||||
if (process.platform === "darwin") {
|
if (process.platform === 'darwin') {
|
||||||
baseLocation = "/Users";
|
baseLocation = '/Users'
|
||||||
} else {
|
} else {
|
||||||
baseLocation = "/home";
|
baseLocation = '/home'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempDirectory = path.join(baseLocation, "actions", "temp");
|
tempDirectory = path.join(baseLocation, 'actions', 'temp')
|
||||||
}
|
}
|
||||||
const dest = path.join(tempDirectory, uuidv4());
|
const dest = path.join(tempDirectory, uuidv4())
|
||||||
await io.mkdirP(dest);
|
await io.mkdirP(dest)
|
||||||
return dest;
|
return dest
|
||||||
}
|
}
|
||||||
|
|
||||||
public debug(message: string): void {
|
public debug(message: string): void {
|
||||||
core.debug(message);
|
core.debug(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
public setFailed(message: string, done?: boolean): void {
|
public setFailed(message: string, done?: boolean): void {
|
||||||
core.setFailed(message);
|
core.setFailed(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
public setSucceeded(message: string, done?: boolean): void {
|
public setSucceeded(message: string, done?: boolean): void {
|
||||||
@@ -64,108 +124,104 @@ class BuildAgent implements IBuildAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public exportVariable(name: string, val: string): void {
|
public exportVariable(name: string, val: string): void {
|
||||||
core.exportVariable(name, val);
|
core.exportVariable(name, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVariable(name: string): string {
|
public getVariable(name: string): string {
|
||||||
return process.env[name];
|
return process.env[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
public addPath(inputPath: string): void {
|
public addPath(inputPath: string): void {
|
||||||
core.addPath(inputPath);
|
core.addPath(inputPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
public which(tool: string, check?: boolean): Promise<string> {
|
public which(tool: string, check?: boolean): Promise<string> {
|
||||||
return io.which(tool, check);
|
return io.which(tool, check)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
const dotnetPath = await io.which(exec, true);
|
const dotnetPath = await io.which(exec, true)
|
||||||
let resultCode = 0;
|
let resultCode = 0
|
||||||
let stdout = "";
|
let stdout = ''
|
||||||
let stderr = "";
|
let stderr = ''
|
||||||
resultCode = await exe.exec(
|
resultCode = await exe.exec(`"${dotnetPath}"`, args, {
|
||||||
`"${dotnetPath}"`,
|
listeners: {
|
||||||
args,
|
stderr: (data: Buffer) => {
|
||||||
{
|
stderr += data.toString()
|
||||||
listeners: {
|
|
||||||
stderr: (data: Buffer) => {
|
|
||||||
stderr += data.toString();
|
|
||||||
},
|
|
||||||
stdout: (data: Buffer) => {
|
|
||||||
stdout += data.toString();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
stdout: (data: Buffer) => {
|
||||||
|
stdout += data.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
code: resultCode,
|
code: resultCode,
|
||||||
error: null,
|
error: null,
|
||||||
stderr,
|
stderr,
|
||||||
stdout,
|
stdout
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSourceDir(): string {
|
public getSourceDir(): string {
|
||||||
return this.getVariable("GITHUB_WORKSPACE");
|
return this.getVariable('GITHUB_WORKSPACE')
|
||||||
}
|
}
|
||||||
|
|
||||||
public setOutput(name: string, value: string): void {
|
public setOutput(name: string, value: string): void {
|
||||||
core.setOutput(name, value);
|
core.setOutput(name, value)
|
||||||
|
core.exportVariable(`GITVERSION_${name.toUpperCase()}`, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInput(input: string, required?: boolean): string {
|
public getInput(input: string, required?: boolean): string {
|
||||||
return core.getInput(input, { required } as core.InputOptions);
|
return core.getInput(input, { required } as core.InputOptions)?.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
public getListInput(input: string, required?: boolean): string[] {
|
public getListInput(input: string, required?: boolean): string[] {
|
||||||
return core
|
return core
|
||||||
.getInput(input, { required } as core.InputOptions)
|
.getInput(input, { required } as core.InputOptions)
|
||||||
.split("\n")
|
.split('\n')
|
||||||
.filter(x => x !== "");
|
.filter(x => x !== '')
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBooleanInput(input: string, required?: boolean): boolean {
|
public getBooleanInput(input: string, required?: boolean): boolean {
|
||||||
const inputValue = this.getInput(input, required);
|
const inputValue = this.getInput(input, required)
|
||||||
return (inputValue || "false").toLowerCase() === "true";
|
return (inputValue || 'false').toLowerCase() === 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidInputFile(input: string, file: string): boolean {
|
public isValidInputFile(input: string, file: string): boolean {
|
||||||
return this.filePathSupplied(input) && this.fileExists(file);
|
return this.filePathSupplied(input) && this.fileExists(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
public filePathSupplied(file: string): boolean {
|
public filePathSupplied(file: string): boolean {
|
||||||
const pathValue = path.resolve(this.getInput(file) || "");
|
const pathValue = path.resolve(this.getInput(file) || '')
|
||||||
const repoRoot = this.getSourceDir();
|
const repoRoot = this.getSourceDir()
|
||||||
return pathValue !== repoRoot;
|
return pathValue !== repoRoot
|
||||||
}
|
}
|
||||||
|
|
||||||
public fileExists(file: string): boolean {
|
public fileExists(file: string): boolean {
|
||||||
return this._exist(file) && this._stats(file).isFile();
|
return this._exist(file) && this._stats(file).isFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
public directoryExists(file: string): boolean {
|
public directoryExists(file: string): boolean {
|
||||||
return this._exist(file) && this._stats(file).isDirectory();
|
return this._exist(file) && this._stats(file).isDirectory()
|
||||||
}
|
}
|
||||||
|
|
||||||
private _exist(file: string): boolean {
|
private _exist(file: string): boolean {
|
||||||
let exist = false;
|
let exist = false
|
||||||
try {
|
try {
|
||||||
exist = !!(file && fs.statSync(file) != null);
|
exist = !!(file && fs.statSync(file) != null)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err && err.code === "ENOENT") {
|
if (err && err.code === 'ENOENT') {
|
||||||
exist = false;
|
exist = false
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return exist;
|
return exist
|
||||||
}
|
}
|
||||||
|
|
||||||
private _stats(file: string): fs.Stats {
|
private _stats(file: string): fs.Stats {
|
||||||
return fs.statSync(file);
|
return fs.statSync(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { BuildAgent }
|
||||||
BuildAgent,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,109 +1,116 @@
|
|||||||
import { injectable } from "inversify";
|
import { injectable } from 'inversify'
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../../core/models";
|
import { IBuildAgent, IExecResult } from '../../core/models'
|
||||||
|
import { IRequestOptions } from 'typed-rest-client/Interfaces'
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
proxyConfiguration(url: string): IRequestOptions {
|
||||||
|
console.log('proxyConfiguration')
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
public get agentName(): string {
|
public get agentName(): string {
|
||||||
console.log("getAgentName");
|
console.log('getAgentName')
|
||||||
return "Mock";
|
return 'Mock'
|
||||||
}
|
}
|
||||||
|
|
||||||
public find(toolName: string, versionSpec: string, arch?: string): string {
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
console.log("find");
|
console.log('find')
|
||||||
return "find";
|
return 'find'
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
public cacheDir(
|
||||||
console.log("cacheDir");
|
sourceDir: string,
|
||||||
return Promise.resolve("cacheDir");
|
tool: string,
|
||||||
|
version: string,
|
||||||
|
arch?: string
|
||||||
|
): Promise<string> {
|
||||||
|
console.log('cacheDir')
|
||||||
|
return Promise.resolve('cacheDir')
|
||||||
}
|
}
|
||||||
|
|
||||||
public createTempDir(): Promise<string> {
|
public createTempDir(): Promise<string> {
|
||||||
console.log("createTempDir");
|
console.log('createTempDir')
|
||||||
return Promise.resolve("createTempDir");
|
return Promise.resolve('createTempDir')
|
||||||
}
|
}
|
||||||
|
|
||||||
public debug(message: string): void {
|
public debug(message: string): void {
|
||||||
console.log("debug");
|
console.log('debug')
|
||||||
}
|
}
|
||||||
|
|
||||||
public setFailed(message: string, done?: boolean): void {
|
public setFailed(message: string, done?: boolean): void {
|
||||||
console.log("setFailed");
|
console.log('setFailed')
|
||||||
}
|
}
|
||||||
|
|
||||||
public setSucceeded(message: string, done?: boolean): void {
|
public setSucceeded(message: string, done?: boolean): void {
|
||||||
console.log("setSucceeded");
|
console.log('setSucceeded')
|
||||||
}
|
}
|
||||||
|
|
||||||
public exportVariable(name: string, val: string): void {
|
public exportVariable(name: string, val: string): void {
|
||||||
console.log("exportVariable");
|
console.log('exportVariable')
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVariable(name: string): string {
|
public getVariable(name: string): string {
|
||||||
console.log("getVariable");
|
console.log('getVariable')
|
||||||
return "getVariable";
|
return 'getVariable'
|
||||||
}
|
}
|
||||||
|
|
||||||
public addPath(inputPath: string): void {
|
public addPath(inputPath: string): void {
|
||||||
console.log("addPath");
|
console.log('addPath')
|
||||||
}
|
}
|
||||||
|
|
||||||
public which(tool: string, check?: boolean): Promise<string> {
|
public which(tool: string, check?: boolean): Promise<string> {
|
||||||
console.log("which");
|
console.log('which')
|
||||||
return Promise.resolve("which");
|
return Promise.resolve('which')
|
||||||
}
|
}
|
||||||
|
|
||||||
public exec(exec: string, args: string[]): Promise<IExecResult> {
|
public exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
code: 0,
|
code: 0,
|
||||||
error: null,
|
error: null,
|
||||||
stderr: "result.stderr",
|
stderr: 'result.stderr',
|
||||||
stdout: "result.stdout",
|
stdout: 'result.stdout'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSourceDir(): string {
|
public getSourceDir(): string {
|
||||||
console.log("getSourceDir");
|
console.log('getSourceDir')
|
||||||
return "getSourceDir";
|
return 'getSourceDir'
|
||||||
}
|
}
|
||||||
|
|
||||||
public setOutput(name: string, value: string): void {
|
public setOutput(name: string, value: string): void {
|
||||||
console.log("setOutput");
|
console.log('setOutput')
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInput(input: string, required?: boolean): string {
|
public getInput(input: string, required?: boolean): string {
|
||||||
console.log("getInput");
|
console.log('getInput')
|
||||||
return "getInput";
|
return 'getInput'
|
||||||
}
|
}
|
||||||
|
|
||||||
public getListInput(input: string, required?: boolean): string[] {
|
public getListInput(input: string, required?: boolean): string[] {
|
||||||
console.log("getListInput");
|
console.log('getListInput')
|
||||||
return ["getInput"];
|
return ['getInput']
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBooleanInput(input: string, required?: boolean): boolean {
|
public getBooleanInput(input: string, required?: boolean): boolean {
|
||||||
console.log("getBooleanInput");
|
console.log('getBooleanInput')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidInputFile(input: string, file: string) {
|
public isValidInputFile(input: string, file: string) {
|
||||||
console.log("isValidInputFile");
|
console.log('isValidInputFile')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
public fileExists(file: string) {
|
public fileExists(file: string) {
|
||||||
console.log("fileExists");
|
console.log('fileExists')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
public directoryExists(file: string) {
|
public directoryExists(file: string) {
|
||||||
console.log("directoryExists");
|
console.log('directoryExists')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { BuildAgent }
|
||||||
BuildAgent,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,68 +1,83 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from 'fs'
|
||||||
import * as os from "os";
|
import * as os from 'os'
|
||||||
import * as path from "path";
|
import * as path from 'path'
|
||||||
import * as http from "typed-rest-client/HttpClient";
|
import * as http from 'typed-rest-client/HttpClient'
|
||||||
|
|
||||||
import { inject, injectable } from "inversify";
|
import { inject, injectable } from 'inversify'
|
||||||
import { TYPES, IExecResult, IBuildAgent } from "./models";
|
import { TYPES, IExecResult, IBuildAgent } from './models'
|
||||||
import { IVersionManager } from "./versionManager";
|
import { IVersionManager } from './versionManager'
|
||||||
|
|
||||||
export interface IDotnetTool {
|
export interface IDotnetTool {
|
||||||
disableTelemetry(): void;
|
disableTelemetry(): void
|
||||||
toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean): Promise<string>;
|
toolInstall(
|
||||||
|
toolName: string,
|
||||||
|
versionSpec: string,
|
||||||
|
checkLatest: boolean,
|
||||||
|
includePre: boolean
|
||||||
|
): Promise<string>
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class DotnetTool implements IDotnetTool {
|
export class DotnetTool implements IDotnetTool {
|
||||||
|
protected buildAgent: IBuildAgent
|
||||||
|
protected versionManager: IVersionManager
|
||||||
|
private httpClient: http.HttpClient
|
||||||
|
|
||||||
protected buildAgent: IBuildAgent;
|
private static readonly nugetRoot: string =
|
||||||
protected versionManager: IVersionManager;
|
'https://api-v2v3search-0.nuget.org/'
|
||||||
private httpClient: http.HttpClient;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager,
|
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||||
) {
|
) {
|
||||||
this.buildAgent = buildAgent;
|
this.buildAgent = buildAgent
|
||||||
this.versionManager = versionManager;
|
this.versionManager = versionManager
|
||||||
this.httpClient = new http.HttpClient("dotnet");
|
this.httpClient = new http.HttpClient(
|
||||||
|
'dotnet',
|
||||||
|
undefined,
|
||||||
|
this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public disableTelemetry(): void {
|
public disableTelemetry(): void {
|
||||||
this.buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
this.buildAgent.exportVariable('DOTNET_CLI_TELEMETRY_OPTOUT', '1')
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
||||||
console.log(`Command: ${cmd} ${args.join(' ')}`);
|
console.log(`Command: ${cmd} ${args.join(' ')}`)
|
||||||
return this.buildAgent.exec(cmd, args);
|
return this.buildAgent.exec(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean)
|
public async toolInstall(
|
||||||
: Promise<string> {
|
toolName: string,
|
||||||
console.log("");
|
versionSpec: string,
|
||||||
console.log("--------------------------");
|
checkLatest: boolean,
|
||||||
console.log(`Installing ${toolName} version ` + versionSpec);
|
includePre: boolean
|
||||||
console.log("--------------------------");
|
): Promise<string> {
|
||||||
|
console.log('')
|
||||||
|
console.log('--------------------------')
|
||||||
|
console.log(`Installing ${toolName} version ` + versionSpec)
|
||||||
|
console.log('--------------------------')
|
||||||
|
|
||||||
if (this.versionManager.isExplicitVersion(versionSpec)) {
|
if (this.versionManager.isExplicitVersion(versionSpec)) {
|
||||||
checkLatest = false; // check latest doesn't make sense when explicit version
|
checkLatest = false // check latest doesn't make sense when explicit version
|
||||||
}
|
}
|
||||||
|
|
||||||
let toolPath: string;
|
let toolPath: string
|
||||||
if (!checkLatest) {
|
if (!checkLatest) {
|
||||||
//
|
//
|
||||||
// Let's try and resolve the version spec locally first
|
// Let's try and resolve the version spec locally first
|
||||||
//
|
//
|
||||||
toolPath = this.buildAgent.find(toolName, versionSpec);
|
toolPath = this.buildAgent.find(toolName, versionSpec)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toolPath) {
|
if (!toolPath) {
|
||||||
let version: string;
|
let version: string
|
||||||
if (this.versionManager.isExplicitVersion(versionSpec)) {
|
if (this.versionManager.isExplicitVersion(versionSpec)) {
|
||||||
//
|
//
|
||||||
// Explicit version was specified. No need to query for list of versions.
|
// Explicit version was specified. No need to query for list of versions.
|
||||||
//
|
//
|
||||||
version = versionSpec;
|
version = versionSpec
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// Let's query and resolve the latest version for the versionSpec.
|
// Let's query and resolve the latest version for the versionSpec.
|
||||||
@@ -70,21 +85,27 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
// If your tool doesn't offer a mechanism to query,
|
// If your tool doesn't offer a mechanism to query,
|
||||||
// then it can only support exact version inputs.
|
// then it can only support exact version inputs.
|
||||||
//
|
//
|
||||||
version = await this.queryLatestMatch(toolName, versionSpec, includePre);
|
version = await this.queryLatestMatch(
|
||||||
|
toolName,
|
||||||
|
versionSpec,
|
||||||
|
includePre
|
||||||
|
)
|
||||||
if (!version) {
|
if (!version) {
|
||||||
throw new Error(`Unable to find ${toolName} version '${versionSpec}'.`);
|
throw new Error(
|
||||||
|
`Unable to find ${toolName} version '${versionSpec}'.`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check the cache for the resolved version.
|
// Check the cache for the resolved version.
|
||||||
//
|
//
|
||||||
toolPath = this.buildAgent.find(toolName, version);
|
toolPath = this.buildAgent.find(toolName, version)
|
||||||
}
|
}
|
||||||
if (!toolPath) {
|
if (!toolPath) {
|
||||||
//
|
//
|
||||||
// Download, extract, cache
|
// Download, extract, cache
|
||||||
//
|
//
|
||||||
toolPath = await this.acquireTool(toolName, version);
|
toolPath = await this.acquireTool(toolName, version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,60 +113,82 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
// Prepend the tools path. This prepends the PATH for the current process and
|
// Prepend the tools path. This prepends the PATH for the current process and
|
||||||
// instructs the agent to prepend for each task that follows.
|
// instructs the agent to prepend for each task that follows.
|
||||||
//
|
//
|
||||||
this.buildAgent.debug(`toolPath: ${toolPath}`);
|
this.buildAgent.debug(`toolPath: ${toolPath}`)
|
||||||
|
|
||||||
if (os.platform() !== "win32") {
|
if (
|
||||||
const dotnetRoot = path.dirname(fs.readlinkSync(await this.buildAgent.which("dotnet")));
|
os.platform() !== 'win32' &&
|
||||||
this.buildAgent.exportVariable("DOTNET_ROOT", dotnetRoot);
|
!this.buildAgent.getVariable('DOTNET_ROOT')
|
||||||
|
) {
|
||||||
|
let dotnetPath = await this.buildAgent.which('dotnet')
|
||||||
|
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
|
||||||
|
const dotnetRoot = path.dirname(dotnetPath)
|
||||||
|
this.buildAgent.exportVariable('DOTNET_ROOT', dotnetRoot)
|
||||||
}
|
}
|
||||||
this.buildAgent.addPath(toolPath);
|
this.buildAgent.addPath(toolPath)
|
||||||
|
|
||||||
return toolPath;
|
return toolPath
|
||||||
}
|
}
|
||||||
|
|
||||||
private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise<string> {
|
private async queryLatestMatch(
|
||||||
this.buildAgent.debug(`querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ""} ${includePrerelease ? "including pre-releases" : ""}`);
|
toolName: string,
|
||||||
|
versionSpec: string,
|
||||||
|
includePrerelease: boolean
|
||||||
|
): Promise<string> {
|
||||||
|
this.buildAgent.debug(
|
||||||
|
`querying tool versions for ${toolName}${
|
||||||
|
versionSpec ? `@${versionSpec}` : ''
|
||||||
|
} ${includePrerelease ? 'including pre-releases' : ''}`
|
||||||
|
)
|
||||||
|
|
||||||
const downloadPath = `https://api-v2v3search-0.nuget.org/query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${includePrerelease ? "true" : "false"}&semVerLevel=2.0.0`;
|
const downloadPath = `${
|
||||||
const res = await this.httpClient.get(downloadPath);
|
DotnetTool.nugetRoot
|
||||||
|
}query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${
|
||||||
|
includePrerelease ? 'true' : 'false'
|
||||||
|
}&semVerLevel=2.0.0`
|
||||||
|
|
||||||
|
const res = await this.httpClient.get(downloadPath)
|
||||||
|
|
||||||
if (!res || res.message.statusCode !== 200) {
|
if (!res || res.message.statusCode !== 200) {
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const body: string = await res.readBody();
|
const body: string = await res.readBody()
|
||||||
const data = JSON.parse(body).data;
|
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) {
|
if (!versions || !versions.length) {
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buildAgent.debug(`got versions: ${versions.join(", ")}`);
|
this.buildAgent.debug(`got versions: ${versions.join(', ')}`)
|
||||||
|
|
||||||
return this.versionManager.evaluateVersions(versions, versionSpec);
|
return this.versionManager.evaluateVersions(versions, versionSpec)
|
||||||
}
|
}
|
||||||
|
|
||||||
private async acquireTool(toolName: string, version: string): Promise<string> {
|
private async acquireTool(
|
||||||
|
toolName: string,
|
||||||
const tempDirectory = await this.buildAgent.createTempDir();
|
version: string
|
||||||
let args = ["tool", "install", toolName, "--tool-path", tempDirectory];
|
): Promise<string> {
|
||||||
|
const tempDirectory = await this.buildAgent.createTempDir()
|
||||||
|
let args = ['tool', 'install', toolName, '--tool-path', tempDirectory]
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
version = this.versionManager.cleanVersion(version);
|
version = this.versionManager.cleanVersion(version)
|
||||||
args = args.concat(["--version", version]);
|
args = args.concat(['--version', version])
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.execute("dotnet", args);
|
const result = await this.execute('dotnet', args)
|
||||||
const status = result.code === 0 ? "success" : "failure";
|
const status = result.code === 0 ? 'success' : 'failure'
|
||||||
const message = result.code === 0 ? result.stdout : result.stderr;
|
const message = result.code === 0 ? result.stdout : result.stderr
|
||||||
|
|
||||||
this.buildAgent.debug(`tool install result: ${status} ${message}`);
|
this.buildAgent.debug(`tool install result: ${status} ${message}`)
|
||||||
|
|
||||||
if (result.code) {
|
if (result.code) {
|
||||||
throw new Error("Error installing tool");
|
throw new Error('Error installing tool')
|
||||||
}
|
}
|
||||||
|
|
||||||
return await this.buildAgent.cacheDir(tempDirectory, toolName, version);
|
return await this.buildAgent.cacheDir(tempDirectory, toolName, version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Container } from "inversify";
|
import { Container } from 'inversify'
|
||||||
import { IVersionManager, VersionManager } from "./versionManager";
|
import { IVersionManager, VersionManager } from './versionManager'
|
||||||
import { TYPES, IBuildAgent } from "./models";
|
import { TYPES, IBuildAgent } from './models'
|
||||||
import { BuildAgent } from "../agent/mock/build-agent";
|
import { BuildAgent } from '../agent/mock/build-agent'
|
||||||
|
|
||||||
const container = new Container();
|
const container = new Container()
|
||||||
|
|
||||||
container.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
container.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager)
|
||||||
container.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
container.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent)
|
||||||
|
|
||||||
export default container;
|
export default container
|
||||||
|
|||||||
@@ -1,49 +1,57 @@
|
|||||||
|
import { IRequestOptions } from 'typed-rest-client/Interfaces'
|
||||||
|
|
||||||
export const TYPES = {
|
export const TYPES = {
|
||||||
IBuildAgent: Symbol.for("BuildAgent"),
|
IBuildAgent: Symbol.for('BuildAgent'),
|
||||||
IDotnetTool: Symbol.for("DotnetTool"),
|
IDotnetTool: Symbol.for('DotnetTool'),
|
||||||
IGitVersionTool: Symbol.for("GitVersionTool"),
|
IGitVersionTool: Symbol.for('GitVersionTool'),
|
||||||
IGitReleaseManagerTool: Symbol.for("GitReleaseManagerTool"),
|
IGitReleaseManagerTool: Symbol.for('GitReleaseManagerTool'),
|
||||||
IVersionManager: Symbol.for("VersionManager"),
|
IVersionManager: Symbol.for('VersionManager')
|
||||||
};
|
}
|
||||||
|
|
||||||
export enum SetupFields {
|
export enum SetupFields {
|
||||||
includePrerelease = "includePrerelease",
|
includePrerelease = 'includePrerelease',
|
||||||
versionSpec = "versionSpec",
|
versionSpec = 'versionSpec'
|
||||||
};
|
}
|
||||||
|
|
||||||
export interface ISetupSettings {
|
export interface ISetupSettings {
|
||||||
[SetupFields.versionSpec]: string;
|
[SetupFields.versionSpec]: string
|
||||||
[SetupFields.includePrerelease]: boolean;
|
[SetupFields.includePrerelease]: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IExecResult {
|
export interface IExecResult {
|
||||||
stdout: string;
|
stdout: string
|
||||||
stderr: string;
|
stderr: string
|
||||||
code: number;
|
code: number
|
||||||
error: Error;
|
error: Error
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBuildAgent {
|
export interface IBuildAgent {
|
||||||
agentName: string;
|
agentName: string
|
||||||
find(toolName: string, versionSpec: string, arch?: string): string;
|
proxyConfiguration(url: string): IRequestOptions
|
||||||
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
find(toolName: string, versionSpec: string, arch?: string): string
|
||||||
createTempDir(): Promise<string>;
|
cacheDir(
|
||||||
debug(message: string): void;
|
sourceDir: string,
|
||||||
setFailed(message: string, done?: boolean): void;
|
tool: string,
|
||||||
setSucceeded(message: string, done?: boolean): void;
|
version: string,
|
||||||
exportVariable(name: string, val: string): void;
|
arch?: string
|
||||||
getVariable(name: string): string;
|
): Promise<string>
|
||||||
addPath(inputPath: string): void;
|
createTempDir(): Promise<string>
|
||||||
which(tool: string, check?: boolean): Promise<string>;
|
debug(message: string): void
|
||||||
exec(exec: string, args: string[]): Promise<IExecResult>;
|
setFailed(message: string, done?: boolean): void
|
||||||
|
setSucceeded(message: string, done?: boolean): void
|
||||||
|
exportVariable(name: string, val: string): void
|
||||||
|
getVariable(name: string): string
|
||||||
|
addPath(inputPath: string): void
|
||||||
|
which(tool: string, check?: boolean): Promise<string>
|
||||||
|
exec(exec: string, args: string[]): Promise<IExecResult>
|
||||||
|
|
||||||
getSourceDir(): string;
|
getSourceDir(): string
|
||||||
isValidInputFile(input: string, file: string): boolean;
|
isValidInputFile(input: string, file: string): boolean
|
||||||
fileExists(file: string): boolean;
|
fileExists(file: string): boolean
|
||||||
directoryExists(file: string): boolean;
|
directoryExists(file: string): boolean
|
||||||
|
|
||||||
setOutput(name: string, value: string): void;
|
setOutput(name: string, value: string): void
|
||||||
getInput(input: string, required?: boolean): string;
|
getInput(input: string, required?: boolean): string
|
||||||
getListInput(input: string, required?: boolean): string[];
|
getListInput(input: string, required?: boolean): string[]
|
||||||
getBooleanInput(input: string, required?: boolean): boolean;
|
getBooleanInput(input: string, required?: boolean): boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { IBuildAgent, SetupFields, ISetupSettings } from "./models";
|
import { IBuildAgent, SetupFields, ISetupSettings } from './models'
|
||||||
|
|
||||||
export class Settings {
|
export class Settings {
|
||||||
|
|
||||||
public static getSetupSettings(buildAgent: IBuildAgent): ISetupSettings {
|
public static getSetupSettings(buildAgent: IBuildAgent): ISetupSettings {
|
||||||
const versionSpec = buildAgent.getInput(SetupFields.versionSpec);
|
const versionSpec = buildAgent.getInput(SetupFields.versionSpec)
|
||||||
const includePrerelease = buildAgent.getBooleanInput(SetupFields.includePrerelease);
|
const includePrerelease = buildAgent.getBooleanInput(
|
||||||
|
SetupFields.includePrerelease
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
versionSpec,
|
versionSpec,
|
||||||
includePrerelease
|
includePrerelease
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +1,56 @@
|
|||||||
import cmp from "semver-compare";
|
import cmp from 'semver-compare'
|
||||||
import * as semver from "semver";
|
import * as semver from 'semver'
|
||||||
import { injectable, inject } from "inversify";
|
import { injectable, inject } from 'inversify'
|
||||||
|
|
||||||
import { IBuildAgent, TYPES } from "./models";
|
import { IBuildAgent, TYPES } from './models'
|
||||||
|
|
||||||
export interface IVersionManager {
|
export interface IVersionManager {
|
||||||
isExplicitVersion(versionSpec: string): boolean;
|
isExplicitVersion(versionSpec: string): boolean
|
||||||
evaluateVersions(versions: string[], versionSpec: string): string;
|
evaluateVersions(versions: string[], versionSpec: string): string
|
||||||
cleanVersion(version: string): string;
|
cleanVersion(version: string): string
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class VersionManager implements IVersionManager {
|
export class VersionManager implements IVersionManager {
|
||||||
|
private buildAgent: IBuildAgent
|
||||||
private buildAgent: IBuildAgent;
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
|
||||||
constructor(
|
this.buildAgent = buildAgent
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
|
||||||
) {
|
|
||||||
this.buildAgent = buildAgent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public isExplicitVersion(versionSpec: string): boolean {
|
public isExplicitVersion(versionSpec: string): boolean {
|
||||||
const c = semver.clean(versionSpec);
|
const c = semver.clean(versionSpec)
|
||||||
this.buildAgent.debug("isExplicit: " + c);
|
this.buildAgent.debug('isExplicit: ' + c)
|
||||||
|
|
||||||
const valid = semver.valid(c) != null;
|
const valid = semver.valid(c) != null
|
||||||
this.buildAgent.debug("explicit? " + valid);
|
this.buildAgent.debug('explicit? ' + valid)
|
||||||
|
|
||||||
return valid;
|
return valid
|
||||||
}
|
}
|
||||||
|
|
||||||
public evaluateVersions(versions: string[], versionSpec: string): string {
|
public evaluateVersions(versions: string[], versionSpec: string): string {
|
||||||
let version: string;
|
let version: string
|
||||||
this.buildAgent.debug("evaluating " + versions.length + " versions");
|
this.buildAgent.debug('evaluating ' + versions.length + ' versions')
|
||||||
versions = versions.sort(cmp);
|
versions = versions.sort(cmp)
|
||||||
for (let i = versions.length - 1; i >= 0; i--) {
|
for (let i = versions.length - 1; i >= 0; i--) {
|
||||||
const potential: string = versions[i];
|
const potential: string = versions[i]
|
||||||
const satisfied: boolean = semver.satisfies(potential, versionSpec);
|
const satisfied: boolean = semver.satisfies(potential, versionSpec)
|
||||||
if (satisfied) {
|
if (satisfied) {
|
||||||
version = potential;
|
version = potential
|
||||||
break;
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
this.buildAgent.debug("matched: " + version);
|
this.buildAgent.debug('matched: ' + version)
|
||||||
} else {
|
} else {
|
||||||
this.buildAgent.debug("match not found");
|
this.buildAgent.debug('match not found')
|
||||||
}
|
}
|
||||||
|
|
||||||
return version;
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
public cleanVersion(version: string): string {
|
public cleanVersion(version: string): string {
|
||||||
this.buildAgent.debug("cleaning: " + version);
|
this.buildAgent.debug('cleaning: ' + version)
|
||||||
return semver.clean(version);
|
return semver.clean(version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/tasks/gitreleasemanager/addasset.ts
Normal file
4
src/tasks/gitreleasemanager/addasset.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import 'reflect-metadata'
|
||||||
|
import { addAsset } from './main'
|
||||||
|
|
||||||
|
addAsset()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { close } from "./main";
|
import { close } from './main'
|
||||||
|
|
||||||
close();
|
close()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { create } from "./main";
|
import { create } from './main'
|
||||||
|
|
||||||
create();
|
create()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { discard } from "./main";
|
import { discard } from './main'
|
||||||
|
|
||||||
discard();
|
discard()
|
||||||
|
|||||||
@@ -1,86 +1,140 @@
|
|||||||
import { IBuildAgent, TYPES, SetupFields } from "../../core/models";
|
import { IBuildAgent, TYPES } from '../../core/models'
|
||||||
import { IGitReleaseManagerTool, GitReleaseManagerTool } from "../../tools/gitreleasemanager/tool";
|
import {
|
||||||
import { Settings as CommonSettings } from "../../core/settings";
|
IGitReleaseManagerTool,
|
||||||
import { Settings } from "../../tools/gitreleasemanager/settings";
|
GitReleaseManagerTool
|
||||||
|
} from '../../tools/gitreleasemanager/tool'
|
||||||
|
import { Settings as CommonSettings } from '../../core/settings'
|
||||||
|
import { Settings } from '../../tools/gitreleasemanager/settings'
|
||||||
|
|
||||||
import container from "../../core/ioc";
|
import container from '../../core/ioc'
|
||||||
|
|
||||||
container.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool);
|
container
|
||||||
|
.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
|
||||||
|
.to(GitReleaseManagerTool)
|
||||||
|
|
||||||
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool);
|
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(
|
||||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent);
|
TYPES.IGitReleaseManagerTool
|
||||||
|
)
|
||||||
|
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
||||||
|
|
||||||
export async function setup() {
|
export async function setup() {
|
||||||
try {
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
gitReleaseManagerTool.disableTelemetry();
|
const settings = CommonSettings.getSetupSettings(buildAgent)
|
||||||
|
|
||||||
const settings = CommonSettings.getSetupSettings(buildAgent);
|
await gitReleaseManagerTool.install(
|
||||||
|
settings.versionSpec,
|
||||||
|
settings.includePrerelease
|
||||||
|
)
|
||||||
|
|
||||||
await gitReleaseManagerTool.install(settings.versionSpec, settings.includePrerelease);
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager installed successfully',
|
||||||
buildAgent.setSucceeded("GitVersionManager installed successfully", true);
|
true
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function create() {
|
export async function create() {
|
||||||
try {
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
gitReleaseManagerTool.disableTelemetry();
|
const settings = Settings.getCreateSettings(buildAgent)
|
||||||
|
|
||||||
const settings = Settings.getCreateSettings(buildAgent);
|
await gitReleaseManagerTool.create(settings)
|
||||||
|
|
||||||
await gitReleaseManagerTool.create(settings);
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager created release successfully',
|
||||||
buildAgent.setSucceeded("GitVersionManager created release successfully", true);
|
true
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function discard() {
|
export async function discard() {
|
||||||
try {
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
gitReleaseManagerTool.disableTelemetry();
|
const settings = Settings.getDiscardSettings(buildAgent)
|
||||||
|
|
||||||
const settings = Settings.getDiscardSettings(buildAgent);
|
await gitReleaseManagerTool.discard(settings)
|
||||||
|
|
||||||
await gitReleaseManagerTool.discard(settings);
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager discarded release successfully',
|
||||||
buildAgent.setSucceeded("GitVersionManager discarded release successfully", true);
|
true
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function close() {
|
export async function close() {
|
||||||
try {
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
gitReleaseManagerTool.disableTelemetry();
|
const settings = Settings.getCloseSettings(buildAgent)
|
||||||
|
|
||||||
const settings = Settings.getCloseSettings(buildAgent);
|
await gitReleaseManagerTool.close(settings)
|
||||||
|
|
||||||
await gitReleaseManagerTool.close(settings);
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager closed release successfully',
|
||||||
buildAgent.setSucceeded("GitVersionManager closed release successfully", true);
|
true
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function open() {
|
export async function open() {
|
||||||
try {
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
gitReleaseManagerTool.disableTelemetry();
|
const settings = Settings.getOpenSettings(buildAgent)
|
||||||
|
|
||||||
const settings = Settings.getOpenSettings(buildAgent);
|
await gitReleaseManagerTool.open(settings)
|
||||||
|
|
||||||
await gitReleaseManagerTool.close(settings);
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager opened release successfully',
|
||||||
buildAgent.setSucceeded("GitVersionManager opened release successfully", true);
|
true
|
||||||
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function publish() {
|
||||||
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
|
const settings = Settings.getPublishSettings(buildAgent)
|
||||||
|
|
||||||
|
await gitReleaseManagerTool.publish(settings)
|
||||||
|
|
||||||
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager published release successfully',
|
||||||
|
true
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error.message, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function addAsset() {
|
||||||
|
try {
|
||||||
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
|
const settings = Settings.getAddAssetSettings(buildAgent)
|
||||||
|
|
||||||
|
await gitReleaseManagerTool.addAsset(settings)
|
||||||
|
|
||||||
|
buildAgent.setSucceeded(
|
||||||
|
'GitVersionManager added assets to release successfully',
|
||||||
|
true
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error.message, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { open } from "./main";
|
import { open } from './main'
|
||||||
|
|
||||||
open();
|
open()
|
||||||
|
|||||||
4
src/tasks/gitreleasemanager/publish.ts
Normal file
4
src/tasks/gitreleasemanager/publish.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import 'reflect-metadata'
|
||||||
|
import { publish } from './main'
|
||||||
|
|
||||||
|
publish()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { setup } from "./main";
|
import { setup } from './main'
|
||||||
|
|
||||||
setup();
|
setup()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { run } from "./main";
|
import { run } from './main'
|
||||||
|
|
||||||
run();
|
run()
|
||||||
|
|||||||
@@ -1,50 +1,60 @@
|
|||||||
import { IBuildAgent, TYPES, SetupFields } from "../../core/models";
|
import { IBuildAgent, TYPES } from '../../core/models'
|
||||||
import { Settings as CommonSettings } from "../../core/settings";
|
import { Settings as CommonSettings } from '../../core/settings'
|
||||||
import { Settings } from "../../tools/gitversion/settings";
|
import { Settings } from '../../tools/gitversion/settings'
|
||||||
import { IGitVersionTool, GitVersionTool } from "../../tools/gitversion/tool";
|
import { IGitVersionTool, GitVersionTool } from '../../tools/gitversion/tool'
|
||||||
import { GitVersionSettings, GitVersionOutput } from "../../tools/gitversion/models";
|
import {
|
||||||
|
GitVersionSettings,
|
||||||
|
GitVersionOutput
|
||||||
|
} from '../../tools/gitversion/models'
|
||||||
|
|
||||||
import container from "../../core/ioc";
|
import container from '../../core/ioc'
|
||||||
|
|
||||||
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
|
||||||
|
|
||||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
|
||||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent);
|
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
||||||
|
|
||||||
export async function setup() {
|
export async function setup() {
|
||||||
try {
|
try {
|
||||||
|
gitVersionTool.disableTelemetry()
|
||||||
|
|
||||||
gitVersionTool.disableTelemetry();
|
const settings = CommonSettings.getSetupSettings(buildAgent)
|
||||||
|
|
||||||
const settings = CommonSettings.getSetupSettings(buildAgent);
|
await gitVersionTool.install(
|
||||||
|
settings.versionSpec,
|
||||||
|
settings.includePrerelease
|
||||||
|
)
|
||||||
|
|
||||||
await gitVersionTool.install(settings.versionSpec, settings.includePrerelease);
|
buildAgent.setSucceeded('GitVersion installed successfully', true)
|
||||||
|
|
||||||
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true);
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
|
gitVersionTool.disableTelemetry()
|
||||||
|
|
||||||
gitVersionTool.disableTelemetry();
|
const settings: GitVersionSettings = Settings.getGitVersionSettings(
|
||||||
|
buildAgent
|
||||||
|
)
|
||||||
|
|
||||||
const settings: GitVersionSettings = Settings.getGitVersionSettings(buildAgent);
|
const result = await gitVersionTool.run(settings)
|
||||||
|
const { stdout } = result
|
||||||
|
const jsonOutput = stdout.substring(
|
||||||
|
stdout.indexOf('{'),
|
||||||
|
stdout.indexOf('}') + 1
|
||||||
|
)
|
||||||
|
|
||||||
const result = await gitVersionTool.run(settings);
|
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
|
||||||
|
gitVersionTool.writeGitVersionToAgent(gitversion)
|
||||||
const gitversion = JSON.parse(result.stdout) as GitVersionOutput;
|
|
||||||
gitVersionTool.writeGitVersionToAgent(gitversion);
|
|
||||||
|
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
buildAgent.setSucceeded('GitVersion executed successfully', true)
|
||||||
} else {
|
} else {
|
||||||
buildAgent.setFailed(result.error.message, true);
|
buildAgent.setFailed(result.error.message, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error, true);
|
buildAgent.setFailed(error, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "reflect-metadata";
|
import 'reflect-metadata'
|
||||||
import { setup } from "./main";
|
import { setup } from './main'
|
||||||
|
|
||||||
setup();
|
setup()
|
||||||
|
|||||||
@@ -1,55 +1,79 @@
|
|||||||
export enum CommonFields {
|
export enum CommonFields {
|
||||||
repository = "repository",
|
repository = 'repository',
|
||||||
owner = "owner",
|
owner = 'owner',
|
||||||
token = "token",
|
token = 'token',
|
||||||
targetDirectory = "targetDirectory",
|
targetDirectory = 'targetDirectory'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CreateFields {
|
export enum CreateFields {
|
||||||
milestone = "milestone",
|
milestone = 'milestone',
|
||||||
releaseName = "releaseName",
|
name = 'name',
|
||||||
inputFileName = "inputFileName",
|
inputFileName = 'inputFileName',
|
||||||
isPreRelease = "isPreRelease",
|
isPreRelease = 'isPreRelease',
|
||||||
commit = "commit",
|
commit = 'commit',
|
||||||
assets = "assets",
|
assets = 'assets'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DiscardFields {
|
export enum DiscardFields {
|
||||||
milestone = "milestone",
|
milestone = 'milestone'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CloseFields {
|
export enum CloseFields {
|
||||||
milestone = "milestone",
|
milestone = 'milestone'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum OpenFields {
|
export enum OpenFields {
|
||||||
milestone = "milestone",
|
milestone = 'milestone'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PublishFields {
|
||||||
|
tagName = 'tagName'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum AddAssetFields {
|
||||||
|
tagName = 'tagName',
|
||||||
|
assets = 'assets'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerSettings {
|
export interface GitReleaseManagerSettings {
|
||||||
[CommonFields.repository]: string;
|
[CommonFields.repository]: string
|
||||||
[CommonFields.owner]: string;
|
[CommonFields.owner]: string
|
||||||
[CommonFields.token]: string;
|
[CommonFields.token]: string
|
||||||
[CommonFields.targetDirectory]: string;
|
[CommonFields.targetDirectory]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettings {
|
export interface GitReleaseManagerCreateSettings
|
||||||
[CreateFields.milestone]: string;
|
extends GitReleaseManagerSettings {
|
||||||
[CreateFields.releaseName]: string;
|
[CreateFields.milestone]: string
|
||||||
[CreateFields.inputFileName]: string;
|
[CreateFields.name]: string
|
||||||
[CreateFields.isPreRelease]: boolean;
|
[CreateFields.inputFileName]: string
|
||||||
[CreateFields.commit]: string;
|
[CreateFields.isPreRelease]: boolean
|
||||||
[CreateFields.assets]?: string[];
|
[CreateFields.commit]: string
|
||||||
|
[CreateFields.assets]?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
|
export interface GitReleaseManagerDiscardSettings
|
||||||
[DiscardFields.milestone]: string;
|
extends GitReleaseManagerSettings {
|
||||||
|
[DiscardFields.milestone]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
|
export interface GitReleaseManagerCloseSettings
|
||||||
[CloseFields.milestone]: string;
|
extends GitReleaseManagerSettings {
|
||||||
|
[CloseFields.milestone]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
|
export interface GitReleaseManagerOpenSettings
|
||||||
[OpenFields.milestone]: string;
|
extends GitReleaseManagerSettings {
|
||||||
}
|
[OpenFields.milestone]: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GitReleaseManagerPublishSettings
|
||||||
|
extends GitReleaseManagerSettings {
|
||||||
|
[PublishFields.tagName]: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GitReleaseManagerAddAssetSettings
|
||||||
|
extends GitReleaseManagerSettings {
|
||||||
|
[AddAssetFields.tagName]: string
|
||||||
|
[AddAssetFields.assets]: string[]
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,30 +1,39 @@
|
|||||||
import { IBuildAgent } from "../../core/models";
|
import { IBuildAgent } from '../../core/models'
|
||||||
import {
|
import {
|
||||||
GitReleaseManagerSettings,
|
GitReleaseManagerSettings,
|
||||||
CommonFields, CreateFields, DiscardFields,
|
CommonFields,
|
||||||
CloseFields, OpenFields,
|
CreateFields,
|
||||||
|
DiscardFields,
|
||||||
|
CloseFields,
|
||||||
|
OpenFields,
|
||||||
|
PublishFields,
|
||||||
|
AddAssetFields,
|
||||||
GitReleaseManagerCreateSettings,
|
GitReleaseManagerCreateSettings,
|
||||||
GitReleaseManagerDiscardSettings,
|
GitReleaseManagerDiscardSettings,
|
||||||
GitReleaseManagerCloseSettings,
|
GitReleaseManagerCloseSettings,
|
||||||
GitReleaseManagerOpenSettings,
|
GitReleaseManagerOpenSettings,
|
||||||
} from "./models";
|
GitReleaseManagerPublishSettings,
|
||||||
|
GitReleaseManagerAddAssetSettings
|
||||||
|
} from './models'
|
||||||
|
|
||||||
export class Settings {
|
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)
|
||||||
|
|
||||||
public static getCreateSettings(buildAgent: IBuildAgent): GitReleaseManagerCreateSettings {
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
const milestone = buildAgent.getInput(CreateFields.milestone);
|
|
||||||
const releaseName = buildAgent.getInput(CreateFields.releaseName);
|
|
||||||
const inputFileName = buildAgent.getInput(CreateFields.inputFileName);
|
|
||||||
const isPreRelease = buildAgent.getBooleanInput(CreateFields.isPreRelease);
|
|
||||||
const commit = buildAgent.getInput(CreateFields.commit);
|
|
||||||
const assets = buildAgent.getListInput(CreateFields.assets);
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone,
|
milestone,
|
||||||
releaseName,
|
name,
|
||||||
inputFileName,
|
inputFileName,
|
||||||
isPreRelease,
|
isPreRelease,
|
||||||
commit,
|
commit,
|
||||||
@@ -32,47 +41,83 @@ export class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getDiscardSettings(buildAgent: IBuildAgent): GitReleaseManagerDiscardSettings {
|
public static getDiscardSettings(
|
||||||
const milestone = buildAgent.getInput(DiscardFields.milestone);
|
buildAgent: IBuildAgent
|
||||||
|
): GitReleaseManagerDiscardSettings {
|
||||||
|
const milestone = buildAgent.getInput(DiscardFields.milestone)
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone,
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getCloseSettings(buildAgent: IBuildAgent): GitReleaseManagerCloseSettings {
|
public static getCloseSettings(
|
||||||
const milestone = buildAgent.getInput(CloseFields.milestone);
|
buildAgent: IBuildAgent
|
||||||
|
): GitReleaseManagerCloseSettings {
|
||||||
|
const milestone = buildAgent.getInput(CloseFields.milestone)
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone,
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getOpenSettings(buildAgent: IBuildAgent): GitReleaseManagerOpenSettings {
|
public static getOpenSettings(
|
||||||
const milestone = buildAgent.getInput(OpenFields.milestone);
|
buildAgent: IBuildAgent
|
||||||
|
): GitReleaseManagerOpenSettings {
|
||||||
|
const milestone = buildAgent.getInput(OpenFields.milestone)
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone,
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getCommonSettings(buildAgent: IBuildAgent): GitReleaseManagerSettings {
|
public static getPublishSettings(
|
||||||
const owner = buildAgent.getInput(CommonFields.owner, true);
|
buildAgent: IBuildAgent
|
||||||
const repository = buildAgent.getInput(CommonFields.repository, true);
|
): GitReleaseManagerPublishSettings {
|
||||||
const token = buildAgent.getInput(CommonFields.token, true);
|
const tagName = buildAgent.getInput(PublishFields.tagName)
|
||||||
const targetDirectory = buildAgent.getInput(CommonFields.targetDirectory);
|
|
||||||
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
|
return {
|
||||||
|
...commonSettings,
|
||||||
|
tagName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getAddAssetSettings(
|
||||||
|
buildAgent: IBuildAgent
|
||||||
|
): GitReleaseManagerAddAssetSettings {
|
||||||
|
const tagName = buildAgent.getInput(AddAssetFields.tagName)
|
||||||
|
const assets = buildAgent.getListInput(AddAssetFields.assets)
|
||||||
|
|
||||||
|
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||||
|
return {
|
||||||
|
...commonSettings,
|
||||||
|
tagName,
|
||||||
|
assets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
owner,
|
owner,
|
||||||
repository,
|
repository,
|
||||||
token,
|
token,
|
||||||
targetDirectory,
|
targetDirectory
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import path = require("path");
|
import path = require('path')
|
||||||
|
|
||||||
import { TYPES, IBuildAgent, IExecResult } from "../../core/models";
|
import { TYPES, IBuildAgent, IExecResult } from '../../core/models'
|
||||||
import { injectable, inject } from "inversify";
|
import { injectable, inject } from 'inversify'
|
||||||
import { DotnetTool, IDotnetTool } from "../../core/dotnet-tool";
|
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||||
import { IVersionManager } from "../../core/versionManager";
|
import { IVersionManager } from '../../core/versionManager'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
GitReleaseManagerSettings,
|
GitReleaseManagerSettings,
|
||||||
@@ -11,144 +11,223 @@ import {
|
|||||||
GitReleaseManagerDiscardSettings,
|
GitReleaseManagerDiscardSettings,
|
||||||
GitReleaseManagerCloseSettings,
|
GitReleaseManagerCloseSettings,
|
||||||
GitReleaseManagerOpenSettings,
|
GitReleaseManagerOpenSettings,
|
||||||
} from "./models";
|
GitReleaseManagerPublishSettings,
|
||||||
|
GitReleaseManagerAddAssetSettings
|
||||||
|
} from './models'
|
||||||
|
|
||||||
export interface IGitReleaseManagerTool extends IDotnetTool {
|
export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
install(versionSpec: string, includePrerelease: boolean): Promise<void>
|
||||||
create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult>;
|
create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult>
|
||||||
discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult>;
|
discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult>
|
||||||
close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult>;
|
close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult>
|
||||||
open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult>;
|
open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult>
|
||||||
|
publish(settings: GitReleaseManagerPublishSettings): Promise<IExecResult>
|
||||||
|
addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult>
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseManagerTool {
|
export class GitReleaseManagerTool extends DotnetTool
|
||||||
|
implements IGitReleaseManagerTool {
|
||||||
constructor(
|
constructor(
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||||
) {
|
) {
|
||||||
super(buildAgent, versionManager);
|
super(buildAgent, versionManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
|
public async install(
|
||||||
await this.toolInstall("GitReleaseManager.Tool", versionSpec, false, includePrerelease);
|
versionSpec: string,
|
||||||
|
includePrerelease: boolean
|
||||||
|
): Promise<void> {
|
||||||
|
await this.toolInstall(
|
||||||
|
'GitReleaseManager.Tool',
|
||||||
|
versionSpec,
|
||||||
|
false,
|
||||||
|
includePrerelease
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {
|
public create(
|
||||||
const args = this.getCreateArguments(settings);
|
settings: GitReleaseManagerCreateSettings
|
||||||
|
): Promise<IExecResult> {
|
||||||
|
const args = this.getCreateArguments(settings)
|
||||||
|
|
||||||
return this.execute("dotnet-gitreleasemanager", args);
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult> {
|
public discard(
|
||||||
const args = this.getDiscardArguments(settings);
|
settings: GitReleaseManagerDiscardSettings
|
||||||
|
): Promise<IExecResult> {
|
||||||
|
const args = this.getDiscardArguments(settings)
|
||||||
|
|
||||||
return this.execute("dotnet-gitreleasemanager", args);
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult> {
|
public close(
|
||||||
const args = this.getCloseArguments(settings);
|
settings: GitReleaseManagerCloseSettings
|
||||||
|
): Promise<IExecResult> {
|
||||||
|
const args = this.getCloseArguments(settings)
|
||||||
|
|
||||||
return this.execute("dotnet-gitreleasemanager", args);
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult> {
|
public open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult> {
|
||||||
const args = this.getCloseArguments(settings);
|
const args = this.getOpenArguments(settings)
|
||||||
|
|
||||||
return this.execute("dotnet-gitreleasemanager", args);
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommonArguments(settings: GitReleaseManagerSettings): string[] {
|
public publish(
|
||||||
const args: string[] = [];
|
settings: GitReleaseManagerPublishSettings
|
||||||
|
): Promise<IExecResult> {
|
||||||
|
const args = this.getPublishArguments(settings)
|
||||||
|
|
||||||
args.push("--owner", settings.owner);
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
args.push("--repository", settings.repository);
|
|
||||||
args.push("--token", settings.token);
|
|
||||||
|
|
||||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
|
||||||
|
|
||||||
args.push("--targetDirectory", settings.targetDirectory);
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getDiscardArguments(settings: GitReleaseManagerDiscardSettings): string[] {
|
public addAsset(
|
||||||
const args: string[] = ['discard', ...this.getCommonArguments(settings)];
|
settings: GitReleaseManagerAddAssetSettings
|
||||||
|
): Promise<IExecResult> {
|
||||||
|
const args = this.getAddAssetArguments(settings)
|
||||||
|
|
||||||
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
|
}
|
||||||
|
|
||||||
|
private getCommonArguments(settings: GitReleaseManagerSettings): string[] {
|
||||||
|
const args: string[] = []
|
||||||
|
|
||||||
|
args.push('--owner', settings.owner)
|
||||||
|
args.push('--repository', settings.repository)
|
||||||
|
args.push('--token', settings.token)
|
||||||
|
|
||||||
|
settings.targetDirectory = this.getRepoDir(settings.targetDirectory)
|
||||||
|
|
||||||
|
args.push('--targetDirectory', settings.targetDirectory)
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getCreateArguments(
|
||||||
|
settings: GitReleaseManagerCreateSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = ['create', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.milestone) {
|
if (settings.milestone) {
|
||||||
args.push("--milestone", settings.milestone);
|
args.push('--milestone', settings.milestone)
|
||||||
}
|
}
|
||||||
|
if (settings.name) {
|
||||||
return args;
|
args.push('--name', settings.name)
|
||||||
}
|
|
||||||
|
|
||||||
getCloseArguments(settings: GitReleaseManagerCloseSettings): string[] {
|
|
||||||
const args: string[] = ['close', ...this.getCommonArguments(settings)];
|
|
||||||
|
|
||||||
if (settings.milestone) {
|
|
||||||
args.push("--milestone", settings.milestone);
|
|
||||||
}
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
getOpenArguments(settings: GitReleaseManagerOpenSettings): string[] {
|
|
||||||
const args: string[] = ['open', ...this.getCommonArguments(settings)];
|
|
||||||
|
|
||||||
if (settings.milestone) {
|
|
||||||
args.push("--milestone", settings.milestone);
|
|
||||||
}
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
getCreateArguments(settings: GitReleaseManagerCreateSettings): string[] {
|
|
||||||
const args: string[] = ['create', ...this.getCommonArguments(settings)];
|
|
||||||
|
|
||||||
if (settings.milestone) {
|
|
||||||
args.push("--milestone", settings.milestone);
|
|
||||||
}
|
|
||||||
if (settings.releaseName) {
|
|
||||||
args.push("--name", settings.releaseName);
|
|
||||||
}
|
}
|
||||||
if (settings.commit) {
|
if (settings.commit) {
|
||||||
args.push("--targetcommitish", settings.commit);
|
args.push('--targetcommitish', settings.commit)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.inputFileName) {
|
if (settings.inputFileName) {
|
||||||
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
||||||
args.push("--inputFilePath", settings.inputFileName);
|
args.push('--inputFilePath', settings.inputFileName)
|
||||||
} else {
|
} else {
|
||||||
throw new Error("GitReleaseManager inputFilePath not found at " + settings.inputFileName);
|
throw new Error(
|
||||||
|
'GitReleaseManager inputFilePath not found at ' +
|
||||||
|
settings.inputFileName
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (settings.isPreRelease) {
|
if (settings.isPreRelease) {
|
||||||
args.push("--pre");
|
args.push('--pre')
|
||||||
}
|
}
|
||||||
if (settings.assets && settings.assets.length > 0) {
|
if (settings.assets && settings.assets.length > 0) {
|
||||||
settings.assets = settings.assets.map(asset => {
|
settings.assets = settings.assets.map(asset => {
|
||||||
return path.join(settings.targetDirectory, asset)
|
return path.join(settings.targetDirectory, asset)
|
||||||
})
|
})
|
||||||
|
|
||||||
args.push("--assets", settings.assets.join(","));
|
args.push('--assets', settings.assets.join(','))
|
||||||
}
|
}
|
||||||
|
|
||||||
return args;
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getDiscardArguments(
|
||||||
|
settings: GitReleaseManagerDiscardSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = ['discard', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
|
if (settings.milestone) {
|
||||||
|
args.push('--milestone', settings.milestone)
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getCloseArguments(
|
||||||
|
settings: GitReleaseManagerCloseSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = ['close', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
|
if (settings.milestone) {
|
||||||
|
args.push('--milestone', settings.milestone)
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getOpenArguments(
|
||||||
|
settings: GitReleaseManagerOpenSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = ['open', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
|
if (settings.milestone) {
|
||||||
|
args.push('--milestone', settings.milestone)
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getPublishArguments(
|
||||||
|
settings: GitReleaseManagerPublishSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = ['publish', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
|
if (settings.tagName) {
|
||||||
|
args.push('--tagName', settings.tagName)
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
private getAddAssetArguments(
|
||||||
|
settings: GitReleaseManagerAddAssetSettings
|
||||||
|
): string[] {
|
||||||
|
const args: string[] = [
|
||||||
|
'addasset',
|
||||||
|
...this.getCommonArguments(settings)
|
||||||
|
]
|
||||||
|
|
||||||
|
if (settings.tagName) {
|
||||||
|
args.push('--tagName', settings.tagName)
|
||||||
|
}
|
||||||
|
if (settings.assets && settings.assets.length > 0) {
|
||||||
|
settings.assets = settings.assets.map(asset => {
|
||||||
|
return path.join(settings.targetDirectory, asset)
|
||||||
|
})
|
||||||
|
|
||||||
|
args.push('--assets', settings.assets.join(','))
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getRepoDir(targetPath: string): string {
|
private getRepoDir(targetPath: string): string {
|
||||||
let workDir: string;
|
let workDir: string
|
||||||
const srcDir = this.buildAgent.getSourceDir();
|
const srcDir = this.buildAgent.getSourceDir()
|
||||||
if (!targetPath) {
|
if (!targetPath) {
|
||||||
workDir = srcDir;
|
workDir = srcDir
|
||||||
} else {
|
} else {
|
||||||
if (this.buildAgent.directoryExists(targetPath)) {
|
if (this.buildAgent.directoryExists(targetPath)) {
|
||||||
workDir = path.join(srcDir, targetPath);
|
workDir = path.join(srcDir, targetPath)
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Directory not found at " + targetPath);
|
throw new Error('Directory not found at ' + targetPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return workDir.replace(/\\/g, "/");
|
return workDir.replace(/\\/g, '/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
export enum ExecuteFields {
|
export enum ExecuteFields {
|
||||||
targetPath = "targetPath",
|
targetPath = 'targetPath',
|
||||||
useConfigFile = "useConfigFile",
|
useConfigFile = 'useConfigFile',
|
||||||
configFilePath = "configFilePath",
|
configFilePath = 'configFilePath',
|
||||||
updateAssemblyInfo = "updateAssemblyInfo",
|
updateAssemblyInfo = 'updateAssemblyInfo',
|
||||||
updateAssemblyInfoFilename = "updateAssemblyInfoFilename",
|
updateAssemblyInfoFilename = 'updateAssemblyInfoFilename',
|
||||||
additionalArguments = "additionalArguments",
|
additionalArguments = 'additionalArguments',
|
||||||
srcDir = "srcDir",
|
srcDir = 'srcDir'
|
||||||
};
|
}
|
||||||
|
|
||||||
export interface GitVersionSettings {
|
export interface GitVersionSettings {
|
||||||
[ExecuteFields.targetPath]: string;
|
[ExecuteFields.targetPath]: string
|
||||||
[ExecuteFields.useConfigFile]: boolean;
|
[ExecuteFields.useConfigFile]: boolean
|
||||||
[ExecuteFields.configFilePath]: string;
|
[ExecuteFields.configFilePath]: string
|
||||||
[ExecuteFields.updateAssemblyInfo]: boolean;
|
[ExecuteFields.updateAssemblyInfo]: boolean
|
||||||
[ExecuteFields.updateAssemblyInfoFilename]: string;
|
[ExecuteFields.updateAssemblyInfoFilename]: string
|
||||||
[ExecuteFields.additionalArguments]: string;
|
[ExecuteFields.additionalArguments]: string
|
||||||
[ExecuteFields.srcDir]: string;
|
[ExecuteFields.srcDir]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitVersionOutput {
|
export interface GitVersionOutput {
|
||||||
Major: number;
|
Major: number
|
||||||
Minor: number;
|
Minor: number
|
||||||
Patch: number;
|
Patch: number
|
||||||
PreReleaseTag: string;
|
PreReleaseTag: string
|
||||||
PreReleaseTagWithDash: string;
|
PreReleaseTagWithDash: string
|
||||||
PreReleaseLabel: string;
|
PreReleaseLabel: string
|
||||||
PreReleaseNumber: number;
|
PreReleaseNumber: number
|
||||||
WeightedPreReleaseNumber: number;
|
WeightedPreReleaseNumber: number
|
||||||
BuildMetaData: number;
|
BuildMetaData: number
|
||||||
BuildMetaDataPadded: string;
|
BuildMetaDataPadded: string
|
||||||
FullBuildMetaData: string;
|
FullBuildMetaData: string
|
||||||
MajorMinorPatch: string;
|
MajorMinorPatch: string
|
||||||
SemVer: string;
|
SemVer: string
|
||||||
LegacySemVer: string;
|
LegacySemVer: string
|
||||||
LegacySemVerPadded: string;
|
LegacySemVerPadded: string
|
||||||
AssemblySemVer: string;
|
AssemblySemVer: string
|
||||||
AssemblySemFileVer: string;
|
AssemblySemFileVer: string
|
||||||
FullSemVer: string;
|
FullSemVer: string
|
||||||
InformationalVersion: string;
|
InformationalVersion: string
|
||||||
BranchName: string;
|
BranchName: string
|
||||||
Sha: string;
|
Sha: string
|
||||||
ShortSha: string;
|
ShortSha: string
|
||||||
NuGetVersionV2: string;
|
NuGetVersionV2: string
|
||||||
NuGetVersion: string;
|
NuGetVersion: string
|
||||||
NuGetPreReleaseTagV2: string;
|
NuGetPreReleaseTagV2: string
|
||||||
NuGetPreReleaseTag: string;
|
NuGetPreReleaseTag: string
|
||||||
VersionSourceSha: string;
|
VersionSourceSha: string
|
||||||
CommitsSinceVersionSource: number;
|
CommitsSinceVersionSource: number
|
||||||
CommitsSinceVersionSourcePadded: string;
|
CommitsSinceVersionSourcePadded: string
|
||||||
CommitDate: string;
|
CommitDate: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,30 @@
|
|||||||
import { IBuildAgent } from "../../core/models";
|
import { IBuildAgent } from '../../core/models'
|
||||||
|
|
||||||
import { GitVersionSettings, ExecuteFields } from "./models";
|
import { GitVersionSettings, ExecuteFields } from './models'
|
||||||
|
|
||||||
export class Settings {
|
export class Settings {
|
||||||
|
public static getGitVersionSettings(
|
||||||
|
buildAgent: IBuildAgent
|
||||||
|
): GitVersionSettings {
|
||||||
|
const targetPath = buildAgent.getInput(ExecuteFields.targetPath)
|
||||||
|
|
||||||
public static getGitVersionSettings(buildAgent: IBuildAgent): GitVersionSettings {
|
const useConfigFile = buildAgent.getBooleanInput(
|
||||||
const targetPath = buildAgent.getInput(ExecuteFields.targetPath);
|
ExecuteFields.useConfigFile
|
||||||
|
)
|
||||||
|
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath)
|
||||||
|
|
||||||
const useConfigFile = buildAgent.getBooleanInput(ExecuteFields.useConfigFile);
|
const updateAssemblyInfo = buildAgent.getBooleanInput(
|
||||||
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath);
|
ExecuteFields.updateAssemblyInfo
|
||||||
|
)
|
||||||
|
const updateAssemblyInfoFilename = buildAgent.getInput(
|
||||||
|
ExecuteFields.updateAssemblyInfoFilename
|
||||||
|
)
|
||||||
|
|
||||||
const updateAssemblyInfo = buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo);
|
const additionalArguments = buildAgent.getInput(
|
||||||
const updateAssemblyInfoFilename = buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename);
|
ExecuteFields.additionalArguments
|
||||||
|
)
|
||||||
|
|
||||||
const additionalArguments = buildAgent.getInput(ExecuteFields.additionalArguments);
|
const srcDir = buildAgent.getSourceDir()?.replace(/\\/g, '/')
|
||||||
|
|
||||||
const srcDir = buildAgent.getSourceDir().replace(/\\/g, "/");
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
targetPath,
|
targetPath,
|
||||||
@@ -24,7 +33,7 @@ export class Settings {
|
|||||||
updateAssemblyInfo,
|
updateAssemblyInfo,
|
||||||
updateAssemblyInfoFilename,
|
updateAssemblyInfoFilename,
|
||||||
additionalArguments,
|
additionalArguments,
|
||||||
srcDir,
|
srcDir
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,120 +1,132 @@
|
|||||||
import path = require("path");
|
import path = require('path')
|
||||||
|
|
||||||
import { injectable, inject } from "inversify";
|
import { injectable, inject } from 'inversify'
|
||||||
import { IExecResult, IBuildAgent, TYPES } from "../../core/models";
|
import { IExecResult, IBuildAgent, TYPES } from '../../core/models'
|
||||||
import { DotnetTool, IDotnetTool } from "../../core/dotnet-tool";
|
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||||
import { GitVersionSettings, GitVersionOutput, ExecuteFields } from "./models";
|
import { GitVersionSettings, GitVersionOutput } from './models'
|
||||||
import { IVersionManager } from "../../core/versionManager";
|
import { IVersionManager } from '../../core/versionManager'
|
||||||
|
|
||||||
export interface IGitVersionTool extends IDotnetTool {
|
export interface IGitVersionTool extends IDotnetTool {
|
||||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
install(versionSpec: string, includePrerelease: boolean): Promise<void>
|
||||||
run(options: GitVersionSettings): Promise<IExecResult>;
|
run(options: GitVersionSettings): Promise<IExecResult>
|
||||||
writeGitVersionToAgent(gitversion: GitVersionOutput): void;
|
writeGitVersionToAgent(gitversion: GitVersionOutput): void
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||||
) {
|
) {
|
||||||
super(buildAgent, versionManager);
|
super(buildAgent, versionManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
|
public async install(
|
||||||
await this.toolInstall("GitVersion.Tool", versionSpec, false, includePrerelease);
|
versionSpec: string,
|
||||||
|
includePrerelease: boolean
|
||||||
|
): Promise<void> {
|
||||||
|
await this.toolInstall(
|
||||||
|
'GitVersion.Tool',
|
||||||
|
versionSpec,
|
||||||
|
false,
|
||||||
|
includePrerelease
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(options: GitVersionSettings): Promise<IExecResult> {
|
public run(options: GitVersionSettings): Promise<IExecResult> {
|
||||||
const workDir = this.getRepoDir(options.targetPath);
|
const workDir = this.getRepoDir(options.targetPath)
|
||||||
|
|
||||||
const args = this.getArguments(workDir, options);
|
const args = this.getArguments(workDir, options)
|
||||||
|
|
||||||
return this.execute("dotnet-gitversion", args);
|
return this.execute('dotnet-gitversion', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
private getRepoDir(targetPath: string): string {
|
private getRepoDir(targetPath: string): string {
|
||||||
let workDir: string;
|
let workDir: string
|
||||||
const srcDir = this.buildAgent.getSourceDir();
|
const srcDir = this.buildAgent.getSourceDir() || '.'
|
||||||
if (!targetPath) {
|
if (!targetPath) {
|
||||||
workDir = srcDir;
|
workDir = srcDir
|
||||||
} else {
|
} else {
|
||||||
if (this.buildAgent.directoryExists(targetPath)) {
|
if (this.buildAgent.directoryExists(targetPath)) {
|
||||||
workDir = path.join(srcDir, targetPath);
|
workDir = path.join(srcDir, targetPath)
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Directory not found at " + targetPath);
|
throw new Error('Directory not found at ' + targetPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return workDir.replace(/\\/g, "/");
|
return workDir.replace(/\\/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
private getArguments(workDir: string, options: GitVersionSettings): string[] {
|
private getArguments(
|
||||||
const args = [
|
workDir: string,
|
||||||
workDir,
|
options: GitVersionSettings
|
||||||
"/output",
|
): string[] {
|
||||||
"json", // need to use buildserver later
|
const args = [workDir, '/output', 'json', '/output', 'buildserver']
|
||||||
];
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
useConfigFile,
|
useConfigFile,
|
||||||
configFilePath,
|
configFilePath,
|
||||||
updateAssemblyInfo,
|
updateAssemblyInfo,
|
||||||
updateAssemblyInfoFilename,
|
updateAssemblyInfoFilename,
|
||||||
additionalArguments,
|
additionalArguments
|
||||||
} = options;
|
} = options
|
||||||
|
|
||||||
if (useConfigFile) {
|
if (useConfigFile) {
|
||||||
if (this.buildAgent.isValidInputFile("configFilePath", configFilePath)) {
|
if (
|
||||||
args.push("/config", configFilePath);
|
this.buildAgent.isValidInputFile(
|
||||||
|
'configFilePath',
|
||||||
|
configFilePath
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
args.push('/config', configFilePath)
|
||||||
} else {
|
} else {
|
||||||
throw new Error("GitVersion configuration file not found at " + configFilePath);
|
throw new Error(
|
||||||
|
'GitVersion configuration file not found at ' +
|
||||||
|
configFilePath
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (updateAssemblyInfo) {
|
if (updateAssemblyInfo) {
|
||||||
args.push("/updateassemblyinfo");
|
args.push('/updateassemblyinfo')
|
||||||
if (this.buildAgent.isValidInputFile("updateAssemblyInfoFilename", updateAssemblyInfoFilename)) {
|
if (
|
||||||
args.push(updateAssemblyInfoFilename);
|
this.buildAgent.isValidInputFile(
|
||||||
|
'updateAssemblyInfoFilename',
|
||||||
|
updateAssemblyInfoFilename
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
args.push(updateAssemblyInfoFilename)
|
||||||
} else {
|
} else {
|
||||||
throw new Error("AssemblyInfoFilename file not found at " + updateAssemblyInfoFilename);
|
throw new Error(
|
||||||
|
'AssemblyInfoFilename file not found at ' +
|
||||||
|
updateAssemblyInfoFilename
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push(additionalArguments);
|
if (additionalArguments) {
|
||||||
return args;
|
//args.push(additionalArguments)
|
||||||
|
Array.prototype.push.apply(args,additionalArguments.split(' '))
|
||||||
|
}
|
||||||
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
public writeGitVersionToAgent(gitversion: GitVersionOutput): void {
|
public writeGitVersionToAgent(gitversion: GitVersionOutput): void {
|
||||||
|
let properties = Object.keys(gitversion)
|
||||||
|
let gitversionOutput = <any>gitversion
|
||||||
|
|
||||||
this.buildAgent.setOutput("major", gitversion.Major.toString());
|
properties.forEach(property => {
|
||||||
this.buildAgent.setOutput("minor", gitversion.Minor.toString());
|
const name = this.toCamelCase(property)
|
||||||
this.buildAgent.setOutput("patch", gitversion.Patch.toString());
|
const value = gitversionOutput[property]
|
||||||
this.buildAgent.setOutput("preReleaseTag", gitversion.PreReleaseTag);
|
this.buildAgent.setOutput(name, value)
|
||||||
this.buildAgent.setOutput("preReleaseTagWithDash", gitversion.PreReleaseTagWithDash);
|
})
|
||||||
this.buildAgent.setOutput("preReleaseLabel", gitversion.PreReleaseLabel);
|
|
||||||
this.buildAgent.setOutput("preReleaseNumber", gitversion.PreReleaseNumber.toString());
|
|
||||||
this.buildAgent.setOutput("weightedPreReleaseNumber", gitversion.WeightedPreReleaseNumber.toString());
|
|
||||||
this.buildAgent.setOutput("buildMetaData", gitversion.BuildMetaData.toString());
|
|
||||||
this.buildAgent.setOutput("buildMetaDataPadded", gitversion.BuildMetaDataPadded);
|
|
||||||
this.buildAgent.setOutput("fullBuildMetaData", gitversion.FullBuildMetaData);
|
|
||||||
this.buildAgent.setOutput("majorMinorPatch", gitversion.MajorMinorPatch);
|
|
||||||
this.buildAgent.setOutput("semVer", gitversion.SemVer);
|
|
||||||
this.buildAgent.setOutput("legacySemVer", gitversion.LegacySemVer);
|
|
||||||
this.buildAgent.setOutput("legacySemVerPadded", gitversion.LegacySemVerPadded);
|
|
||||||
this.buildAgent.setOutput("assemblySemVer", gitversion.AssemblySemVer);
|
|
||||||
this.buildAgent.setOutput("assemblySemFileVer", gitversion.AssemblySemFileVer);
|
|
||||||
this.buildAgent.setOutput("fullSemVer", gitversion.FullSemVer);
|
|
||||||
this.buildAgent.setOutput("informationalVersion", gitversion.InformationalVersion);
|
|
||||||
this.buildAgent.setOutput("branchName", gitversion.BranchName);
|
|
||||||
this.buildAgent.setOutput("sha", gitversion.Sha);
|
|
||||||
this.buildAgent.setOutput("shortSha", gitversion.ShortSha);
|
|
||||||
this.buildAgent.setOutput("nuGetVersionV2", gitversion.NuGetVersionV2);
|
|
||||||
this.buildAgent.setOutput("nuGetVersion", gitversion.NuGetVersion);
|
|
||||||
this.buildAgent.setOutput("nuGetPreReleaseTagV2", gitversion.NuGetPreReleaseTagV2);
|
|
||||||
this.buildAgent.setOutput("nuGetPreReleaseTag", gitversion.NuGetPreReleaseTag);
|
|
||||||
this.buildAgent.setOutput("versionSourceSha", gitversion.VersionSourceSha);
|
|
||||||
this.buildAgent.setOutput("commitsSinceVersionSource", gitversion.CommitsSinceVersionSource.toString());
|
|
||||||
this.buildAgent.setOutput("commitsSinceVersionSourcePadded", gitversion.CommitsSinceVersionSourcePadded);
|
|
||||||
this.buildAgent.setOutput("commitDate", gitversion.CommitDate);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
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()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,4 +11,4 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true
|
"emitDecoratorMetadata": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user