Compare commits
417 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c22f7729ae | ||
|
|
637e3919e3 | ||
|
|
295b66497e | ||
|
|
49d61b9dc1 | ||
|
|
90ad7ccaef | ||
|
|
d1443aa6c4 | ||
|
|
86f7bb0d14 | ||
|
|
224bd6fbc7 | ||
|
|
03651040cf | ||
|
|
018bab2bb5 | ||
|
|
28e6c84e95 | ||
|
|
7e694802e5 | ||
|
|
d1b1a68ea7 | ||
|
|
113c0eff35 | ||
|
|
6cb16e308c | ||
|
|
ed09efff19 | ||
|
|
2389aedf77 | ||
|
|
f9d87cf153 | ||
|
|
e93d76d060 | ||
|
|
1352a3019b | ||
|
|
865b52d60d | ||
|
|
1754c1b840 | ||
|
|
219fecb41b | ||
|
|
629337911b | ||
|
|
2f9911e27e | ||
|
|
2c1dea98d9 | ||
|
|
e6f9766442 | ||
|
|
4f534ce106 | ||
|
|
2f675e49c0 | ||
|
|
af2c26cb69 | ||
|
|
b1cb52687b | ||
|
|
599f8a68c2 | ||
|
|
70b7598141 | ||
|
|
d4a734be23 | ||
|
|
dbd7005e91 | ||
|
|
a748dc5f6b | ||
|
|
01aae6cb15 | ||
|
|
358c2c3428 | ||
|
|
c1d1b68d3a | ||
|
|
cda7b82117 | ||
|
|
529849d235 | ||
|
|
d91136f75c | ||
|
|
2dbf79abb4 | ||
|
|
21c221544f | ||
|
|
4e862f279a | ||
|
|
7e3444f4eb | ||
|
|
253a08ab20 | ||
|
|
80dd8c6614 | ||
|
|
2a7eef751a | ||
|
|
091a0a0508 | ||
|
|
ddc8a6fed1 | ||
|
|
359cd77ee8 | ||
|
|
c3e86a5991 | ||
|
|
777814078d | ||
|
|
f5e559ec68 | ||
|
|
471db7407e | ||
|
|
07ac8fd3d7 | ||
|
|
f9052ac398 | ||
|
|
ebc5a9b8b8 | ||
|
|
9e8a9c74a7 | ||
|
|
bdf6f4f4f4 | ||
|
|
239f9cde5f | ||
|
|
b70ac9eb92 | ||
|
|
b1c0161229 | ||
|
|
abda0b29c7 | ||
|
|
27da9f0a8f | ||
|
|
93745196a8 | ||
|
|
ab060afca2 | ||
|
|
8851ced77d | ||
|
|
ae99598529 | ||
|
|
e58c159558 | ||
|
|
fa4cbb910b | ||
|
|
5be0b93ebc | ||
|
|
e89562a503 | ||
|
|
d44a9c0eda | ||
|
|
43deb9b5f4 | ||
|
|
171afd24f4 | ||
|
|
da4adc22ba | ||
|
|
b1a2ae3dfc | ||
|
|
aabced21c8 | ||
|
|
5eb434f02d | ||
|
|
c4fcf4fa8d | ||
|
|
ceb7c13510 | ||
|
|
afcea8f5f6 | ||
|
|
8bd3b35494 | ||
|
|
8ac4e01c21 | ||
|
|
41cb436657 | ||
|
|
3cffae28da | ||
|
|
bebba89ffa | ||
|
|
b186c312bc | ||
|
|
e5b8570351 | ||
|
|
2ad2585e5e | ||
|
|
34759fcf86 | ||
|
|
78620ea5b9 | ||
|
|
a3a33f41ee | ||
|
|
bc0ba743d4 | ||
|
|
7ff479875b | ||
|
|
732774f45b | ||
|
|
0f23ca3763 | ||
|
|
fd0e9127e9 | ||
|
|
ab1f693bb2 | ||
|
|
261b95233f | ||
|
|
71beb061d8 | ||
|
|
0c289d0afe | ||
|
|
8e77e7bf98 | ||
|
|
e06fd22089 | ||
|
|
02ca90079d | ||
|
|
e81e608d3a | ||
|
|
9ce74fc069 | ||
|
|
a4df062200 | ||
|
|
7a2897ff3b | ||
|
|
9e61b6c6fa | ||
|
|
78eea2404c | ||
|
|
6d6de4e74a | ||
|
|
28489a6e8b | ||
|
|
1cf15e373e | ||
|
|
f391f58a80 | ||
|
|
c8427ece0f | ||
|
|
9200b387f9 | ||
|
|
c64a6a8172 | ||
|
|
ec09be5fcc | ||
|
|
f032284e48 | ||
|
|
ae36a4e6c2 | ||
|
|
2d231bb1fc | ||
|
|
198b8352dc | ||
|
|
9dd2999c4e | ||
|
|
5559703cfa | ||
|
|
1b4111c853 | ||
|
|
2a5e73e924 | ||
|
|
db1da7956f | ||
|
|
dc7c0bc15b | ||
|
|
213fa7b0ea | ||
|
|
6899b3b6a6 | ||
|
|
cd69c72d3d | ||
|
|
e14f1325aa | ||
|
|
bb4dbc7937 | ||
|
|
c48cb85acb | ||
|
|
e07328c594 | ||
|
|
46620b80b6 | ||
|
|
83a1614f2c | ||
|
|
ebb10d63bf | ||
|
|
7a786a5b0e | ||
|
|
c1601863b1 | ||
|
|
d98266c7b4 | ||
|
|
6118964f10 | ||
|
|
ed08d7050c | ||
|
|
32abb6db06 | ||
|
|
10253d3290 | ||
|
|
06d7b87d52 | ||
|
|
361f1d2cf1 | ||
|
|
9bda1cf33b | ||
|
|
fa6f81a896 | ||
|
|
6d2a771e40 | ||
|
|
5bf97605b6 | ||
|
|
cb5e9d0063 | ||
|
|
9371cb53e3 | ||
|
|
07a7cb455b | ||
|
|
9231b0cf62 | ||
|
|
84922eda31 | ||
|
|
1147644971 | ||
|
|
d65e9ba800 | ||
|
|
21f7c14d69 | ||
|
|
8ea0f5719e | ||
|
|
4c76e58b8c | ||
|
|
1b362ded00 | ||
|
|
c74db776af | ||
|
|
1fdc46c379 | ||
|
|
e3f7ace591 | ||
|
|
7a1c540e1c | ||
|
|
3bbb217a79 | ||
|
|
9d1c6e7f6a | ||
|
|
d735be2eeb | ||
|
|
bd2621313f | ||
|
|
6581689542 | ||
|
|
fced29db16 | ||
|
|
2f2c3463ed | ||
|
|
1bd3ac6b26 | ||
|
|
c63c7701e8 | ||
|
|
1052ead994 | ||
|
|
823370cbf3 | ||
|
|
fbf1bceba1 | ||
|
|
ab9de85d65 | ||
|
|
7e5b13b5f2 | ||
|
|
23066aa63f | ||
|
|
159ed188f6 | ||
|
|
b6c7388d8b | ||
|
|
74c0b8a1a4 | ||
|
|
f562a29213 | ||
|
|
31e312b4a0 | ||
|
|
fb2979dcc7 | ||
|
|
698b8f033e | ||
|
|
702d218a1b | ||
|
|
2af96fb4dc | ||
|
|
58f49ded64 | ||
|
|
ffcc5b0f5f | ||
|
|
4290176ff6 | ||
|
|
36f37a22e5 | ||
|
|
27c2112de8 | ||
|
|
9e1924a5de | ||
|
|
af47b96e59 | ||
|
|
4fa084c099 | ||
|
|
7af641962b | ||
|
|
52d686d4ac | ||
|
|
cd339aee5a | ||
|
|
d5164d35f4 | ||
|
|
64f9607203 | ||
|
|
857ddd1e1d | ||
|
|
3674255dde | ||
|
|
0ae24f6911 | ||
|
|
7acba1eb44 | ||
|
|
064e6da4da | ||
|
|
923117f72a | ||
|
|
c10331ebe4 | ||
|
|
064b5c66c2 | ||
|
|
0778c62d58 | ||
|
|
96c9a3249f | ||
|
|
5880c950d3 | ||
|
|
7a2b40535c | ||
|
|
3251a1504c | ||
|
|
29a938cabb | ||
|
|
cc6ec69943 | ||
|
|
2c5af54fdb | ||
|
|
0a3afcc8d0 | ||
|
|
0f683380cf | ||
|
|
b82f8cc312 | ||
|
|
2d818eba96 | ||
|
|
2a4bc26815 | ||
|
|
4796828fd7 | ||
|
|
fbffce6ad4 | ||
|
|
4685fb9970 | ||
|
|
7e9d8c3dea | ||
|
|
03fdd4079c | ||
|
|
cd94665078 | ||
|
|
a7517c431b | ||
|
|
5eeb590fb3 | ||
|
|
bda8be9b78 | ||
|
|
68ebd9ac2b | ||
|
|
7f856e2836 | ||
|
|
c59159991e | ||
|
|
6cfd874bb0 | ||
|
|
7d811ad979 | ||
|
|
b09636d2aa | ||
|
|
2483451818 | ||
|
|
3a3228dbd4 | ||
|
|
59df2263c9 | ||
|
|
90ed98fe90 | ||
|
|
e2a0a98d0d | ||
|
|
beff769a0a | ||
|
|
561a033cde | ||
|
|
f7e58105a3 | ||
|
|
8fd86bc975 | ||
|
|
9f20fd680f | ||
|
|
d90c71ad9e | ||
|
|
26e07b2073 | ||
|
|
45cb672da2 | ||
|
|
850ed98ab5 | ||
|
|
4791057296 | ||
|
|
ab0db79939 | ||
|
|
2066a451dc | ||
|
|
226c68eed2 | ||
|
|
f5e2af4aef | ||
|
|
e9a249bf95 | ||
|
|
f189de334f | ||
|
|
0bd660e284 | ||
|
|
4cff8b7a7f | ||
|
|
79e35dcb78 | ||
|
|
fbf0b14031 | ||
|
|
23e93871ca | ||
|
|
4e165ee395 | ||
|
|
b70b886620 | ||
|
|
f5ecda8793 | ||
|
|
d97d38d4db | ||
|
|
187323cd9f | ||
|
|
18fb7852c1 | ||
|
|
34118b9a5b | ||
|
|
9635ee3996 | ||
|
|
6c777befe5 | ||
|
|
d0f294eac8 | ||
|
|
0714f38d99 | ||
|
|
7a31ebd2e5 | ||
|
|
9884a236d3 | ||
|
|
73bf015789 | ||
|
|
53f64107be | ||
|
|
4e6c9eed21 | ||
|
|
6eea127057 | ||
|
|
057afaba13 | ||
|
|
fcc6fce705 | ||
|
|
866e02625e | ||
|
|
451642692d | ||
|
|
dedbf24cf5 | ||
|
|
ca126fb0ac | ||
|
|
e22f15fd11 | ||
|
|
5b82487fce | ||
|
|
d79df48eb2 | ||
|
|
707ee623d2 | ||
|
|
bc76111a30 | ||
|
|
6cca1e1c1e | ||
|
|
d623e0cc82 | ||
|
|
ebfb2edab7 | ||
|
|
867ed20f18 | ||
|
|
18209218be | ||
|
|
72b0f78544 | ||
|
|
66b6a35f56 | ||
|
|
21c841e996 | ||
|
|
d6129a51ec | ||
|
|
7c90d6b78f | ||
|
|
e4c7ed7ce3 | ||
|
|
dd26c068e0 | ||
|
|
fb3d393c4c | ||
|
|
c72a9b20bc | ||
|
|
9378479aee | ||
|
|
dfb84fe5de | ||
|
|
c63c61328d | ||
|
|
a2590843fe | ||
|
|
791bc30e72 | ||
|
|
b708e5ac10 | ||
|
|
df95cc793a | ||
|
|
cce79cc899 | ||
|
|
a98e7b7cb2 | ||
|
|
c51f0e285f | ||
|
|
78bb276e25 | ||
|
|
c3f05bcf0c | ||
|
|
6816602c40 | ||
|
|
093b543ec4 | ||
|
|
731429e5be | ||
|
|
184b94231d | ||
|
|
df842983a6 | ||
|
|
cf290bd735 | ||
|
|
be36024ea6 | ||
|
|
5d9eaa0581 | ||
|
|
8d23782950 | ||
|
|
7e521afd6f | ||
|
|
5366db4c30 | ||
|
|
214b876502 | ||
|
|
747d4742a3 | ||
|
|
eb5581014f | ||
|
|
aaca7df340 | ||
|
|
8a1aadd1f4 | ||
|
|
31cd132bf5 | ||
|
|
9e5d9ca06b | ||
|
|
988532840b | ||
|
|
727ca9d8e4 | ||
|
|
f23026aa7c | ||
|
|
9989ffce4d | ||
|
|
b9492677f7 | ||
|
|
4409444c4f | ||
|
|
e1bf948e90 | ||
|
|
bb89f91f54 | ||
|
|
fab8b7e835 | ||
|
|
8e3839c0a9 | ||
|
|
589c78d7bf | ||
|
|
136b96a603 | ||
|
|
66506f6b1a | ||
|
|
27f28461e4 | ||
|
|
2a60bc27e8 | ||
|
|
c25a163200 | ||
|
|
922cea0598 | ||
|
|
48fd5212af | ||
|
|
5af08e8335 | ||
|
|
fa4af7e71b | ||
|
|
a65efa338e | ||
|
|
d4c1bc5c32 | ||
|
|
f7000309bd | ||
|
|
12c80da98a | ||
|
|
a15def8cc2 | ||
|
|
4abfe18ccc | ||
|
|
fe505dc0b1 | ||
|
|
ab2d9be6de | ||
|
|
b941d96073 | ||
|
|
92d7ce7c81 | ||
|
|
cf87ceb245 | ||
|
|
5361cb4b6a | ||
|
|
2a18e62aca | ||
|
|
c62067b355 | ||
|
|
2028806a94 | ||
|
|
b4c25e0354 | ||
|
|
348f7c82e0 | ||
|
|
e59e3aa01e | ||
|
|
2ed20d7e5f | ||
|
|
77df971454 | ||
|
|
0de369f003 | ||
|
|
a0df4807b6 | ||
|
|
72b9932898 | ||
|
|
19bfbadf3b | ||
|
|
77d56accec | ||
|
|
c71ad3b613 | ||
|
|
a0c45005a6 | ||
|
|
d427d0fd9b | ||
|
|
7057f96b64 | ||
|
|
c9cae25ad3 | ||
|
|
6a6d522638 | ||
|
|
a70449f3e0 | ||
|
|
858107005c | ||
|
|
a67e527f19 | ||
|
|
d3c430aa3b | ||
|
|
bb0274c907 | ||
|
|
14b969d2fe | ||
|
|
b9ec3ece2a | ||
|
|
571aefb10b | ||
|
|
0366fbccc7 | ||
|
|
f0f5fe24cd | ||
|
|
060260acbd | ||
|
|
7842e08b66 | ||
|
|
84f93a930a | ||
|
|
a4c0dafea9 | ||
|
|
241a50fbd6 | ||
|
|
c0466a77ff | ||
|
|
1fe80c9136 | ||
|
|
e7399d48c5 | ||
|
|
56a078f8d2 | ||
|
|
66a4299298 | ||
|
|
a41619580c | ||
|
|
cdf70088b7 | ||
|
|
b30860fe81 | ||
|
|
1a99526cb9 | ||
|
|
efc58b37fa | ||
|
|
f5dd295d84 |
47
.azure/ci.yml
Normal file
47
.azure/ci.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
trigger:
|
||||
- main
|
||||
pr:
|
||||
- main
|
||||
|
||||
variables:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
|
||||
INPUT_VERSIONSPEC: '5.x'
|
||||
|
||||
jobs:
|
||||
- job: build
|
||||
displayName: ''
|
||||
strategy:
|
||||
matrix:
|
||||
'ubuntu-latest':
|
||||
imageName: 'ubuntu-latest'
|
||||
'macos-latest':
|
||||
imageName: 'macos-latest'
|
||||
'windows-latest':
|
||||
imageName: 'windows-latest'
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: '0'
|
||||
- pwsh: |
|
||||
npm install
|
||||
npm run format-check
|
||||
npm run build:github
|
||||
npm run build:azure
|
||||
displayName: 'Build code'
|
||||
- pwsh: $env:INPUT_VERSIONSPEC = "$(INPUT_VERSIONSPEC)"; node ./gitversion/setup/bundle.js
|
||||
displayName: gitversion/setup
|
||||
workingDirectory: dist/azure
|
||||
- pwsh: node ./gitversion/execute/bundle.js
|
||||
name: version
|
||||
displayName: gitversion/execute
|
||||
workingDirectory: dist/azure
|
||||
- pwsh: |
|
||||
echo "FullSemVer (fullSemVer) : $(fullSemVer)"
|
||||
echo "FullSemVer (GitVersion_FullSemVer) : $(GitVersion_FullSemVer)"
|
||||
echo "FullSemVer (version.fullSemVer) : $(version.fullSemVer)"
|
||||
echo "FullSemVer (version.GitVersion_FullSemVer) : $(version.GitVersion_FullSemVer)"
|
||||
displayName: Use variables and output
|
||||
@@ -8,6 +8,7 @@ end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = off
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
|
||||
37
.github/workflows/ci.yml
vendored
37
.github/workflows/ci.yml
vendored
@@ -8,6 +8,10 @@ on:
|
||||
branches:
|
||||
- main
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -17,22 +21,47 @@ jobs:
|
||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
if: github.event_name == 'push'
|
||||
with:
|
||||
token: ${{ secrets.PUSH_GITHUB_TOKEN }}
|
||||
- uses: actions/checkout@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
- name: Fetch all history for all tags and branches
|
||||
run: |
|
||||
git fetch --prune --unshallow
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- run: |
|
||||
npm install
|
||||
npm run format-check
|
||||
npm run build:github
|
||||
npm run build:azure
|
||||
name: Build code
|
||||
- name: Install GitVersion
|
||||
- name: gitversion/setup
|
||||
uses: ./gitversion/setup
|
||||
with:
|
||||
versionSpec: '5.x'
|
||||
- name: Use GitVersion
|
||||
- name: gitversion/execute
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: ./gitversion/execute
|
||||
- run: |
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
echo "FullSemVer (env.fullSemVer) : ${{ env.fullSemVer }}"
|
||||
echo "FullSemVer (env.GitVersion_FullSemVer) : ${{ env.GitVersion_FullSemVer }}"
|
||||
echo "FullSemVer (steps.gitversion.outputs.fullSemVer) : ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
echo "FullSemVer (steps.gitversion.outputs.GitVersion_FullSemVer) : ${{ steps.gitversion.outputs.GitVersion_FullSemVer }}"
|
||||
name: Use variables and output
|
||||
- name: Check for changes
|
||||
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
|
||||
id: status
|
||||
run: |
|
||||
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
|
||||
- name: Rebuild dist and push
|
||||
run: |
|
||||
git add --verbose .
|
||||
git config user.name 'Artur Stolear'
|
||||
git config user.email 'artur.stolear@gmail.com'
|
||||
git commit -m 'dist update' --allow-empty
|
||||
git push --force
|
||||
if: steps.status.outputs.has_changes == '1'
|
||||
|
||||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -3,6 +3,10 @@ on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -11,7 +15,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Fetch all history for all tags and branches
|
||||
run: |
|
||||
git fetch --prune --unshallow
|
||||
@@ -37,11 +41,10 @@ jobs:
|
||||
$minor = "${{steps.gitversion.outputs.minor}}"
|
||||
$patch = "${{steps.gitversion.outputs.patch}}"
|
||||
|
||||
. .\dist\azure\update-version.ps1
|
||||
. .\dist\azure\update-version.ps1 # Import the functions
|
||||
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
|
||||
|
||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||
|
||||
shell: pwsh
|
||||
name: Publish Azure extension
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,3 +4,6 @@ node_modules/
|
||||
*.js
|
||||
!dist/**/*.js
|
||||
*.vsix
|
||||
|
||||
.idea/
|
||||
/dist/mock/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"printWidth": 160,
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
|
||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"yaml.schemas": {
|
||||
"file:///c%3A/Users/Artur.Stolear/.vscode/extensions/docsmsft.docs-yaml-0.2.9/out/yaml-support/toc.schema.json": "/toc\\.yml/i",
|
||||
"https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json": "file:///d%3A/Projects/OSS/GitTools/actions/.azure/ci.yml"
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,5 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: dist/github/setup/index.js
|
||||
|
||||
22603
dist/azure/gitreleasemanager/addasset/bundle.js
vendored
22603
dist/azure/gitreleasemanager/addasset/bundle.js
vendored
File diff suppressed because one or more lines are too long
100
dist/azure/gitreleasemanager/addasset/task.json
vendored
100
dist/azure/gitreleasemanager/addasset/task.json
vendored
@@ -12,56 +12,68 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"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"
|
||||
}]
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22603
dist/azure/gitreleasemanager/close/bundle.js
vendored
22603
dist/azure/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
85
dist/azure/gitreleasemanager/close/task.json
vendored
85
dist/azure/gitreleasemanager/close/task.json
vendored
@@ -12,49 +12,60 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager/close",
|
||||
"inputs": [{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
}, {
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
}, {
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
}, {
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
}, {
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}]
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
},
|
||||
{
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
},
|
||||
{
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
},
|
||||
{
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22603
dist/azure/gitreleasemanager/create/bundle.js
vendored
22603
dist/azure/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
160
dist/azure/gitreleasemanager/create/task.json
vendored
160
dist/azure/gitreleasemanager/create/task.json
vendored
@@ -12,84 +12,100 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager/create",
|
||||
"inputs": [{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
}, {
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
}, {
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
}, {
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
}, {
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"label": "The name of the release",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The name of the release"
|
||||
}, {
|
||||
"name": "inputFilePath",
|
||||
"type": "string",
|
||||
"label": "The path to the file to be used as the content of the release notes",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
||||
}, {
|
||||
"name": "isPreRelease",
|
||||
"type": "boolean",
|
||||
"label": "Creates the release as a pre-release",
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Creates the release as a pre-release"
|
||||
}, {
|
||||
"name": "targetcommitish",
|
||||
"type": "string",
|
||||
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
|
||||
}, {
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}, {
|
||||
"name": "assets",
|
||||
"type": "multiLine",
|
||||
"label": "Path(s) to the file(s) to include in the release",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
|
||||
}]
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
},
|
||||
{
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
},
|
||||
{
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"label": "The name of the release",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The name of the release"
|
||||
},
|
||||
{
|
||||
"name": "inputFilePath",
|
||||
"type": "string",
|
||||
"label": "The path to the file to be used as the content of the release notes",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
||||
},
|
||||
{
|
||||
"name": "isPreRelease",
|
||||
"type": "boolean",
|
||||
"label": "Creates the release as a pre-release",
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Creates the release as a pre-release"
|
||||
},
|
||||
{
|
||||
"name": "targetcommitish",
|
||||
"type": "string",
|
||||
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
|
||||
},
|
||||
{
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
},
|
||||
{
|
||||
"name": "assets",
|
||||
"type": "multiLine",
|
||||
"label": "Path(s) to the file(s) to include in the release",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22603
dist/azure/gitreleasemanager/discard/bundle.js
vendored
22603
dist/azure/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
85
dist/azure/gitreleasemanager/discard/task.json
vendored
85
dist/azure/gitreleasemanager/discard/task.json
vendored
@@ -12,49 +12,60 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager/discard",
|
||||
"inputs": [{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
}, {
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
}, {
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
}, {
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
}, {
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}]
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
},
|
||||
{
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
},
|
||||
{
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
},
|
||||
{
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22593
dist/azure/gitreleasemanager/open/bundle.js
vendored
22593
dist/azure/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
85
dist/azure/gitreleasemanager/open/task.json
vendored
85
dist/azure/gitreleasemanager/open/task.json
vendored
@@ -12,49 +12,60 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager/open",
|
||||
"inputs": [{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
}, {
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
}, {
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
}, {
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
}, {
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}]
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "string",
|
||||
"label": "The owner of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The owner of the repository"
|
||||
},
|
||||
{
|
||||
"name": "repository",
|
||||
"type": "string",
|
||||
"label": "The name of the repository",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The name of the repository"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"type": "string",
|
||||
"label": "The access token to access GitHub with",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The access token to access GitHub with"
|
||||
},
|
||||
{
|
||||
"name": "milestone",
|
||||
"type": "string",
|
||||
"label": "The milestone to use",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "The milestone to use"
|
||||
},
|
||||
{
|
||||
"name": "targetDirectory",
|
||||
"type": "string",
|
||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||
"defaultValue": "",
|
||||
"required": false,
|
||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22593
dist/azure/gitreleasemanager/publish/bundle.js
vendored
22593
dist/azure/gitreleasemanager/publish/bundle.js
vendored
File diff suppressed because one or more lines are too long
85
dist/azure/gitreleasemanager/publish/task.json
vendored
85
dist/azure/gitreleasemanager/publish/task.json
vendored
@@ -12,49 +12,60 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"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"
|
||||
}]
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22593
dist/azure/gitreleasemanager/setup/bundle.js
vendored
22593
dist/azure/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
18
dist/azure/gitreleasemanager/setup/task.json
vendored
18
dist/azure/gitreleasemanager/setup/task.json
vendored
@@ -12,16 +12,22 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager/setup",
|
||||
"inputs": [{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "versionSpec",
|
||||
"type": "string",
|
||||
"label": "The version spec",
|
||||
@@ -44,6 +50,14 @@
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Treat package source failures as warnings"
|
||||
},
|
||||
{
|
||||
"name": "preferLatestVersion",
|
||||
"type": "boolean",
|
||||
"label": "Prefer latest version",
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Prefer to download the latest version matching the versionSpec, even if there is a local cached version."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22417
dist/azure/gitversion/execute/bundle.js
vendored
22417
dist/azure/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
15
dist/azure/gitversion/execute/task.json
vendored
15
dist/azure/gitversion/execute/task.json
vendored
@@ -2,7 +2,7 @@
|
||||
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
|
||||
"name": "gitversion/execute",
|
||||
"friendlyName": "Execute GitVersion Task",
|
||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||
"description": "Easy Semantic Versioning (https://semver.org) for projects using Git",
|
||||
"author": "GitTools Contributors",
|
||||
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||
"category": "Build",
|
||||
@@ -12,16 +12,22 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitversion/execute",
|
||||
"groups": [{
|
||||
"groups": [
|
||||
{
|
||||
"name": "gitversionDetails",
|
||||
"displayName": "GitVersion details",
|
||||
"isExpanded": true
|
||||
@@ -32,7 +38,8 @@
|
||||
"isExpanded": false
|
||||
}
|
||||
],
|
||||
"inputs": [{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "targetPath",
|
||||
"type": "string",
|
||||
"label": "Working directory path",
|
||||
|
||||
22417
dist/azure/gitversion/setup/bundle.js
vendored
22417
dist/azure/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
20
dist/azure/gitversion/setup/task.json
vendored
20
dist/azure/gitversion/setup/task.json
vendored
@@ -2,7 +2,7 @@
|
||||
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
|
||||
"name": "gitversion/setup",
|
||||
"friendlyName": "Setup GitVersion Task",
|
||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||
"description": "Easy Semantic Versioning (https://semver.org) for projects using Git",
|
||||
"author": "GitTools Contributors",
|
||||
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||
"category": "Build",
|
||||
@@ -12,16 +12,22 @@
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"minimumAgentVersion": "2.220.0",
|
||||
"execution": {
|
||||
"Node10": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
},
|
||||
"Node20": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitversion/setup",
|
||||
"inputs": [{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "versionSpec",
|
||||
"type": "string",
|
||||
"label": "The version spec",
|
||||
@@ -44,6 +50,14 @@
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Treat package source failures as warnings"
|
||||
},
|
||||
{
|
||||
"name": "preferLatestVersion",
|
||||
"type": "boolean",
|
||||
"label": "Prefer latest version",
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Prefer to download the latest version matching the versionSpec, even if there is a local cached version."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
10
dist/azure/update-version.ps1
vendored
10
dist/azure/update-version.ps1
vendored
@@ -17,9 +17,9 @@ function update-task() {
|
||||
$patch
|
||||
)
|
||||
$file = Resolve-Path $file
|
||||
$jqMajor = '.version.Major=\"' + $major +'\"';
|
||||
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
||||
$jqPatch = '.version.Patch=\"' + $patch +'\"';
|
||||
$jqMajor = '.version.Major="' + $major +'"';
|
||||
$jqMinor = '.version.Minor="' + $minor +'"';
|
||||
$jqPatch = '.version.Patch="' + $patch +'"';
|
||||
Write-Host "Update task from $file to version $major.$minor.$patch"
|
||||
|
||||
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
|
||||
@@ -36,8 +36,8 @@ function update-manifest() {
|
||||
$version
|
||||
)
|
||||
$file = Resolve-Path $file
|
||||
$jqVersion = '.version=\"' + $version +'\"';
|
||||
$jqVersion = '.version="' + $version +'"';
|
||||
Write-Host "Update manifest version to $version"
|
||||
|
||||
Get-Content $file | jq $jqVersion | Set-Content $file
|
||||
}
|
||||
}
|
||||
|
||||
14698
dist/github/gitreleasemanager/addasset/bundle.js
vendored
14698
dist/github/gitreleasemanager/addasset/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/close/bundle.js
vendored
14698
dist/github/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/create/bundle.js
vendored
14698
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/discard/bundle.js
vendored
14698
dist/github/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/open/bundle.js
vendored
14698
dist/github/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/publish/bundle.js
vendored
14698
dist/github/gitreleasemanager/publish/bundle.js
vendored
File diff suppressed because one or more lines are too long
14698
dist/github/gitreleasemanager/setup/bundle.js
vendored
14698
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
14512
dist/github/gitversion/execute/bundle.js
vendored
14512
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
14512
dist/github/gitversion/setup/bundle.js
vendored
14512
dist/github/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/addasset/bundle.js
vendored
10692
dist/mock/gitreleasemanager/addasset/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/close/bundle.js
vendored
10692
dist/mock/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/create/bundle.js
vendored
10692
dist/mock/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/discard/bundle.js
vendored
10692
dist/mock/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/open/bundle.js
vendored
10692
dist/mock/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/publish/bundle.js
vendored
10692
dist/mock/gitreleasemanager/publish/bundle.js
vendored
File diff suppressed because one or more lines are too long
10692
dist/mock/gitreleasemanager/setup/bundle.js
vendored
10692
dist/mock/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
10561
dist/mock/gitversion/execute/bundle.js
vendored
10561
dist/mock/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
10561
dist/mock/gitversion/setup/bundle.js
vendored
10561
dist/mock/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitreleasemanager/close@0
|
||||
- task: gitreleasemanager/close@0
|
||||
inputs:
|
||||
token: '$(GITHUB_TOKEN)'
|
||||
owner: 'someOwner'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitreleasemanager/open@0
|
||||
- task: gitreleasemanager/open@0
|
||||
inputs:
|
||||
token: '$(GITHUB_TOKEN)'
|
||||
owner: 'someOwner'
|
||||
|
||||
@@ -46,42 +46,44 @@ additionalArguments:
|
||||
|
||||
The Execute GitVersion task creates the following job-scoped variables and multi-job output variables:
|
||||
|
||||
- GitVersion.Major
|
||||
- GitVersion.Minor
|
||||
- GitVersion.Patch
|
||||
- GitVersion.PreReleaseTag
|
||||
- GitVersion.PreReleaseTagWithDash
|
||||
- GitVersion.PreReleaseLabel
|
||||
- GitVersion.PreReleaseNumber
|
||||
- GitVersion.WeightedPreReleaseNumber
|
||||
- GitVersion.BuildMetaData
|
||||
- GitVersion.BuildMetaDataPadded
|
||||
- GitVersion.FullBuildMetaData
|
||||
- GitVersion.MajorMinorPatch
|
||||
- GitVersion.SemVer
|
||||
- GitVersion.LegacySemVer
|
||||
- GitVersion.LegacySemVerPadded
|
||||
- GitVersion.AssemblySemVer
|
||||
- GitVersion.AssemblySemFileVer
|
||||
- GitVersion.FullSemVer
|
||||
- GitVersion.InformationalVersion
|
||||
- GitVersion.BranchName
|
||||
- GitVersion.EscapedBranchName (since 5.2.0)
|
||||
- GitVersion.Sha
|
||||
- GitVersion.ShortSha
|
||||
- GitVersion.NuGetVersionV2
|
||||
- GitVersion.NuGetVersion
|
||||
- GitVersion.NuGetPreReleaseTagV2
|
||||
- GitVersion.NuGetPreReleaseTag
|
||||
- GitVersion.VersionSourceSha
|
||||
- GitVersion.CommitsSinceVersionSource
|
||||
- GitVersion.CommitsSinceVersionSourcePadded (since 5.2.0)
|
||||
- GitVersion.UncommittedChanges (since 5.5.0)
|
||||
- GitVersion.CommitDate
|
||||
- major
|
||||
- minor
|
||||
- patch
|
||||
- preReleaseTag
|
||||
- preReleaseTagWithDash
|
||||
- preReleaseLabel
|
||||
- preReleaseNumber
|
||||
- weightedPreReleaseNumber
|
||||
- buildMetaData
|
||||
- buildMetaDataPadded (removed in 6.0.0)
|
||||
- fullBuildMetaData
|
||||
- majorMinorPatch
|
||||
- semVer
|
||||
- legacySemVer (removed in 6.0.0)
|
||||
- legacySemVerPadded (removed in 6.0.0)
|
||||
- assemblySemVer
|
||||
- assemblySemFileVer
|
||||
- fullSemVer
|
||||
- informationalVersion
|
||||
- branchName
|
||||
- escapedBranchName (since 5.2.0)
|
||||
- sha
|
||||
- shortSha
|
||||
- nuGetVersionV2 (removed in 6.0.0)
|
||||
- nuGetVersion (removed in 6.0.0)
|
||||
- nuGetPreReleaseTagV2 (removed in 6.0.0)
|
||||
- nuGetPreReleaseTag (removed in 6.0.0)
|
||||
- versionSourceSha
|
||||
- commitsSinceVersionSource
|
||||
- commitsSinceVersionSourcePadded (since 5.2.0, removed in 6.0.0)
|
||||
- uncommittedChanges (since 5.5.0)
|
||||
- commitDate
|
||||
|
||||
The job-scoped variables can be accessed using the macro syntax `$(GitVersion.<variableName>)` in subsequent steps in the same job. Azure Pipelines also creates environment variables of the form `GITVERSION_<VARIABLENAME>`. See examples [5](#example-5) and [6](#example-6).
|
||||
The outputs can be accessed using the syntax `$(<id>.<outputName>)` or `$(<id>.GitVersion_<OutputName>)`, where `<id>` is the ID assigned to the step that calls the action, by subsequent steps later in the same job. See example [5](#example-5).
|
||||
|
||||
The multi-job output variables can be accessed across jobs and stages, in both conditions and variables. See examples [7](#example-7) to [10](#example-10).
|
||||
The action also creates environment variables of the form `$(<outputName>)` or `$(GitVersion_<OutputName>)` for use by other steps in the same job. See example [6](#example-6).
|
||||
|
||||
The multi-job output variables can be accessed across jobs and stages, in both conditions and variables. See examples [7](#example-7) to [10](#example-10).
|
||||
|
||||
**GitVersion also automatically updates the pre-defined Build variable `Build.BuildNumber`.**
|
||||
|
||||
@@ -164,41 +166,78 @@ steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
name: version # id to later be referenced
|
||||
displayName: Determine Version
|
||||
|
||||
- script: |
|
||||
echo Major: $(GitVersion.Major)
|
||||
echo Minor: $(GitVersion.Minor)
|
||||
echo Patch: $(GitVersion.Patch)
|
||||
echo PreReleaseTag: $(GitVersion.PreReleaseTag)
|
||||
echo PreReleaseTagWithDash: $(GitVersion.PreReleaseTagWithDash)
|
||||
echo PreReleaseLabel: $(GitVersion.PreReleaseLabel)
|
||||
echo PreReleaseNumber: $(GitVersion.PreReleaseNumber)
|
||||
echo WeightedPreReleaseNumber: $(GitVersion.WeightedPreReleaseNumber)
|
||||
echo BuildMetaData: $(GitVersion.BuildMetaData)
|
||||
echo BuildMetaDataPadded: $(GitVersion.BuildMetaDataPadded)
|
||||
echo FullBuildMetaData: $(GitVersion.FullBuildMetaData)
|
||||
echo MajorMinorPatch: $(GitVersion.MajorMinorPatch)
|
||||
echo SemVer: $(GitVersion.SemVer)
|
||||
echo LegacySemVer: $(GitVersion.LegacySemVer)
|
||||
echo LegacySemVerPadded: $(GitVersion.LegacySemVerPadded)
|
||||
echo AssemblySemVer: $(GitVersion.AssemblySemVer)
|
||||
echo AssemblySemFileVer: $(GitVersion.AssemblySemFileVer)
|
||||
echo FullSemVer: $(GitVersion.FullSemVer)
|
||||
echo InformationalVersion: $(GitVersion.InformationalVersion)
|
||||
echo BranchName: $(GitVersion.BranchName)
|
||||
echo EscapedBranchName: $(GitVersion.EscapedBranchName)
|
||||
echo Sha: $(GitVersion.Sha)
|
||||
echo ShortSha: $(GitVersion.ShortSha)
|
||||
echo NuGetVersionV2: $(GitVersion.NuGetVersionV2)
|
||||
echo NuGetVersion: $(GitVersion.NuGetVersion)
|
||||
echo NuGetPreReleaseTagV2: $(GitVersion.NuGetPreReleaseTagV2)
|
||||
echo NuGetPreReleaseTag: $(GitVersion.NuGetPreReleaseTag)
|
||||
echo VersionSourceSha: $(GitVersion.VersionSourceSha)
|
||||
echo CommitsSinceVersionSource: $(GitVersion.CommitsSinceVersionSource)
|
||||
echo CommitsSinceVersionSourcePadded: $(GitVersion.CommitsSinceVersionSourcePadded)
|
||||
echo UncommittedChanges: $(GitVersion.UncommittedChanges)
|
||||
echo CommitDate: $(GitVersion.CommitDate)
|
||||
- displayName: Display GitVersion outputs (step output)
|
||||
script: |
|
||||
echo "Major: $(version.major)"
|
||||
echo "Minor: $(version.minor)"
|
||||
echo "Patch: $(version.patch)"
|
||||
echo "PreReleaseTag: $(version.preReleaseTag)"
|
||||
echo "PreReleaseTagWithDash: $(version.preReleaseTagWithDash)"
|
||||
echo "PreReleaseLabel: $(version.preReleaseLabel)"
|
||||
echo "PreReleaseNumber: $(version.preReleaseNumber)"
|
||||
echo "WeightedPreReleaseNumber: $(version.weightedPreReleaseNumber)"
|
||||
echo "BuildMetaData: $(version.buildMetaData)"
|
||||
echo "BuildMetaDataPadded: $(version.buildMetaDataPadded)"
|
||||
echo "FullBuildMetaData: $(version.fullBuildMetaData)"
|
||||
echo "MajorMinorPatch: $(version.majorMinorPatch)"
|
||||
echo "SemVer: $(version.semVer)"
|
||||
echo "LegacySemVer: $(version.legacySemVer)"
|
||||
echo "LegacySemVerPadded: $(version.legacySemVerPadded)"
|
||||
echo "AssemblySemVer: $(version.assemblySemVer)"
|
||||
echo "AssemblySemFileVer: $(version.assemblySemFileVer)"
|
||||
echo "FullSemVer: $(version.fullSemVer)"
|
||||
echo "InformationalVersion: $(version.informationalVersion)"
|
||||
echo "BranchName: $(version.branchName)"
|
||||
echo "EscapedBranchName: $(version.escapedBranchName)"
|
||||
echo "Sha: $(version.sha)"
|
||||
echo "ShortSha: $(version.shortSha)"
|
||||
echo "NuGetVersionV2: $(version.nuGetVersionV2)"
|
||||
echo "NuGetVersion: $(version.nuGetVersion)"
|
||||
echo "NuGetPreReleaseTagV2: $(version.nuGetPreReleaseTagV2)"
|
||||
echo "NuGetPreReleaseTag: $(version.nuGetPreReleaseTag)"
|
||||
echo "VersionSourceSha: $(version.versionSourceSha)"
|
||||
echo "CommitsSinceVersionSource: $(version.commitsSinceVersionSource)"
|
||||
echo "CommitsSinceVersionSourcePadded: $(version.commitsSinceVersionSourcePadded)"
|
||||
echo "UncommittedChanges: $(version.uncommittedChanges)"
|
||||
echo "CommitDate: $(version.commitDate)"
|
||||
|
||||
- displayName: Display GitVersion outputs (step output with prefix)
|
||||
script: |
|
||||
echo "Major: $(version.GitVersion_Major)"
|
||||
echo "Minor: $(version.GitVersion_Minor)"
|
||||
echo "Patch: $(version.GitVersion_Patch)"
|
||||
echo "PreReleaseTag: $(version.GitVersion_PreReleaseTag)"
|
||||
echo "PreReleaseTagWithDash: $(version.GitVersion_PreReleaseTagWithDash)"
|
||||
echo "PreReleaseLabel: $(version.GitVersion_PreReleaseLabel)"
|
||||
echo "PreReleaseNumber: $(version.GitVersion_PreReleaseNumber)"
|
||||
echo "WeightedPreReleaseNumber: $(version.GitVersion_WeightedPreReleaseNumber)"
|
||||
echo "BuildMetaData: $(version.GitVersion_BuildMetaData)"
|
||||
echo "BuildMetaDataPadded: $(version.GitVersion_BuildMetaDataPadded)"
|
||||
echo "FullBuildMetaData: $(version.GitVersion_FullBuildMetaData)"
|
||||
echo "MajorMinorPatch: $(version.GitVersion_MajorMinorPatch)"
|
||||
echo "SemVer: $(version.GitVersion_SemVer)"
|
||||
echo "LegacySemVer: $(version.GitVersion_LegacySemVer)"
|
||||
echo "LegacySemVerPadded: $(version.GitVersion_LegacySemVerPadded)"
|
||||
echo "AssemblySemVer: $(version.GitVersion_AssemblySemVer)"
|
||||
echo "AssemblySemFileVer: $(version.GitVersion_AssemblySemFileVer)"
|
||||
echo "FullSemVer: $(version.GitVersion_FullSemVer)"
|
||||
echo "InformationalVersion: $(version.GitVersion_InformationalVersion)"
|
||||
echo "BranchName: $(version.GitVersion_BranchName)"
|
||||
echo "EscapedBranchName: $(version.GitVersion_EscapedBranchName)"
|
||||
echo "Sha: $(version.GitVersion_Sha)"
|
||||
echo "ShortSha: $(version.GitVersion_ShortSha)"
|
||||
echo "NuGetVersionV2: $(version.GitVersion_NuGetVersionV2)"
|
||||
echo "NuGetVersion: $(version.GitVersion_NuGetVersion)"
|
||||
echo "NuGetPreReleaseTagV2: $(version.GitVersion_NuGetPreReleaseTagV2)"
|
||||
echo "NuGetPreReleaseTag: $(version.GitVersion_NuGetPreReleaseTag)"
|
||||
echo "VersionSourceSha: $(version.GitVersion_VersionSourceSha)"
|
||||
echo "CommitsSinceVersionSource: $(version.GitVersion_CommitsSinceVersionSource)"
|
||||
echo "CommitsSinceVersionSourcePadded: $(version.GitVersion_CommitsSinceVersionSourcePadded)"
|
||||
echo "UncommittedChanges: $(version.GitVersion_UncommittedChanges)"
|
||||
echo "CommitDate: $(version.GitVersion_CommitDate)"
|
||||
```
|
||||
|
||||
### Example 6
|
||||
@@ -212,51 +251,123 @@ steps:
|
||||
- task: gitversion/execute@0
|
||||
displayName: Determine Version
|
||||
|
||||
- displayName: Display GitVersion variables (without prefix)
|
||||
script: |
|
||||
echo "Major: $(major)"
|
||||
echo "Minor: $(minor)"
|
||||
echo "Patch: $(patch)"
|
||||
echo "PreReleaseTag: $(preReleaseTag)"
|
||||
echo "PreReleaseTagWithDash: $(preReleaseTagWithDash)"
|
||||
echo "PreReleaseLabel: $(preReleaseLabel)"
|
||||
echo "PreReleaseNumber: $(preReleaseNumber)"
|
||||
echo "WeightedPreReleaseNumber: $(weightedPreReleaseNumber)"
|
||||
echo "BuildMetaData: $(buildMetaData)"
|
||||
echo "BuildMetaDataPadded: $(buildMetaDataPadded)"
|
||||
echo "FullBuildMetaData: $(fullBuildMetaData)"
|
||||
echo "MajorMinorPatch: $(majorMinorPatch)"
|
||||
echo "SemVer: $(semVer)"
|
||||
echo "LegacySemVer: $(legacySemVer)"
|
||||
echo "LegacySemVerPadded: $(legacySemVerPadded)"
|
||||
echo "AssemblySemVer: $(assemblySemVer)"
|
||||
echo "AssemblySemFileVer: $(assemblySemFileVer)"
|
||||
echo "FullSemVer: $(fullSemVer)"
|
||||
echo "InformationalVersion: $(informationalVersion)"
|
||||
echo "BranchName: $(branchName)"
|
||||
echo "EscapedBranchName: $(escapedBranchName)"
|
||||
echo "Sha: $(sha)"
|
||||
echo "ShortSha: $(shortSha)"
|
||||
echo "NuGetVersionV2: $(nuGetVersionV2)"
|
||||
echo "NuGetVersion: $(nuGetVersion)"
|
||||
echo "NuGetPreReleaseTagV2: $(nuGetPreReleaseTagV2)"
|
||||
echo "NuGetPreReleaseTag: $(nuGetPreReleaseTag)"
|
||||
echo "VersionSourceSha: $(versionSourceSha)"
|
||||
echo "CommitsSinceVersionSource: $(commitsSinceVersionSource)"
|
||||
echo "CommitsSinceVersionSourcePadded: $(commitsSinceVersionSourcePadded)"
|
||||
echo "UncommittedChanges: $(uncommittedChanges)"
|
||||
echo "CommitDate: $(commitDate)"
|
||||
|
||||
- displayName: Display GitVersion variables (with prefix)
|
||||
script: |
|
||||
echo "Major: $(GitVersion_Major)"
|
||||
echo "Minor: $(GitVersion_Minor)"
|
||||
echo "Patch: $(GitVersion_Patch)"
|
||||
echo "PreReleaseTag: $(GitVersion_PreReleaseTag)"
|
||||
echo "PreReleaseTagWithDash: $(GitVersion_PreReleaseTagWithDash)"
|
||||
echo "PreReleaseLabel: $(GitVersion_PreReleaseLabel)"
|
||||
echo "PreReleaseNumber: $(GitVersion_PreReleaseNumber)"
|
||||
echo "WeightedPreReleaseNumber: $(GitVersion_WeightedPreReleaseNumber)"
|
||||
echo "BuildMetaData: $(GitVersion_BuildMetaData)"
|
||||
echo "BuildMetaDataPadded: $(GitVersion_BuildMetaDataPadded)"
|
||||
echo "FullBuildMetaData: $(GitVersion_FullBuildMetaData)"
|
||||
echo "MajorMinorPatch: $(GitVersion_MajorMinorPatch)"
|
||||
echo "SemVer: $(GitVersion_SemVer)"
|
||||
echo "LegacySemVer: $(GitVersion_LegacySemVer)"
|
||||
echo "LegacySemVerPadded: $(GitVersion_LegacySemVerPadded)"
|
||||
echo "AssemblySemVer: $(GitVersion_AssemblySemVer)"
|
||||
echo "AssemblySemFileVer: $(GitVersion_AssemblySemFileVer)"
|
||||
echo "FullSemVer: $(GitVersion_FullSemVer)"
|
||||
echo "InformationalVersion: $(GitVersion_InformationalVersion)"
|
||||
echo "BranchName: $(GitVersion_BranchName)"
|
||||
echo "EscapedBranchName: $(GitVersion_EscapedBranchName)"
|
||||
echo "Sha: $(GitVersion_Sha)"
|
||||
echo "ShortSha: $(GitVersion_ShortSha)"
|
||||
echo "NuGetVersionV2: $(GitVersion_NuGetVersionV2)"
|
||||
echo "NuGetVersion: $(GitVersion_NuGetVersion)"
|
||||
echo "NuGetPreReleaseTagV2: $(GitVersion_NuGetPreReleaseTagV2)"
|
||||
echo "NuGetPreReleaseTag: $(GitVersion_NuGetPreReleaseTag)"
|
||||
echo "VersionSourceSha: $(GitVersion_VersionSourceSha)"
|
||||
echo "CommitsSinceVersionSource: $(GitVersion_CommitsSinceVersionSource)"
|
||||
echo "CommitsSinceVersionSourcePadded: $(GitVersion_CommitsSinceVersionSourcePadded)"
|
||||
echo "UncommittedChanges: $(GitVersion_UncommittedChanges)"
|
||||
echo "CommitDate: $(GitVersion_CommitDate)"
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Pack Example
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: src/Example/LibExample.csproj
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: GitVersion.NuGetVersion # alternative syntax GITVERSION_NUGETVERSION (the former gets converted into the latter internally)
|
||||
versionEnvVar: GitVersion_SemVer # alternative syntax GITVERSION_SEMVER (the former gets converted into the latter internally)
|
||||
```
|
||||
|
||||
### Example 7
|
||||
|
||||
Calculate the version for the build and use the `GitVersion.BranchName` variable in a condition for starting another job.
|
||||
Calculate the version for the build and use the `GitVersion_BranchName` variable in a condition for starting another job.
|
||||
|
||||
```yaml
|
||||
job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
jobs:
|
||||
- job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
|
||||
job: CreateReleaseNotes
|
||||
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion.BranchName'], 'main'))
|
||||
dependsOn: CalculateVersion
|
||||
- job: CreateReleaseNotes
|
||||
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion_BranchName'], 'main'))
|
||||
dependsOn: CalculateVersion
|
||||
```
|
||||
|
||||
### Example 8
|
||||
|
||||
Calculate the version for the build and map the `GitVersion.SemVer` variable into a variable in another job.
|
||||
Calculate the version for the build and map the `GitVersion_SemVer` variable into a variable in another job.
|
||||
|
||||
```yaml
|
||||
job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
jobs:
|
||||
- job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
|
||||
job: BuildAndPack
|
||||
variables:
|
||||
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion.MajorMinorPatch'] ]
|
||||
- job: BuildAndPack
|
||||
variables:
|
||||
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion_MajorMinorPatch'] ]
|
||||
```
|
||||
|
||||
### Example 9
|
||||
@@ -277,7 +388,7 @@ stages:
|
||||
name: Version # the step MUST be named to access its output variables in another stage.
|
||||
|
||||
- stage: S2
|
||||
condition: and(succeeded(), gt(dependencies.S1.outputs['CalculateVersion.Version.GitVersion.Major'], 0))
|
||||
condition: and(succeeded(), gt(dependencies.S1.outputs['CalculateVersion.Version.GitVersion_Major'], 0))
|
||||
dependsOn: S1
|
||||
```
|
||||
|
||||
@@ -302,5 +413,5 @@ stages:
|
||||
jobs:
|
||||
- job: UpdateAssemblyVersions
|
||||
variables:
|
||||
Ver.AssemblyVer: $[ stageDependencies.S1.CalculateVersion.outputs['Version.GitVersion.AssemblySemVer'] ] # Note the 'stageDependencies.<jobName>' syntax.
|
||||
Ver.AssemblyVer: $[ stageDependencies.S1.CalculateVersion.outputs['Version.GitVersion_AssemblySemVer'] ] # Note the 'stageDependencies.<jobName>' syntax.
|
||||
```
|
||||
|
||||
@@ -21,12 +21,24 @@ ignoreFailedSources:
|
||||
description: Treat package source failures as warnings.
|
||||
required: false
|
||||
default: false
|
||||
preferLatestVersion:
|
||||
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
|
||||
required: false
|
||||
default: 'false'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage examples
|
||||
|
||||
In order for the gitversion to properly work you need to clone the repository with the entire history:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 0
|
||||
```
|
||||
|
||||
### Example 1
|
||||
|
||||
Install the latest GitVersion 5 version.
|
||||
@@ -63,3 +75,16 @@ steps:
|
||||
versionSpec: '6.x'
|
||||
includePrerelease: true
|
||||
```
|
||||
|
||||
### Example 4
|
||||
|
||||
Install the latest GitVersion 5 version even it there is a cached version matching the versionSpec.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitversion/setup@0
|
||||
displayName: Install GitVersion
|
||||
inputs:
|
||||
versionSpec: '5.x'
|
||||
preferLatestVersion: true
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/addasset@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/addasset@v0
|
||||
name: Add asset to a release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/close@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/close@v0
|
||||
name: Close release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/create@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/create@0
|
||||
name: Create release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/discard@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/discard@v0
|
||||
name: Discard release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/open@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/open@v0
|
||||
name: Open release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/publish@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/publish@v0
|
||||
name: Publish release with GitReleaseManager
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: gittools/actions/gitreleasemanager/setup@v0.9.2
|
||||
- uses: gittools/actions/gitreleasemanager/setup@v0
|
||||
name: Install GitReleaseManager
|
||||
with:
|
||||
versionSpec: '0.10.x'
|
||||
|
||||
@@ -60,12 +60,12 @@ The Execute GitVersion action creates the following outputs:
|
||||
- preReleaseNumber
|
||||
- weightedPreReleaseNumber
|
||||
- buildMetaData
|
||||
- buildMetaDataPadded
|
||||
- buildMetaDataPadded (removed in 6.0.0)
|
||||
- fullBuildMetaData
|
||||
- majorMinorPatch
|
||||
- semVer
|
||||
- legacySemVer
|
||||
- legacySemVerPadded
|
||||
- legacySemVer (removed in 6.0.0)
|
||||
- legacySemVerPadded (removed in 6.0.0)
|
||||
- assemblySemVer
|
||||
- assemblySemFileVer
|
||||
- fullSemVer
|
||||
@@ -74,19 +74,19 @@ The Execute GitVersion action creates the following outputs:
|
||||
- escapedBranchName (since 5.2.0)
|
||||
- sha
|
||||
- shortSha
|
||||
- nuGetVersionV2
|
||||
- nuGetVersion
|
||||
- nuGetPreReleaseTagV2
|
||||
- nuGetPreReleaseTag
|
||||
- nuGetVersionV2 (removed in 6.0.0)
|
||||
- nuGetVersion (removed in 6.0.0)
|
||||
- nuGetPreReleaseTagV2 (removed in 6.0.0)
|
||||
- nuGetPreReleaseTag (removed in 6.0.0)
|
||||
- versionSourceSha
|
||||
- commitsSinceVersionSource
|
||||
- commitsSinceVersionSourcePadded (since 5.2.0)
|
||||
- commitsSinceVersionSourcePadded (since 5.2.0, removed in 6.0.0)
|
||||
- uncommittedChanges (since 5.5.0)
|
||||
- commitDate
|
||||
|
||||
The outputs can be accessed using the syntax `${{ steps.<id>.outputs.<outputName> }}`, where `<id>` is the ID assigned to the step that calls the action, by subsequent steps later in the same job. See example [5](#example-5).
|
||||
The outputs can be accessed using the syntax `${{ steps.<id>.outputs.<outputName> }}` or `${{ steps.<id>.outputs.GitVersion_<OutputName> }}`, where `<id>` is the ID assigned to the step that calls the action, by subsequent steps later in the same job. See example [5](#example-5).
|
||||
|
||||
The action also creates environment variables of the form `GITVERSION_<OUTPUTNAME>` for use by other steps in the same job. See example [6](#example-6).
|
||||
The action also creates environment variables of the form `${{ env.<outputName> }}` or `${{ env.GitVersion_<OutputName> }}` for use by other steps in the same job. See example [6](#example-6).
|
||||
|
||||
The outputs can be accessed across jobs by mapping them to job outputs and referencing the job outputs using the `needs` context in dependent jobs. See examples [7](#example-7) and [8](#example-8).
|
||||
|
||||
@@ -100,10 +100,10 @@ Calculate the version for the build.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
||||
# gitversion/setup@v0 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
```
|
||||
|
||||
### Example 2
|
||||
@@ -113,7 +113,7 @@ Calculate the version for the build using a config file with the default name **
|
||||
```yaml
|
||||
steps:
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
with:
|
||||
useConfigFile: true
|
||||
```
|
||||
@@ -135,10 +135,10 @@ Calculate the version for the build using a config file named **VersionConfig.ym
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
||||
# gitversion/setup@v0 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
with:
|
||||
useConfigFile: true
|
||||
configFilePath: VersionConfig.yml
|
||||
@@ -150,10 +150,10 @@ Show the effective configuration for GitVersion by running the **/showConfig** c
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
||||
# gitversion/setup@v0 action omitted for brevity.
|
||||
|
||||
- name: Display GitVersion config
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
with:
|
||||
useConfigFile: true
|
||||
additionalArguments: '/showConfig'
|
||||
@@ -165,13 +165,13 @@ Calculate the version for the build and display all the calculated variables in
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
||||
# gitversion/setup@v0 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
id: gitversion # id to later be referenced
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
|
||||
- name: Display GitVersion outputs
|
||||
- name: Display GitVersion outputs (step output)
|
||||
run: |
|
||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||
@@ -205,22 +205,124 @@ steps:
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
||||
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
|
||||
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
||||
|
||||
- name: Display GitVersion outputs (step output with prefix)
|
||||
run: |
|
||||
echo "Major: ${{ steps.gitversion.outputs.GitVersion_Major }}"
|
||||
echo "Minor: ${{ steps.gitversion.outputs.GitVersion_Minor }}"
|
||||
echo "Patch: ${{ steps.gitversion.outputs.GitVersion_Patch }}"
|
||||
echo "PreReleaseTag: ${{ steps.gitversion.outputs.GitVersion_PreReleaseTag }}"
|
||||
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.GitVersion_PreReleaseTagWithDash }}"
|
||||
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.GitVersion_PreReleaseLabel }}"
|
||||
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.GitVersion_PreReleaseNumber }}"
|
||||
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.GitVersion_WeightedPreReleaseNumber }}"
|
||||
echo "BuildMetaData: ${{ steps.gitversion.outputs.GitVersion_BuildMetaData }}"
|
||||
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.GitVersion_BuildMetaDataPadded }}"
|
||||
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.GitVersion_FullBuildMetaData }}"
|
||||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.GitVersion_MajorMinorPatch }}"
|
||||
echo "SemVer: ${{ steps.gitversion.outputs.GitVersion_SemVer }}"
|
||||
echo "LegacySemVer: ${{ steps.gitversion.outputs.GitVersion_LegacySemVer }}"
|
||||
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.GitVersion_LegacySemVerPadded }}"
|
||||
echo "AssemblySemVer: ${{ steps.gitversion.outputs.GitVersion_AssemblySemVer }}"
|
||||
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.GitVersion_AssemblySemFileVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.GitVersion_FullSemVer }}"
|
||||
echo "InformationalVersion: ${{ steps.gitversion.outputs.GitVersion_InformationalVersion }}"
|
||||
echo "BranchName: ${{ steps.gitversion.outputs.GitVersion_BranchName }}"
|
||||
echo "EscapedBranchName: ${{ steps.gitversion.outputs.GitVersion_EscapedBranchName }}"
|
||||
echo "Sha: ${{ steps.gitversion.outputs.GitVersion_Sha }}"
|
||||
echo "ShortSha: ${{ steps.gitversion.outputs.GitVersion_ShortSha }}"
|
||||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.GitVersion_NuGetVersionV2 }}"
|
||||
echo "NuGetVersion: ${{ steps.gitversion.outputs.GitVersion_NuGetVersion }}"
|
||||
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.GitVersion_NuGetPreReleaseTagV2 }}"
|
||||
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.GitVersion_NuGetPreReleaseTag }}"
|
||||
echo "VersionSourceSha: ${{ steps.gitversion.outputs.GitVersion_VersionSourceSha }}"
|
||||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.GitVersion_CommitsSinceVersionSource }}"
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.GitVersion_CommitsSinceVersionSourcePadded }}"
|
||||
echo "UncommittedChanges: ${{ steps.gitversion.outputs.GitVersion_UncommittedChanges }}"
|
||||
echo "CommitDate: ${{ steps.gitversion.outputs.GitVersion_CommitDate }}"
|
||||
```
|
||||
|
||||
### Example 6
|
||||
|
||||
Calculate the version for the build and display the value of the `GITVERSION_SEMVER` environment variable.
|
||||
Calculate the version for the build and display the value of the `env.GitVersion_SemVer` environment variable.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
||||
# gitversion/setup@v0 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
|
||||
- name: Display SemVer
|
||||
|
||||
- name: Display GitVersion variables (without prefix)
|
||||
run: |
|
||||
echo "SemVer: $GITVERSION_SEMVER"
|
||||
echo "Major: ${{ env.major }}"
|
||||
echo "Minor: ${{ env.minor }}"
|
||||
echo "Patch: ${{ env.patch }}"
|
||||
echo "PreReleaseTag: ${{ env.preReleaseTag }}"
|
||||
echo "PreReleaseTagWithDash: ${{ env.preReleaseTagWithDash }}"
|
||||
echo "PreReleaseLabel: ${{ env.preReleaseLabel }}"
|
||||
echo "PreReleaseNumber: ${{ env.preReleaseNumber }}"
|
||||
echo "WeightedPreReleaseNumber: ${{ env.weightedPreReleaseNumber }}"
|
||||
echo "BuildMetaData: ${{ env.buildMetaData }}"
|
||||
echo "BuildMetaDataPadded: ${{ env.buildMetaDataPadded }}"
|
||||
echo "FullBuildMetaData: ${{ env.fullBuildMetaData }}"
|
||||
echo "MajorMinorPatch: ${{ env.majorMinorPatch }}"
|
||||
echo "SemVer: ${{ env.semVer }}"
|
||||
echo "LegacySemVer: ${{ env.legacySemVer }}"
|
||||
echo "LegacySemVerPadded: ${{ env.legacySemVerPadded }}"
|
||||
echo "AssemblySemVer: ${{ env.assemblySemVer }}"
|
||||
echo "AssemblySemFileVer: ${{ env.assemblySemFileVer }}"
|
||||
echo "FullSemVer: ${{ env.fullSemVer }}"
|
||||
echo "InformationalVersion: ${{ env.informationalVersion }}"
|
||||
echo "BranchName: ${{ env.branchName }}"
|
||||
echo "EscapedBranchName: ${{ env.escapedBranchName }}"
|
||||
echo "Sha: ${{ env.sha }}"
|
||||
echo "ShortSha: ${{ env.shortSha }}"
|
||||
echo "NuGetVersionV2: ${{ env.nuGetVersionV2 }}"
|
||||
echo "NuGetVersion: ${{ env.nuGetVersion }}"
|
||||
echo "NuGetPreReleaseTagV2: ${{ env.nuGetPreReleaseTagV2 }}"
|
||||
echo "NuGetPreReleaseTag: ${{ env.nuGetPreReleaseTag }}"
|
||||
echo "VersionSourceSha: ${{ env.versionSourceSha }}"
|
||||
echo "CommitsSinceVersionSource: ${{ env.commitsSinceVersionSource }}"
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ env.commitsSinceVersionSourcePadded }}"
|
||||
echo "UncommittedChanges: ${{ env.uncommittedChanges }}"
|
||||
echo "CommitDate: ${{ env.commitDate }}"
|
||||
|
||||
- name: Display GitVersion variables (with prefix)
|
||||
run: |
|
||||
echo "Major: ${{ env.GitVersion_Major }}"
|
||||
echo "Minor: ${{ env.GitVersion_Minor }}"
|
||||
echo "Patch: ${{ env.GitVersion_Patch }}"
|
||||
echo "PreReleaseTag: ${{ env.GitVersion_PreReleaseTag }}"
|
||||
echo "PreReleaseTagWithDash: ${{ env.GitVersion_PreReleaseTagWithDash }}"
|
||||
echo "PreReleaseLabel: ${{ env.GitVersion_PreReleaseLabel }}"
|
||||
echo "PreReleaseNumber: ${{ env.GitVersion_PreReleaseNumber }}"
|
||||
echo "WeightedPreReleaseNumber: ${{ env.GitVersion_WeightedPreReleaseNumber }}"
|
||||
echo "BuildMetaData: ${{ env.GitVersion_BuildMetaData }}"
|
||||
echo "BuildMetaDataPadded: ${{ env.GitVersion_BuildMetaDataPadded }}"
|
||||
echo "FullBuildMetaData: ${{ env.GitVersion_FullBuildMetaData }}"
|
||||
echo "MajorMinorPatch: ${{ env.GitVersion_MajorMinorPatch }}"
|
||||
echo "SemVer: ${{ env.GitVersion_SemVer }}"
|
||||
echo "LegacySemVer: ${{ env.GitVersion_LegacySemVer }}"
|
||||
echo "LegacySemVerPadded: ${{ env.GitVersion_LegacySemVerPadded }}"
|
||||
echo "AssemblySemVer: ${{ env.GitVersion_AssemblySemVer }}"
|
||||
echo "AssemblySemFileVer: ${{ env.GitVersion_AssemblySemFileVer }}"
|
||||
echo "FullSemVer: ${{ env.GitVersion_FullSemVer }}"
|
||||
echo "InformationalVersion: ${{ env.GitVersion_InformationalVersion }}"
|
||||
echo "BranchName: ${{ env.GitVersion_BranchName }}"
|
||||
echo "EscapedBranchName: ${{ env.GitVersion_EscapedBranchName }}"
|
||||
echo "Sha: ${{ env.GitVersion_Sha }}"
|
||||
echo "ShortSha: ${{ env.GitVersion_ShortSha }}"
|
||||
echo "NuGetVersionV2: ${{ env.GitVersion_NuGetVersionV2 }}"
|
||||
echo "NuGetVersion: ${{ env.GitVersion_NuGetVersion }}"
|
||||
echo "NuGetPreReleaseTagV2: ${{ env.GitVersion_NuGetPreReleaseTagV2 }}"
|
||||
echo "NuGetPreReleaseTag: ${{ env.GitVersion_NuGetPreReleaseTag }}"
|
||||
echo "VersionSourceSha: ${{ env.GitVersion_VersionSourceSha }}"
|
||||
echo "CommitsSinceVersionSource: ${{ env.GitVersion_CommitsSinceVersionSource }}"
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ env.GitVersion_CommitsSinceVersionSourcePadded }}"
|
||||
echo "UncommittedChanges: ${{ env.GitVersion_UncommittedChanges }}"
|
||||
echo "CommitDate: ${{ env.GitVersion_CommitDate }}"
|
||||
```
|
||||
|
||||
### Example 7
|
||||
@@ -239,7 +341,7 @@ jobs:
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
|
||||
create-release-notes:
|
||||
name: Create Release Notes
|
||||
@@ -268,7 +370,7 @@ jobs:
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
||||
uses: gittools/actions/gitversion/execute@v0
|
||||
|
||||
display-semver:
|
||||
name: Display Semantic Version
|
||||
|
||||
@@ -27,6 +27,17 @@ ignoreFailedSources:
|
||||
|
||||
## Usage examples
|
||||
|
||||
In order for the gitversion to properly work you need to clone the repository with the entire history:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
```
|
||||
|
||||
### Example 1
|
||||
|
||||
Install the latest GitVersion 5 version.
|
||||
@@ -34,7 +45,7 @@ Install the latest GitVersion 5 version.
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
||||
uses: gittools/actions/gitversion/setup@v0
|
||||
with:
|
||||
versionSpec: '5.x'
|
||||
```
|
||||
@@ -46,7 +57,7 @@ Install GitVersion 5.5.0.
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
||||
uses: gittools/actions/gitversion/setup@v0
|
||||
with:
|
||||
versionSpec: '5.5.0'
|
||||
```
|
||||
@@ -58,8 +69,21 @@ Install the latest GitVersion 6 pre-release version. For example **6.0.0-beta1.
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
||||
uses: gittools/actions/gitversion/setup@v0
|
||||
with:
|
||||
versionSpec: '6.x'
|
||||
includePrerelease: true
|
||||
```
|
||||
|
||||
### Example 4
|
||||
|
||||
Install the latest GitVersion 5 version even it there is a cached version matching the versionSpec.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0
|
||||
with:
|
||||
versionSpec: '5.x'
|
||||
preferLatestVersion: true
|
||||
```
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/addasset/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/close/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/create/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/discard/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/open/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/publish/bundle.js
|
||||
inputs:
|
||||
owner:
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitreleasemanager/setup/bundle.js
|
||||
inputs:
|
||||
versionSpec:
|
||||
@@ -20,3 +20,7 @@ inputs:
|
||||
description: Treat package source failures as warnings.
|
||||
required: false
|
||||
default: 'false'
|
||||
preferLatestVersion:
|
||||
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitversion/execute/bundle.js
|
||||
inputs:
|
||||
targetPath:
|
||||
@@ -96,4 +96,4 @@ outputs:
|
||||
uncommittedChanges:
|
||||
description: 'The UncommittedChanges value'
|
||||
commitDate:
|
||||
description: 'The CommitDate value'
|
||||
description: 'The CommitDate value'
|
||||
|
||||
@@ -5,7 +5,7 @@ branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../../dist/github/gitversion/setup/bundle.js
|
||||
inputs:
|
||||
versionSpec:
|
||||
@@ -20,3 +20,7 @@ inputs:
|
||||
description: Treat package source failures as warnings.
|
||||
required: false
|
||||
default: 'false'
|
||||
preferLatestVersion:
|
||||
description: Prefer to download the latest version matching the versionSpec, even if there is a local cached version.
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
1999
package-lock.json
generated
1999
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
44
package.json
44
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "gittools-actions",
|
||||
"version": "1.0.0",
|
||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||
"description": "Easy Semantic Versioning (https://semver.org) for projects using Git",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/GitTools/use-gitversion.git"
|
||||
@@ -26,34 +26,34 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"azure-pipelines-task-lib": "^4.3.0",
|
||||
"azure-pipelines-tool-lib": "^1.3.2",
|
||||
"inversify": "^6.0.1",
|
||||
"typed-rest-client": "^1.8.9",
|
||||
"uuid": "^9.0.0"
|
||||
"azure-pipelines-tool-lib": "^2.0.7",
|
||||
"inversify": "^6.0.2",
|
||||
"semver": "^7.6.0",
|
||||
"typed-rest-client": "^1.8.11",
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.15.0",
|
||||
"@types/q": "^1.5.5",
|
||||
"@types/semver-compare": "^1.0.1",
|
||||
"@types/uuid": "^9.0.1",
|
||||
"@types/node": "^20.11.20",
|
||||
"@types/q": "^1.5.8",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"minimist": "^1.2.8",
|
||||
"prettier": "^2.8.4",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"prettier": "^3.2.5",
|
||||
"reflect-metadata": "^0.2.1",
|
||||
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||
"shelljs": "^0.8.5",
|
||||
"terser-webpack-plugin": "^5.3.7",
|
||||
"tfx-cli": "^0.14.0",
|
||||
"trim-newlines": ">=4.0.2",
|
||||
"ts-loader": "^9.4.2",
|
||||
"typescript": "^4.9.5",
|
||||
"terser-webpack-plugin": "^5.3.10",
|
||||
"tfx-cli": "^0.16.0",
|
||||
"trim-newlines": ">=5.0.0",
|
||||
"ts-loader": "^9.5.1",
|
||||
"typescript": "^5.3.3",
|
||||
"underscore": ">=1.13.6",
|
||||
"validator": "^13.9.0",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
"validator": "^13.11.0",
|
||||
"webpack": "^5.90.3",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,7 @@ class BuildAgent implements IBuildAgent {
|
||||
return toolLib.findLocalTool(toolName, versionSpec, arch)
|
||||
}
|
||||
|
||||
public cacheDir(
|
||||
sourceDir: string,
|
||||
tool: string,
|
||||
version: string,
|
||||
arch?: string
|
||||
): Promise<string> {
|
||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||
return toolLib.cacheDir(sourceDir, tool, version, arch)
|
||||
}
|
||||
|
||||
@@ -49,8 +44,8 @@ class BuildAgent implements IBuildAgent {
|
||||
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done)
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
taskLib.setVariable(name, val)
|
||||
public setVariable(name: string, value: string): void {
|
||||
taskLib.setVariable(name, value)
|
||||
}
|
||||
|
||||
public getVariable(name: string): string {
|
||||
@@ -83,7 +78,7 @@ class BuildAgent implements IBuildAgent {
|
||||
}
|
||||
|
||||
public setOutput(name: string, value: string): void {
|
||||
taskLib.setVariable(name, value)
|
||||
taskLib.setVariable(name, value, false, true)
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
|
||||
@@ -12,10 +12,7 @@ import * as toolCache from '@actions/tool-cache'
|
||||
import { injectable } from 'inversify'
|
||||
|
||||
import { IBuildAgent, IExecResult } from '../../core/models'
|
||||
import {
|
||||
IRequestOptions,
|
||||
IProxyConfiguration
|
||||
} from 'typed-rest-client/Interfaces'
|
||||
import { IRequestOptions, IProxyConfiguration } from 'typed-rest-client/Interfaces'
|
||||
|
||||
@injectable()
|
||||
class BuildAgent implements IBuildAgent {
|
||||
@@ -58,12 +55,7 @@ class BuildAgent implements IBuildAgent {
|
||||
return undefined
|
||||
}
|
||||
|
||||
let proxyURL =
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.http_proxy ||
|
||||
process.env.HTTPS_PROXY ||
|
||||
process.env.https_proxy ||
|
||||
null
|
||||
let proxyURL = process.env.HTTP_PROXY || process.env.http_proxy || process.env.HTTPS_PROXY || process.env.https_proxy || null
|
||||
|
||||
if (proxyURL) {
|
||||
let url = new urlApi.URL(requestedUrl)
|
||||
@@ -78,12 +70,7 @@ class BuildAgent implements IBuildAgent {
|
||||
return undefined
|
||||
}
|
||||
|
||||
public cacheDir(
|
||||
sourceDir: string,
|
||||
tool: string,
|
||||
version: string,
|
||||
arch?: string
|
||||
): Promise<string> {
|
||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||
return toolCache.cacheDir(sourceDir, tool, version, arch)
|
||||
}
|
||||
|
||||
@@ -123,7 +110,7 @@ class BuildAgent implements IBuildAgent {
|
||||
//
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
public setVariable(name: string, val: string): void {
|
||||
core.exportVariable(name, val)
|
||||
}
|
||||
|
||||
@@ -141,24 +128,12 @@ class BuildAgent implements IBuildAgent {
|
||||
|
||||
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||
const dotnetPath = await io.which(exec, true)
|
||||
let resultCode = 0
|
||||
let stdout = ''
|
||||
let stderr = ''
|
||||
resultCode = await exe.exec(`"${dotnetPath}"`, args, {
|
||||
listeners: {
|
||||
stderr: (data: Buffer) => {
|
||||
stderr += data.toString()
|
||||
},
|
||||
stdout: (data: Buffer) => {
|
||||
stdout += data.toString()
|
||||
}
|
||||
}
|
||||
})
|
||||
let result = await exe.getExecOutput(`"${dotnetPath}"`, args);
|
||||
return {
|
||||
code: resultCode,
|
||||
code: result.exitCode,
|
||||
error: null,
|
||||
stderr,
|
||||
stdout
|
||||
stderr: result.stderr,
|
||||
stdout: result.stdout
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +143,6 @@ class BuildAgent implements IBuildAgent {
|
||||
|
||||
public setOutput(name: string, value: string): void {
|
||||
core.setOutput(name, value)
|
||||
core.exportVariable(`GITVERSION_${name.toUpperCase()}`, value)
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
|
||||
@@ -19,12 +19,7 @@ class BuildAgent implements IBuildAgent {
|
||||
return 'find'
|
||||
}
|
||||
|
||||
public cacheDir(
|
||||
sourceDir: string,
|
||||
tool: string,
|
||||
version: string,
|
||||
arch?: string
|
||||
): Promise<string> {
|
||||
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||
console.log('cacheDir')
|
||||
return Promise.resolve('cacheDir')
|
||||
}
|
||||
@@ -46,8 +41,8 @@ class BuildAgent implements IBuildAgent {
|
||||
console.log('setSucceeded')
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
console.log('exportVariable')
|
||||
public setVariable(name: string, val: string): void {
|
||||
console.log('setVariable')
|
||||
}
|
||||
|
||||
public getVariable(name: string): string {
|
||||
|
||||
@@ -4,16 +4,13 @@ import * as path from 'path'
|
||||
import * as http from 'typed-rest-client/HttpClient'
|
||||
|
||||
import { inject, injectable } from 'inversify'
|
||||
import { TYPES, IExecResult, IBuildAgent, ISetupSettings } from './models'
|
||||
import { IBuildAgent, IExecResult, TYPES } from './models'
|
||||
import { IVersionManager } from './versionManager'
|
||||
import { ISetupSettings } from '../tools/common/models'
|
||||
|
||||
export interface IDotnetTool {
|
||||
disableTelemetry(): void
|
||||
toolInstall(
|
||||
toolName: string,
|
||||
checkLatest: boolean,
|
||||
setupSettings: ISetupSettings
|
||||
): Promise<string>
|
||||
toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string>
|
||||
}
|
||||
|
||||
@injectable()
|
||||
@@ -22,25 +19,17 @@ export class DotnetTool implements IDotnetTool {
|
||||
protected versionManager: IVersionManager
|
||||
private httpClient: http.HttpClient
|
||||
|
||||
private static readonly nugetRoot: string =
|
||||
'https://api-v2v3search-0.nuget.org/'
|
||||
private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/query'
|
||||
|
||||
constructor(
|
||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||
) {
|
||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||
this.buildAgent = buildAgent
|
||||
this.versionManager = versionManager
|
||||
this.httpClient = new http.HttpClient(
|
||||
'dotnet',
|
||||
undefined,
|
||||
this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot)
|
||||
)
|
||||
this.httpClient = new http.HttpClient('dotnet', undefined, this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot))
|
||||
}
|
||||
|
||||
public disableTelemetry(): void {
|
||||
this.buildAgent.exportVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
||||
this.buildAgent.exportVariable('DOTNET_NOLOGO', 'true')
|
||||
this.buildAgent.setVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
||||
this.buildAgent.setVariable('DOTNET_NOLOGO', 'true')
|
||||
}
|
||||
|
||||
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
||||
@@ -48,20 +37,17 @@ export class DotnetTool implements IDotnetTool {
|
||||
return this.buildAgent.exec(cmd, args)
|
||||
}
|
||||
|
||||
public async toolInstall(
|
||||
toolName: string,
|
||||
checkLatest: boolean,
|
||||
setupSettings: ISetupSettings
|
||||
): Promise<string> {
|
||||
public async toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string> {
|
||||
console.log('')
|
||||
console.log('--------------------------')
|
||||
console.log(
|
||||
`Installing ${toolName} version ` + setupSettings.versionSpec
|
||||
)
|
||||
console.log(`Acquiring ${toolName} version spec: ${setupSettings.versionSpec}`)
|
||||
console.log('--------------------------')
|
||||
|
||||
let version: string
|
||||
let checkLatest = setupSettings.preferLatestVersion
|
||||
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
|
||||
checkLatest = false // check latest doesn't make sense when explicit version
|
||||
version = setupSettings.versionSpec
|
||||
}
|
||||
|
||||
let toolPath: string
|
||||
@@ -73,10 +59,7 @@ export class DotnetTool implements IDotnetTool {
|
||||
}
|
||||
|
||||
if (!toolPath) {
|
||||
let version: string
|
||||
if (
|
||||
this.versionManager.isExplicitVersion(setupSettings.versionSpec)
|
||||
) {
|
||||
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
|
||||
//
|
||||
// Explicit version was specified. No need to query for list of versions.
|
||||
//
|
||||
@@ -88,15 +71,9 @@ export class DotnetTool implements IDotnetTool {
|
||||
// If your tool doesn't offer a mechanism to query,
|
||||
// then it can only support exact version inputs.
|
||||
//
|
||||
version = await this.queryLatestMatch(
|
||||
toolName,
|
||||
setupSettings.versionSpec,
|
||||
setupSettings.includePrerelease
|
||||
)
|
||||
version = await this.queryLatestMatch(toolName, setupSettings.versionSpec, setupSettings.includePrerelease)
|
||||
if (!version) {
|
||||
throw new Error(
|
||||
`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`
|
||||
)
|
||||
throw new Error(`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`)
|
||||
}
|
||||
|
||||
//
|
||||
@@ -108,50 +85,38 @@ export class DotnetTool implements IDotnetTool {
|
||||
//
|
||||
// Download, extract, cache
|
||||
//
|
||||
toolPath = await this.acquireTool(
|
||||
toolName,
|
||||
version,
|
||||
setupSettings.ignoreFailedSources
|
||||
)
|
||||
toolPath = await this.acquireTool(toolName, version, setupSettings.ignoreFailedSources)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('--------------------------')
|
||||
console.log(`${toolName} version: ${version} installed.`)
|
||||
console.log('--------------------------')
|
||||
//
|
||||
// Prepend the tools path. This prepends the PATH for the current process and
|
||||
// instructs the agent to prepend for each task that follows.
|
||||
//
|
||||
this.buildAgent.debug(`toolPath: ${toolPath}`)
|
||||
|
||||
if (
|
||||
os.platform() !== 'win32' &&
|
||||
!this.buildAgent.getVariable('DOTNET_ROOT')
|
||||
) {
|
||||
if (os.platform() !== 'win32' && !this.buildAgent.getVariable('DOTNET_ROOT')) {
|
||||
let dotnetPath = await this.buildAgent.which('dotnet')
|
||||
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
|
||||
const dotnetRoot = path.dirname(dotnetPath)
|
||||
this.buildAgent.exportVariable('DOTNET_ROOT', dotnetRoot)
|
||||
this.buildAgent.setVariable('DOTNET_ROOT', dotnetRoot)
|
||||
}
|
||||
this.buildAgent.addPath(toolPath)
|
||||
|
||||
return toolPath
|
||||
}
|
||||
|
||||
private async queryLatestMatch(
|
||||
toolName: string,
|
||||
versionSpec: string,
|
||||
includePrerelease: boolean
|
||||
): Promise<string> {
|
||||
private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise<string> {
|
||||
this.buildAgent.debug(
|
||||
`querying tool versions for ${toolName}${
|
||||
versionSpec ? `@${versionSpec}` : ''
|
||||
} ${includePrerelease ? 'including pre-releases' : ''}`
|
||||
`querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ''} ${includePrerelease ? 'including pre-releases' : ''}`
|
||||
)
|
||||
|
||||
const downloadPath = `${
|
||||
DotnetTool.nugetRoot
|
||||
}query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${
|
||||
includePrerelease ? 'true' : 'false'
|
||||
}&semVerLevel=2.0.0`
|
||||
const toolNameParam = encodeURIComponent(toolName.toLowerCase())
|
||||
const prereleaseParam = includePrerelease ? 'true' : 'false'
|
||||
const downloadPath = `${DotnetTool.nugetRoot}?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
|
||||
|
||||
const res = await this.httpClient.get(downloadPath)
|
||||
|
||||
@@ -162,23 +127,19 @@ export class DotnetTool implements IDotnetTool {
|
||||
const body: string = await res.readBody()
|
||||
const data = JSON.parse(body).data
|
||||
|
||||
const versions = (data[0].versions as { version: string }[]).map(
|
||||
x => x.version
|
||||
)
|
||||
const versions = (data[0].versions as { version: string }[]).map(x => x.version)
|
||||
if (!versions || !versions.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
this.buildAgent.debug(`got versions: ${versions.join(', ')}`)
|
||||
|
||||
return this.versionManager.evaluateVersions(versions, versionSpec)
|
||||
return this.versionManager.evaluateVersions(versions, versionSpec, {
|
||||
includePrerelease
|
||||
})
|
||||
}
|
||||
|
||||
private async acquireTool(
|
||||
toolName: string,
|
||||
version: string,
|
||||
ignoreFailedSources: boolean
|
||||
): Promise<string> {
|
||||
private async acquireTool(toolName: string, version: string, ignoreFailedSources: boolean): Promise<string> {
|
||||
const tempDirectory = await this.buildAgent.createTempDir()
|
||||
let args = ['tool', 'install', toolName, '--tool-path', tempDirectory]
|
||||
|
||||
|
||||
@@ -5,19 +5,9 @@ export const TYPES = {
|
||||
IDotnetTool: Symbol.for('DotnetTool'),
|
||||
IGitVersionTool: Symbol.for('GitVersionTool'),
|
||||
IGitReleaseManagerTool: Symbol.for('GitReleaseManagerTool'),
|
||||
IVersionManager: Symbol.for('VersionManager')
|
||||
}
|
||||
|
||||
export enum SetupFields {
|
||||
includePrerelease = 'includePrerelease',
|
||||
versionSpec = 'versionSpec',
|
||||
ignoreFailedSources = 'ignoreFailedSources'
|
||||
}
|
||||
|
||||
export interface ISetupSettings {
|
||||
[SetupFields.versionSpec]: string
|
||||
[SetupFields.includePrerelease]: boolean
|
||||
[SetupFields.ignoreFailedSources]: boolean
|
||||
IVersionManager: Symbol.for('VersionManager'),
|
||||
IGitVersionSettingsProvider: Symbol.for('GitVersionSettingsProvider'),
|
||||
IGitReleaseManagerSettingsProvider: Symbol.for('GitReleaseManagerSettingsProvider')
|
||||
}
|
||||
|
||||
export interface IExecResult {
|
||||
@@ -26,22 +16,16 @@ export interface IExecResult {
|
||||
code: number
|
||||
error: Error
|
||||
}
|
||||
|
||||
export interface IBuildAgent {
|
||||
agentName: string
|
||||
proxyConfiguration(url: string): IRequestOptions
|
||||
find(toolName: string, versionSpec: string, arch?: string): string
|
||||
cacheDir(
|
||||
sourceDir: string,
|
||||
tool: string,
|
||||
version: string,
|
||||
arch?: string
|
||||
): Promise<string>
|
||||
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>
|
||||
createTempDir(): Promise<string>
|
||||
debug(message: string): void
|
||||
setFailed(message: string, done?: boolean): void
|
||||
setSucceeded(message: string, done?: boolean): void
|
||||
exportVariable(name: string, val: string): void
|
||||
setVariable(name: string, val: string): void
|
||||
getVariable(name: string): string
|
||||
addPath(inputPath: string): void
|
||||
which(tool: string, check?: boolean): Promise<string>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import { IBuildAgent, SetupFields, ISetupSettings } from './models'
|
||||
|
||||
export class Settings {
|
||||
public static getSetupSettings(buildAgent: IBuildAgent): ISetupSettings {
|
||||
const versionSpec = buildAgent.getInput(SetupFields.versionSpec)
|
||||
const includePrerelease = buildAgent.getBooleanInput(
|
||||
SetupFields.includePrerelease
|
||||
)
|
||||
const ignoreFailedSources = buildAgent.getBooleanInput(
|
||||
SetupFields.ignoreFailedSources
|
||||
)
|
||||
|
||||
return {
|
||||
versionSpec,
|
||||
includePrerelease,
|
||||
ignoreFailedSources
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import cmp from 'semver-compare'
|
||||
import * as semver from 'semver'
|
||||
import { injectable, inject } from 'inversify'
|
||||
|
||||
@@ -6,7 +5,7 @@ import { IBuildAgent, TYPES } from './models'
|
||||
|
||||
export interface IVersionManager {
|
||||
isExplicitVersion(versionSpec: string): boolean
|
||||
evaluateVersions(versions: string[], versionSpec: string): string
|
||||
evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string
|
||||
cleanVersion(version: string): string
|
||||
}
|
||||
|
||||
@@ -27,13 +26,13 @@ export class VersionManager implements IVersionManager {
|
||||
return valid
|
||||
}
|
||||
|
||||
public evaluateVersions(versions: string[], versionSpec: string): string {
|
||||
public evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string {
|
||||
let version: string
|
||||
this.buildAgent.debug('evaluating ' + versions.length + ' versions')
|
||||
versions = versions.sort(cmp)
|
||||
versions = semver.sort(versions)
|
||||
for (let i = versions.length - 1; i >= 0; i--) {
|
||||
const potential: string = versions[i]
|
||||
const satisfied: boolean = semver.satisfies(potential, versionSpec)
|
||||
const satisfied: boolean = semver.satisfies(potential, versionSpec, optionsOrLoose)
|
||||
if (satisfied) {
|
||||
version = potential
|
||||
break
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { addAsset } from './main'
|
||||
|
||||
addAsset()
|
||||
await addAsset()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { close } from './main'
|
||||
|
||||
close()
|
||||
await close()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { create } from './main'
|
||||
|
||||
create()
|
||||
await create()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { discard } from './main'
|
||||
|
||||
discard()
|
||||
await discard()
|
||||
|
||||
@@ -1,34 +1,26 @@
|
||||
import { IBuildAgent, TYPES } from '../../core/models'
|
||||
import {
|
||||
IGitReleaseManagerTool,
|
||||
GitReleaseManagerTool
|
||||
} from '../../tools/gitreleasemanager/tool'
|
||||
import { Settings as CommonSettings } from '../../core/settings'
|
||||
import { Settings } from '../../tools/gitreleasemanager/settings'
|
||||
import { IGitReleaseManagerTool, GitReleaseManagerTool } from '../../tools/gitreleasemanager/tool'
|
||||
import { IGitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/models'
|
||||
import { GitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/settings'
|
||||
|
||||
import container from '../../core/ioc'
|
||||
|
||||
container
|
||||
.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
|
||||
.to(GitReleaseManagerTool)
|
||||
container.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool)
|
||||
container.bind<IGitReleaseManagerSettingsProvider>(TYPES.IGitReleaseManagerSettingsProvider).to(GitReleaseManagerSettingsProvider)
|
||||
|
||||
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(
|
||||
TYPES.IGitReleaseManagerTool
|
||||
)
|
||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
||||
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
|
||||
const settingsProvider = container.get<IGitReleaseManagerSettingsProvider>(TYPES.IGitReleaseManagerSettingsProvider)
|
||||
|
||||
export async function setup() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = CommonSettings.getSetupSettings(buildAgent)
|
||||
const settings = settingsProvider.getSetupSettings()
|
||||
|
||||
await gitReleaseManagerTool.install(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager installed successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager installed successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -38,14 +30,11 @@ export async function create() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getCreateSettings(buildAgent)
|
||||
const settings = settingsProvider.getCreateSettings()
|
||||
|
||||
await gitReleaseManagerTool.create(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager created release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager created release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -55,14 +44,11 @@ export async function discard() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getDiscardSettings(buildAgent)
|
||||
const settings = settingsProvider.getDiscardSettings()
|
||||
|
||||
await gitReleaseManagerTool.discard(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager discarded release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager discarded release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -72,14 +58,11 @@ export async function close() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getCloseSettings(buildAgent)
|
||||
const settings = settingsProvider.getCloseSettings()
|
||||
|
||||
await gitReleaseManagerTool.close(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager closed release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager closed release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -89,14 +72,11 @@ export async function open() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getOpenSettings(buildAgent)
|
||||
const settings = settingsProvider.getOpenSettings()
|
||||
|
||||
await gitReleaseManagerTool.open(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager opened release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager opened release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -106,14 +86,11 @@ export async function publish() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getPublishSettings(buildAgent)
|
||||
const settings = settingsProvider.getPublishSettings()
|
||||
|
||||
await gitReleaseManagerTool.publish(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager published release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager published release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
@@ -123,14 +100,11 @@ export async function addAsset() {
|
||||
try {
|
||||
gitReleaseManagerTool.disableTelemetry()
|
||||
|
||||
const settings = Settings.getAddAssetSettings(buildAgent)
|
||||
const settings = settingsProvider.getAddAssetSettings()
|
||||
|
||||
await gitReleaseManagerTool.addAsset(settings)
|
||||
|
||||
buildAgent.setSucceeded(
|
||||
'GitVersionManager added assets to release successfully',
|
||||
true
|
||||
)
|
||||
buildAgent.setSucceeded('GitVersionManager added assets to release successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { open } from './main'
|
||||
|
||||
open()
|
||||
await open()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { publish } from './main'
|
||||
|
||||
publish()
|
||||
await publish()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { setup } from './main'
|
||||
|
||||
setup()
|
||||
await setup()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { run } from './main'
|
||||
|
||||
run()
|
||||
await run()
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
import { IBuildAgent, TYPES } from '../../core/models'
|
||||
import { Settings as CommonSettings } from '../../core/settings'
|
||||
import { Settings } from '../../tools/gitversion/settings'
|
||||
import { IGitVersionTool, GitVersionTool } from '../../tools/gitversion/tool'
|
||||
import {
|
||||
GitVersionSettings,
|
||||
GitVersionOutput
|
||||
} from '../../tools/gitversion/models'
|
||||
import { GitVersionSettings, GitVersionOutput, IGitVersionSettingsProvider } from '../../tools/gitversion/models'
|
||||
import { GitVersionSettingsProvider } from '../../tools/gitversion/settings'
|
||||
|
||||
import container from '../../core/ioc'
|
||||
|
||||
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
|
||||
container.bind<IGitVersionSettingsProvider>(TYPES.IGitVersionSettingsProvider).to(GitVersionSettingsProvider)
|
||||
|
||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
|
||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
|
||||
const settingsProvider = container.get<IGitVersionSettingsProvider>(TYPES.IGitVersionSettingsProvider)
|
||||
|
||||
export async function setup() {
|
||||
try {
|
||||
gitVersionTool.disableTelemetry()
|
||||
console.log(`Agent: '${buildAgent.agentName}'`)
|
||||
|
||||
const settings = CommonSettings.getSetupSettings(buildAgent)
|
||||
const settings = settingsProvider.getSetupSettings()
|
||||
|
||||
await gitVersionTool.install(settings)
|
||||
|
||||
@@ -31,23 +30,24 @@ export async function setup() {
|
||||
export async function run() {
|
||||
try {
|
||||
gitVersionTool.disableTelemetry()
|
||||
console.log(`Agent: '${buildAgent.agentName}'`)
|
||||
|
||||
const settings: GitVersionSettings = Settings.getGitVersionSettings(
|
||||
buildAgent
|
||||
)
|
||||
const settings: GitVersionSettings = settingsProvider.getGitVersionSettings()
|
||||
|
||||
const result = await gitVersionTool.run(settings)
|
||||
const { stdout } = result
|
||||
const jsonOutput = stdout.substring(
|
||||
stdout.lastIndexOf('{'),
|
||||
stdout.lastIndexOf('}') + 1
|
||||
)
|
||||
|
||||
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
|
||||
gitVersionTool.writeGitVersionToAgent(gitversion)
|
||||
|
||||
if (result.code === 0) {
|
||||
buildAgent.setSucceeded('GitVersion executed successfully', true)
|
||||
const { stdout } = result
|
||||
|
||||
if (stdout.lastIndexOf('{') === -1 || stdout.lastIndexOf('}') === -1) {
|
||||
buildAgent.setFailed('GitVersion output is not valid JSON', true)
|
||||
} else {
|
||||
const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)
|
||||
|
||||
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
|
||||
gitVersionTool.writeGitVersionToAgent(gitversion)
|
||||
}
|
||||
} else {
|
||||
buildAgent.setFailed(result.error.message, true)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'reflect-metadata'
|
||||
import { setup } from './main'
|
||||
|
||||
setup()
|
||||
await setup()
|
||||
|
||||
17
src/tools/common/models.ts
Normal file
17
src/tools/common/models.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export enum SetupFields {
|
||||
includePrerelease = 'includePrerelease',
|
||||
versionSpec = 'versionSpec',
|
||||
ignoreFailedSources = 'ignoreFailedSources',
|
||||
preferLatestVersion = 'preferLatestVersion'
|
||||
}
|
||||
|
||||
export interface ISetupSettings {
|
||||
[SetupFields.versionSpec]: string
|
||||
[SetupFields.includePrerelease]: boolean
|
||||
[SetupFields.ignoreFailedSources]: boolean
|
||||
[SetupFields.preferLatestVersion]: boolean
|
||||
}
|
||||
|
||||
export interface ISettingsProvider {
|
||||
getSetupSettings(): ISetupSettings
|
||||
}
|
||||
22
src/tools/common/settings.ts
Normal file
22
src/tools/common/settings.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { injectable } from 'inversify'
|
||||
import { ISettingsProvider, ISetupSettings, SetupFields } from './models'
|
||||
import { IBuildAgent } from '../../core/models'
|
||||
|
||||
@injectable()
|
||||
export class SettingsProvider implements ISettingsProvider {
|
||||
constructor(protected buildAgent: IBuildAgent) {}
|
||||
|
||||
public getSetupSettings(): ISetupSettings {
|
||||
const versionSpec = this.buildAgent.getInput(SetupFields.versionSpec)
|
||||
const includePrerelease = this.buildAgent.getBooleanInput(SetupFields.includePrerelease)
|
||||
const ignoreFailedSources = this.buildAgent.getBooleanInput(SetupFields.ignoreFailedSources)
|
||||
const preferLatestVersion = this.buildAgent.getBooleanInput(SetupFields.preferLatestVersion)
|
||||
|
||||
return {
|
||||
versionSpec,
|
||||
includePrerelease,
|
||||
ignoreFailedSources,
|
||||
preferLatestVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ISettingsProvider } from '../common/models'
|
||||
|
||||
export enum CommonFields {
|
||||
repository = 'repository',
|
||||
owner = 'owner',
|
||||
@@ -35,6 +37,22 @@ export enum AddAssetFields {
|
||||
assets = 'assets'
|
||||
}
|
||||
|
||||
export interface IGitReleaseManagerSettingsProvider extends ISettingsProvider {
|
||||
getCreateSettings(): GitReleaseManagerCreateSettings
|
||||
|
||||
getDiscardSettings(): GitReleaseManagerDiscardSettings
|
||||
|
||||
getCloseSettings(): GitReleaseManagerCloseSettings
|
||||
|
||||
getOpenSettings(): GitReleaseManagerOpenSettings
|
||||
|
||||
getPublishSettings(): GitReleaseManagerPublishSettings
|
||||
|
||||
getAddAssetSettings(): GitReleaseManagerAddAssetSettings
|
||||
|
||||
getCommonSettings(): GitReleaseManagerSettings
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerSettings {
|
||||
[CommonFields.repository]: string
|
||||
[CommonFields.owner]: string
|
||||
@@ -42,8 +60,7 @@ export interface GitReleaseManagerSettings {
|
||||
[CommonFields.targetDirectory]: string
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerCreateSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettings {
|
||||
[CreateFields.milestone]: string
|
||||
[CreateFields.name]: string
|
||||
[CreateFields.inputFileName]: string
|
||||
@@ -52,28 +69,23 @@ export interface GitReleaseManagerCreateSettings
|
||||
[CreateFields.assets]?: string[]
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerDiscardSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
|
||||
[DiscardFields.milestone]: string
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerCloseSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
|
||||
[CloseFields.milestone]: string
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerOpenSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
|
||||
[OpenFields.milestone]: string
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerPublishSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerPublishSettings extends GitReleaseManagerSettings {
|
||||
[PublishFields.tagName]: string
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerAddAssetSettings
|
||||
extends GitReleaseManagerSettings {
|
||||
export interface GitReleaseManagerAddAssetSettings extends GitReleaseManagerSettings {
|
||||
[AddAssetFields.tagName]: string
|
||||
[AddAssetFields.assets]: string[]
|
||||
}
|
||||
|
||||
@@ -1,35 +1,39 @@
|
||||
import { IBuildAgent } from '../../core/models'
|
||||
import { IBuildAgent, TYPES } from '../../core/models'
|
||||
import {
|
||||
GitReleaseManagerSettings,
|
||||
AddAssetFields,
|
||||
CloseFields,
|
||||
CommonFields,
|
||||
CreateFields,
|
||||
DiscardFields,
|
||||
CloseFields,
|
||||
OpenFields,
|
||||
PublishFields,
|
||||
AddAssetFields,
|
||||
GitReleaseManagerAddAssetSettings,
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerCreateSettings,
|
||||
GitReleaseManagerDiscardSettings,
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerOpenSettings,
|
||||
GitReleaseManagerPublishSettings,
|
||||
GitReleaseManagerAddAssetSettings
|
||||
GitReleaseManagerSettings,
|
||||
IGitReleaseManagerSettingsProvider,
|
||||
OpenFields,
|
||||
PublishFields
|
||||
} from './models'
|
||||
import { SettingsProvider } from '../common/settings'
|
||||
import { inject, injectable } from 'inversify'
|
||||
|
||||
export class Settings {
|
||||
public static getCreateSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerCreateSettings {
|
||||
const milestone = buildAgent.getInput(CreateFields.milestone)
|
||||
const name = buildAgent.getInput(CreateFields.name)
|
||||
const inputFileName = buildAgent.getInput(CreateFields.inputFileName)
|
||||
const isPreRelease = buildAgent.getBooleanInput(
|
||||
CreateFields.isPreRelease
|
||||
)
|
||||
const commit = buildAgent.getInput(CreateFields.commit)
|
||||
const assets = buildAgent.getListInput(CreateFields.assets)
|
||||
@injectable()
|
||||
export class GitReleaseManagerSettingsProvider extends SettingsProvider implements IGitReleaseManagerSettingsProvider {
|
||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
|
||||
super(buildAgent)
|
||||
}
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
getCreateSettings(): GitReleaseManagerCreateSettings {
|
||||
const milestone = this.buildAgent.getInput(CreateFields.milestone)
|
||||
const name = this.buildAgent.getInput(CreateFields.name)
|
||||
const inputFileName = this.buildAgent.getInput(CreateFields.inputFileName)
|
||||
const isPreRelease = this.buildAgent.getBooleanInput(CreateFields.isPreRelease)
|
||||
const commit = this.buildAgent.getInput(CreateFields.commit)
|
||||
const assets = this.buildAgent.getListInput(CreateFields.assets)
|
||||
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
milestone,
|
||||
@@ -41,61 +45,51 @@ export class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
public static getDiscardSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerDiscardSettings {
|
||||
const milestone = buildAgent.getInput(DiscardFields.milestone)
|
||||
getDiscardSettings(): GitReleaseManagerDiscardSettings {
|
||||
const milestone = this.buildAgent.getInput(DiscardFields.milestone)
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
milestone
|
||||
}
|
||||
}
|
||||
|
||||
public static getCloseSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerCloseSettings {
|
||||
const milestone = buildAgent.getInput(CloseFields.milestone)
|
||||
getCloseSettings(): GitReleaseManagerCloseSettings {
|
||||
const milestone = this.buildAgent.getInput(CloseFields.milestone)
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
milestone
|
||||
}
|
||||
}
|
||||
|
||||
public static getOpenSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerOpenSettings {
|
||||
const milestone = buildAgent.getInput(OpenFields.milestone)
|
||||
getOpenSettings(): GitReleaseManagerOpenSettings {
|
||||
const milestone = this.buildAgent.getInput(OpenFields.milestone)
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
milestone
|
||||
}
|
||||
}
|
||||
|
||||
public static getPublishSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerPublishSettings {
|
||||
const tagName = buildAgent.getInput(PublishFields.tagName)
|
||||
getPublishSettings(): GitReleaseManagerPublishSettings {
|
||||
const tagName = this.buildAgent.getInput(PublishFields.tagName)
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
tagName
|
||||
}
|
||||
}
|
||||
|
||||
public static getAddAssetSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerAddAssetSettings {
|
||||
const tagName = buildAgent.getInput(AddAssetFields.tagName)
|
||||
const assets = buildAgent.getListInput(AddAssetFields.assets)
|
||||
getAddAssetSettings(): GitReleaseManagerAddAssetSettings {
|
||||
const tagName = this.buildAgent.getInput(AddAssetFields.tagName)
|
||||
const assets = this.buildAgent.getListInput(AddAssetFields.assets)
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
||||
const commonSettings = this.getCommonSettings()
|
||||
return {
|
||||
...commonSettings,
|
||||
tagName,
|
||||
@@ -103,15 +97,11 @@ export class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
private static getCommonSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitReleaseManagerSettings {
|
||||
const owner = buildAgent.getInput(CommonFields.owner, true)
|
||||
const repository = buildAgent.getInput(CommonFields.repository, true)
|
||||
const token = buildAgent.getInput(CommonFields.token, true)
|
||||
const targetDirectory = buildAgent.getInput(
|
||||
CommonFields.targetDirectory
|
||||
)
|
||||
getCommonSettings(): GitReleaseManagerSettings {
|
||||
const owner = this.buildAgent.getInput(CommonFields.owner, true)
|
||||
const repository = this.buildAgent.getInput(CommonFields.repository, true)
|
||||
const token = this.buildAgent.getInput(CommonFields.token, true)
|
||||
const targetDirectory = this.buildAgent.getInput(CommonFields.targetDirectory)
|
||||
|
||||
return {
|
||||
owner,
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import path = require('path')
|
||||
import * as path from 'path'
|
||||
|
||||
import { TYPES, IBuildAgent, IExecResult, ISetupSettings } from '../../core/models'
|
||||
import { injectable, inject } from 'inversify'
|
||||
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
|
||||
import { inject, injectable } from 'inversify'
|
||||
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||
import { IVersionManager } from '../../core/versionManager'
|
||||
|
||||
import {
|
||||
GitReleaseManagerSettings,
|
||||
GitReleaseManagerAddAssetSettings,
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerCreateSettings,
|
||||
GitReleaseManagerDiscardSettings,
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerOpenSettings,
|
||||
GitReleaseManagerPublishSettings,
|
||||
GitReleaseManagerAddAssetSettings
|
||||
GitReleaseManagerSettings
|
||||
} from './models'
|
||||
import { ISetupSettings } from '../common/models'
|
||||
|
||||
export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||
install(setupSettings: ISetupSettings): Promise<void>
|
||||
@@ -26,43 +27,28 @@ export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class GitReleaseManagerTool
|
||||
extends DotnetTool
|
||||
implements IGitReleaseManagerTool {
|
||||
constructor(
|
||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||
) {
|
||||
export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseManagerTool {
|
||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||
super(buildAgent, versionManager)
|
||||
}
|
||||
|
||||
public async install(setupSettings: ISetupSettings): Promise<void> {
|
||||
await this.toolInstall(
|
||||
'GitReleaseManager.Tool',
|
||||
false,
|
||||
setupSettings
|
||||
)
|
||||
await this.toolInstall('GitReleaseManager.Tool', setupSettings)
|
||||
}
|
||||
|
||||
public create(
|
||||
settings: GitReleaseManagerCreateSettings
|
||||
): Promise<IExecResult> {
|
||||
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {
|
||||
const args = this.getCreateArguments(settings)
|
||||
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
}
|
||||
|
||||
public discard(
|
||||
settings: GitReleaseManagerDiscardSettings
|
||||
): Promise<IExecResult> {
|
||||
public discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult> {
|
||||
const args = this.getDiscardArguments(settings)
|
||||
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
}
|
||||
|
||||
public close(
|
||||
settings: GitReleaseManagerCloseSettings
|
||||
): Promise<IExecResult> {
|
||||
public close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult> {
|
||||
const args = this.getCloseArguments(settings)
|
||||
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
@@ -74,17 +60,13 @@ export class GitReleaseManagerTool
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
}
|
||||
|
||||
public publish(
|
||||
settings: GitReleaseManagerPublishSettings
|
||||
): Promise<IExecResult> {
|
||||
public publish(settings: GitReleaseManagerPublishSettings): Promise<IExecResult> {
|
||||
const args = this.getPublishArguments(settings)
|
||||
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
}
|
||||
|
||||
public addAsset(
|
||||
settings: GitReleaseManagerAddAssetSettings
|
||||
): Promise<IExecResult> {
|
||||
public addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult> {
|
||||
const args = this.getAddAssetArguments(settings)
|
||||
|
||||
return this.execute('dotnet-gitreleasemanager', args)
|
||||
@@ -104,9 +86,7 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getCreateArguments(
|
||||
settings: GitReleaseManagerCreateSettings
|
||||
): string[] {
|
||||
private getCreateArguments(settings: GitReleaseManagerCreateSettings): string[] {
|
||||
const args: string[] = ['create', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.milestone) {
|
||||
@@ -123,10 +103,7 @@ export class GitReleaseManagerTool
|
||||
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
||||
args.push('--inputFilePath', settings.inputFileName)
|
||||
} else {
|
||||
throw new Error(
|
||||
'GitReleaseManager inputFilePath not found at ' +
|
||||
settings.inputFileName
|
||||
)
|
||||
throw new Error('GitReleaseManager inputFilePath not found at ' + settings.inputFileName)
|
||||
}
|
||||
}
|
||||
if (settings.isPreRelease) {
|
||||
@@ -143,9 +120,7 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getDiscardArguments(
|
||||
settings: GitReleaseManagerDiscardSettings
|
||||
): string[] {
|
||||
private getDiscardArguments(settings: GitReleaseManagerDiscardSettings): string[] {
|
||||
const args: string[] = ['discard', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.milestone) {
|
||||
@@ -155,9 +130,7 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getCloseArguments(
|
||||
settings: GitReleaseManagerCloseSettings
|
||||
): string[] {
|
||||
private getCloseArguments(settings: GitReleaseManagerCloseSettings): string[] {
|
||||
const args: string[] = ['close', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.milestone) {
|
||||
@@ -167,9 +140,7 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getOpenArguments(
|
||||
settings: GitReleaseManagerOpenSettings
|
||||
): string[] {
|
||||
private getOpenArguments(settings: GitReleaseManagerOpenSettings): string[] {
|
||||
const args: string[] = ['open', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.milestone) {
|
||||
@@ -179,9 +150,7 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getPublishArguments(
|
||||
settings: GitReleaseManagerPublishSettings
|
||||
): string[] {
|
||||
private getPublishArguments(settings: GitReleaseManagerPublishSettings): string[] {
|
||||
const args: string[] = ['publish', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.tagName) {
|
||||
@@ -191,13 +160,8 @@ export class GitReleaseManagerTool
|
||||
return args
|
||||
}
|
||||
|
||||
private getAddAssetArguments(
|
||||
settings: GitReleaseManagerAddAssetSettings
|
||||
): string[] {
|
||||
const args: string[] = [
|
||||
'addasset',
|
||||
...this.getCommonArguments(settings)
|
||||
]
|
||||
private getAddAssetArguments(settings: GitReleaseManagerAddAssetSettings): string[] {
|
||||
const args: string[] = ['addasset', ...this.getCommonArguments(settings)]
|
||||
|
||||
if (settings.tagName) {
|
||||
args.push('--tagName', settings.tagName)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ISettingsProvider } from '../common/models'
|
||||
|
||||
export enum ExecuteFields {
|
||||
targetPath = 'targetPath',
|
||||
useConfigFile = 'useConfigFile',
|
||||
@@ -18,6 +20,10 @@ export interface GitVersionSettings {
|
||||
[ExecuteFields.srcDir]: string
|
||||
}
|
||||
|
||||
export interface IGitVersionSettingsProvider extends ISettingsProvider {
|
||||
getGitVersionSettings(): GitVersionSettings
|
||||
}
|
||||
|
||||
export interface GitVersionOutput {
|
||||
Major: number
|
||||
Minor: number
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
import { IBuildAgent } from '../../core/models'
|
||||
import { IBuildAgent, TYPES } from '../../core/models'
|
||||
|
||||
import { GitVersionSettings, ExecuteFields } from './models'
|
||||
import { ExecuteFields, GitVersionSettings, IGitVersionSettingsProvider } from './models'
|
||||
import { SettingsProvider } from '../common/settings'
|
||||
import { inject, injectable } from 'inversify'
|
||||
|
||||
export class Settings {
|
||||
public static getGitVersionSettings(
|
||||
buildAgent: IBuildAgent
|
||||
): GitVersionSettings {
|
||||
const targetPath = buildAgent.getInput(ExecuteFields.targetPath)
|
||||
@injectable()
|
||||
export class GitVersionSettingsProvider extends SettingsProvider implements IGitVersionSettingsProvider {
|
||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
|
||||
super(buildAgent)
|
||||
}
|
||||
|
||||
const useConfigFile = buildAgent.getBooleanInput(
|
||||
ExecuteFields.useConfigFile
|
||||
)
|
||||
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath)
|
||||
public getGitVersionSettings(): GitVersionSettings {
|
||||
const targetPath = this.buildAgent.getInput(ExecuteFields.targetPath)
|
||||
|
||||
const updateAssemblyInfo = buildAgent.getBooleanInput(
|
||||
ExecuteFields.updateAssemblyInfo
|
||||
)
|
||||
const updateAssemblyInfoFilename = buildAgent.getInput(
|
||||
ExecuteFields.updateAssemblyInfoFilename
|
||||
)
|
||||
const useConfigFile = this.buildAgent.getBooleanInput(ExecuteFields.useConfigFile)
|
||||
const configFilePath = this.buildAgent.getInput(ExecuteFields.configFilePath)
|
||||
|
||||
const additionalArguments = buildAgent.getInput(
|
||||
ExecuteFields.additionalArguments
|
||||
)
|
||||
const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo)
|
||||
const updateAssemblyInfoFilename = this.buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename)
|
||||
|
||||
const srcDir = buildAgent.getSourceDir()?.replace(/\\/g, '/')
|
||||
const additionalArguments = this.buildAgent.getInput(ExecuteFields.additionalArguments)
|
||||
|
||||
const srcDir = this.buildAgent.getSourceDir()?.replace(/\\/g, '/')
|
||||
|
||||
return {
|
||||
targetPath,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import path = require('path')
|
||||
|
||||
import { injectable, inject } from 'inversify'
|
||||
import { IExecResult, IBuildAgent, TYPES, ISetupSettings } from '../../core/models'
|
||||
import { inject, injectable } from 'inversify'
|
||||
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
|
||||
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||
import { GitVersionSettings, GitVersionOutput } from './models'
|
||||
import { GitVersionOutput, GitVersionSettings } from './models'
|
||||
import { IVersionManager } from '../../core/versionManager'
|
||||
import { ISetupSettings } from '../common/models'
|
||||
|
||||
export interface IGitVersionTool extends IDotnetTool {
|
||||
install(setupSettings: ISetupSettings): Promise<void>
|
||||
@@ -14,19 +13,12 @@ export interface IGitVersionTool extends IDotnetTool {
|
||||
|
||||
@injectable()
|
||||
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
constructor(
|
||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
||||
) {
|
||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||
super(buildAgent, versionManager)
|
||||
}
|
||||
|
||||
public async install(setupSettings: ISetupSettings): Promise<void> {
|
||||
await this.toolInstall(
|
||||
'GitVersion.Tool',
|
||||
false,
|
||||
setupSettings
|
||||
)
|
||||
await this.toolInstall('GitVersion.Tool', setupSettings)
|
||||
}
|
||||
|
||||
public run(options: GitVersionSettings): Promise<IExecResult> {
|
||||
@@ -52,33 +44,16 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
return workDir.replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
private getArguments(
|
||||
workDir: string,
|
||||
options: GitVersionSettings
|
||||
): string[] {
|
||||
private getArguments(workDir: string, options: GitVersionSettings): string[] {
|
||||
let args = [workDir, '/output', 'json', '/output', 'buildserver']
|
||||
|
||||
const {
|
||||
useConfigFile,
|
||||
configFilePath,
|
||||
updateAssemblyInfo,
|
||||
updateAssemblyInfoFilename,
|
||||
additionalArguments
|
||||
} = options
|
||||
const { useConfigFile, configFilePath, updateAssemblyInfo, updateAssemblyInfoFilename, additionalArguments } = options
|
||||
|
||||
if (useConfigFile) {
|
||||
if (
|
||||
this.buildAgent.isValidInputFile(
|
||||
'configFilePath',
|
||||
configFilePath
|
||||
)
|
||||
) {
|
||||
if (this.buildAgent.isValidInputFile('configFilePath', configFilePath)) {
|
||||
args.push('/config', configFilePath)
|
||||
} else {
|
||||
throw new Error(
|
||||
'GitVersion configuration file not found at ' +
|
||||
configFilePath
|
||||
)
|
||||
throw new Error('GitVersion configuration file not found at ' + configFilePath)
|
||||
}
|
||||
}
|
||||
if (updateAssemblyInfo) {
|
||||
@@ -86,18 +61,10 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
|
||||
// You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.
|
||||
if (updateAssemblyInfoFilename?.length > 0) {
|
||||
if (
|
||||
this.buildAgent.isValidInputFile(
|
||||
'updateAssemblyInfoFilename',
|
||||
updateAssemblyInfoFilename
|
||||
)
|
||||
) {
|
||||
if (this.buildAgent.isValidInputFile('updateAssemblyInfoFilename', updateAssemblyInfoFilename)) {
|
||||
args.push(updateAssemblyInfoFilename)
|
||||
} else {
|
||||
throw new Error(
|
||||
'AssemblyInfoFilename file not found at ' +
|
||||
updateAssemblyInfoFilename
|
||||
)
|
||||
throw new Error('AssemblyInfoFilename file not found at ' + updateAssemblyInfoFilename)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,6 +83,9 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
const name = this.toCamelCase(property)
|
||||
const value = gitversionOutput[property]
|
||||
this.buildAgent.setOutput(name, value)
|
||||
this.buildAgent.setOutput(`GitVersion_${name}`, value)
|
||||
this.buildAgent.setVariable(name, value)
|
||||
this.buildAgent.setVariable(`GitVersion_${name}`, value)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -182,12 +152,9 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
}
|
||||
|
||||
private toCamelCase(input: string): string {
|
||||
return input.replace(
|
||||
/(?:^\w|[A-Z]|\b\w|\s+)/g,
|
||||
function (match, index) {
|
||||
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
||||
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
||||
}
|
||||
)
|
||||
return input.replace(/^\w|[A-Z]|\b\w|\s+/g, function (match, index) {
|
||||
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
||||
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "node",
|
||||
"target": "ES2016",
|
||||
"target": "es2017",
|
||||
"noImplicitAny": true,
|
||||
"sourceMap": true,
|
||||
"lib": ["ES2016"],
|
||||
"types": ["reflect-metadata"],
|
||||
"esModuleInterop":true,
|
||||
"lib": [ "ES2016" ],
|
||||
"types": [ "reflect-metadata" ],
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ function getConfig(mode, agent, entry) {
|
||||
entry: entry,
|
||||
target: 'node',
|
||||
mode: mode,
|
||||
devtool: mode == 'development' ? 'inline-source-map' : false,
|
||||
devtool: mode === 'development' ? 'inline-source-map' : false,
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.tsx?$/,
|
||||
@@ -43,7 +43,10 @@ function getConfig(mode, agent, entry) {
|
||||
replace: 'let pkg = { version: "1.2.3" };'
|
||||
}]
|
||||
}])
|
||||
]
|
||||
],
|
||||
experiments: {
|
||||
topLevelAwait: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,12 +65,12 @@ const entryPoints = [
|
||||
module.exports = (env) => {
|
||||
const task = env.task || 'compile';
|
||||
const agent = env.agent || 'mock';
|
||||
const mode = task == 'compile' ? 'development' : 'production';
|
||||
const mode = task === 'compile' ? 'development' : 'production';
|
||||
const entry = {};
|
||||
entryPoints.forEach(key => {
|
||||
const resource = task == 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
|
||||
const resource = task === 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
|
||||
entry[key] = path.resolve(__dirname, resource);
|
||||
});
|
||||
|
||||
return getConfig(mode, agent, entry);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user