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
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
max_line_length = off
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
37
.github/workflows/ci.yml
vendored
37
.github/workflows/ci.yml
vendored
@@ -8,6 +8,10 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
@@ -17,22 +21,47 @@ jobs:
|
|||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
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
|
- name: Fetch all history for all tags and branches
|
||||||
run: |
|
run: |
|
||||||
git fetch --prune --unshallow
|
git fetch --prune --unshallow
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
- run: |
|
- run: |
|
||||||
npm install
|
npm install
|
||||||
npm run format-check
|
npm run format-check
|
||||||
npm run build:github
|
npm run build:github
|
||||||
npm run build:azure
|
npm run build:azure
|
||||||
name: Build code
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: gitversion/setup
|
||||||
uses: ./gitversion/setup
|
uses: ./gitversion/setup
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.x'
|
versionSpec: '5.x'
|
||||||
- name: Use GitVersion
|
- name: gitversion/execute
|
||||||
id: gitversion # step id used as reference for output values
|
id: gitversion # step id used as reference for output values
|
||||||
uses: ./gitversion/execute
|
uses: ./gitversion/execute
|
||||||
- run: |
|
- 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:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
@@ -11,7 +15,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
run: |
|
run: |
|
||||||
git fetch --prune --unshallow
|
git fetch --prune --unshallow
|
||||||
@@ -37,11 +41,10 @@ jobs:
|
|||||||
$minor = "${{steps.gitversion.outputs.minor}}"
|
$minor = "${{steps.gitversion.outputs.minor}}"
|
||||||
$patch = "${{steps.gitversion.outputs.patch}}"
|
$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
|
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
|
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
|
||||||
|
|
||||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||||
|
|
||||||
shell: pwsh
|
|
||||||
name: Publish Azure extension
|
name: Publish Azure extension
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,3 +4,6 @@ node_modules/
|
|||||||
*.js
|
*.js
|
||||||
!dist/**/*.js
|
!dist/**/*.js
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
/dist/mock/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"printWidth": 80,
|
"printWidth": 160,
|
||||||
"tabWidth": 4,
|
"tabWidth": 4,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"semi": 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
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: dist/github/setup/index.js
|
main: dist/github/setup/index.js
|
||||||
|
|||||||
16469
dist/azure/gitreleasemanager/addasset/bundle.js
vendored
16469
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/addasset",
|
"instanceNameFormat": "gitreleasemanager/addasset",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "tagName",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The name of the release",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": true,
|
"name": "tagName",
|
||||||
"helpMarkDown": "The name of the release"
|
"type": "string",
|
||||||
}, {
|
"label": "The name of the release",
|
||||||
"name": "assets",
|
"defaultValue": "",
|
||||||
"type": "multiLine",
|
"required": true,
|
||||||
"label": "Path(s) to the file(s) to include in the release",
|
"helpMarkDown": "The name of the release"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
|
"name": "assets",
|
||||||
}, {
|
"type": "multiLine",
|
||||||
"name": "targetDirectory",
|
"label": "Path(s) to the file(s) to include in the release",
|
||||||
"type": "string",
|
"defaultValue": "",
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"required": false,
|
||||||
"defaultValue": "",
|
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
|
||||||
"required": false,
|
},
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
{
|
||||||
}]
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16469
dist/azure/gitreleasemanager/close/bundle.js
vendored
16469
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/close",
|
"instanceNameFormat": "gitreleasemanager/close",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "milestone",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The milestone to use",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": true,
|
"name": "milestone",
|
||||||
"helpMarkDown": "The milestone to use"
|
"type": "string",
|
||||||
}, {
|
"label": "The milestone to use",
|
||||||
"name": "targetDirectory",
|
"defaultValue": "",
|
||||||
"type": "string",
|
"required": true,
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"helpMarkDown": "The milestone to use"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16469
dist/azure/gitreleasemanager/create/bundle.js
vendored
16469
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/create",
|
"instanceNameFormat": "gitreleasemanager/create",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "milestone",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The milestone to use",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": false,
|
"name": "milestone",
|
||||||
"helpMarkDown": "The milestone to use"
|
"type": "string",
|
||||||
}, {
|
"label": "The milestone to use",
|
||||||
"name": "name",
|
"defaultValue": "",
|
||||||
"type": "string",
|
"required": false,
|
||||||
"label": "The name of the release",
|
"helpMarkDown": "The milestone to use"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "The name of the release"
|
"name": "name",
|
||||||
}, {
|
"type": "string",
|
||||||
"name": "inputFilePath",
|
"label": "The name of the release",
|
||||||
"type": "string",
|
"defaultValue": "",
|
||||||
"label": "The path to the file to be used as the content of the release notes",
|
"required": false,
|
||||||
"defaultValue": "",
|
"helpMarkDown": "The name of the release"
|
||||||
"required": false,
|
},
|
||||||
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
{
|
||||||
}, {
|
"name": "inputFilePath",
|
||||||
"name": "isPreRelease",
|
"type": "string",
|
||||||
"type": "boolean",
|
"label": "The path to the file to be used as the content of the release notes",
|
||||||
"label": "Creates the release as a pre-release",
|
"defaultValue": "",
|
||||||
"defaultValue": "false",
|
"required": false,
|
||||||
"required": false,
|
"helpMarkDown": "The path to the file to be used as the content of the release notes"
|
||||||
"helpMarkDown": "Creates the release as a pre-release"
|
},
|
||||||
}, {
|
{
|
||||||
"name": "targetcommitish",
|
"name": "isPreRelease",
|
||||||
"type": "string",
|
"type": "boolean",
|
||||||
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
|
"label": "Creates the release as a pre-release",
|
||||||
"defaultValue": "",
|
"defaultValue": "false",
|
||||||
"required": false,
|
"required": false,
|
||||||
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
|
"helpMarkDown": "Creates the release as a pre-release"
|
||||||
}, {
|
},
|
||||||
"name": "targetDirectory",
|
{
|
||||||
"type": "string",
|
"name": "targetcommitish",
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
|
||||||
"required": false,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
"required": false,
|
||||||
}, {
|
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
|
||||||
"name": "assets",
|
},
|
||||||
"type": "multiLine",
|
{
|
||||||
"label": "Path(s) to the file(s) to include in the release",
|
"name": "targetDirectory",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": false,
|
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
||||||
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16469
dist/azure/gitreleasemanager/discard/bundle.js
vendored
16469
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/discard",
|
"instanceNameFormat": "gitreleasemanager/discard",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "milestone",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The milestone to use",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": true,
|
"name": "milestone",
|
||||||
"helpMarkDown": "The milestone to use"
|
"type": "string",
|
||||||
}, {
|
"label": "The milestone to use",
|
||||||
"name": "targetDirectory",
|
"defaultValue": "",
|
||||||
"type": "string",
|
"required": true,
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"helpMarkDown": "The milestone to use"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16459
dist/azure/gitreleasemanager/open/bundle.js
vendored
16459
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/open",
|
"instanceNameFormat": "gitreleasemanager/open",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "milestone",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The milestone to use",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": true,
|
"name": "milestone",
|
||||||
"helpMarkDown": "The milestone to use"
|
"type": "string",
|
||||||
}, {
|
"label": "The milestone to use",
|
||||||
"name": "targetDirectory",
|
"defaultValue": "",
|
||||||
"type": "string",
|
"required": true,
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"helpMarkDown": "The milestone to use"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16459
dist/azure/gitreleasemanager/publish/bundle.js
vendored
16459
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/publish",
|
"instanceNameFormat": "gitreleasemanager/publish",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
"name": "owner",
|
{
|
||||||
"type": "string",
|
"name": "owner",
|
||||||
"label": "The owner of the repository",
|
"type": "string",
|
||||||
"defaultValue": "",
|
"label": "The owner of the repository",
|
||||||
"required": true,
|
"defaultValue": "",
|
||||||
"helpMarkDown": "The owner of the repository"
|
"required": true,
|
||||||
}, {
|
"helpMarkDown": "The owner of the repository"
|
||||||
"name": "repository",
|
},
|
||||||
"type": "string",
|
{
|
||||||
"label": "The name of the repository",
|
"name": "repository",
|
||||||
"defaultValue": "",
|
"type": "string",
|
||||||
"required": true,
|
"label": "The name of the repository",
|
||||||
"helpMarkDown": "The name of the repository"
|
"defaultValue": "",
|
||||||
}, {
|
"required": true,
|
||||||
"name": "token",
|
"helpMarkDown": "The name of the repository"
|
||||||
"type": "string",
|
},
|
||||||
"label": "The access token to access GitHub with",
|
{
|
||||||
"defaultValue": "",
|
"name": "token",
|
||||||
"required": true,
|
"type": "string",
|
||||||
"helpMarkDown": "The access token to access GitHub with"
|
"label": "The access token to access GitHub with",
|
||||||
}, {
|
"defaultValue": "",
|
||||||
"name": "tagName",
|
"required": true,
|
||||||
"type": "string",
|
"helpMarkDown": "The access token to access GitHub with"
|
||||||
"label": "The name of the release",
|
},
|
||||||
"defaultValue": "",
|
{
|
||||||
"required": true,
|
"name": "tagName",
|
||||||
"helpMarkDown": "The name of the release"
|
"type": "string",
|
||||||
}, {
|
"label": "The name of the release",
|
||||||
"name": "targetDirectory",
|
"defaultValue": "",
|
||||||
"type": "string",
|
"required": true,
|
||||||
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
|
"helpMarkDown": "The name of the release"
|
||||||
"defaultValue": "",
|
},
|
||||||
"required": false,
|
{
|
||||||
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16459
dist/azure/gitreleasemanager/setup/bundle.js
vendored
16459
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",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitreleasemanager/setup",
|
"instanceNameFormat": "gitreleasemanager/setup",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
|
{
|
||||||
"name": "versionSpec",
|
"name": "versionSpec",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"label": "The version spec",
|
"label": "The version spec",
|
||||||
@@ -44,6 +50,14 @@
|
|||||||
"defaultValue": "false",
|
"defaultValue": "false",
|
||||||
"required": false,
|
"required": false,
|
||||||
"helpMarkDown": "Treat package source failures as warnings"
|
"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."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
16283
dist/azure/gitversion/execute/bundle.js
vendored
16283
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",
|
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
|
||||||
"name": "gitversion/execute",
|
"name": "gitversion/execute",
|
||||||
"friendlyName": "Execute GitVersion Task",
|
"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",
|
"author": "GitTools Contributors",
|
||||||
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||||
"category": "Build",
|
"category": "Build",
|
||||||
@@ -12,16 +12,22 @@
|
|||||||
"Minor": "0",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitversion/execute",
|
"instanceNameFormat": "gitversion/execute",
|
||||||
"groups": [{
|
"groups": [
|
||||||
|
{
|
||||||
"name": "gitversionDetails",
|
"name": "gitversionDetails",
|
||||||
"displayName": "GitVersion details",
|
"displayName": "GitVersion details",
|
||||||
"isExpanded": true
|
"isExpanded": true
|
||||||
@@ -32,7 +38,8 @@
|
|||||||
"isExpanded": false
|
"isExpanded": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
|
{
|
||||||
"name": "targetPath",
|
"name": "targetPath",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"label": "Working directory path",
|
"label": "Working directory path",
|
||||||
|
|||||||
16283
dist/azure/gitversion/setup/bundle.js
vendored
16283
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",
|
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
|
||||||
"name": "gitversion/setup",
|
"name": "gitversion/setup",
|
||||||
"friendlyName": "Setup GitVersion Task",
|
"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",
|
"author": "GitTools Contributors",
|
||||||
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||||
"category": "Build",
|
"category": "Build",
|
||||||
@@ -12,16 +12,22 @@
|
|||||||
"Minor": "0",
|
"Minor": "0",
|
||||||
"Patch": "0"
|
"Patch": "0"
|
||||||
},
|
},
|
||||||
"minimumAgentVersion": "2.115.0",
|
"minimumAgentVersion": "2.220.0",
|
||||||
"execution": {
|
"execution": {
|
||||||
"Node10": {
|
"Node10": {
|
||||||
"target": "bundle.js",
|
"target": "bundle.js",
|
||||||
"argumentFormat": "",
|
"argumentFormat": "",
|
||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
|
},
|
||||||
|
"Node20": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitversion/setup",
|
"instanceNameFormat": "gitversion/setup",
|
||||||
"inputs": [{
|
"inputs": [
|
||||||
|
{
|
||||||
"name": "versionSpec",
|
"name": "versionSpec",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"label": "The version spec",
|
"label": "The version spec",
|
||||||
@@ -44,6 +50,14 @@
|
|||||||
"defaultValue": "false",
|
"defaultValue": "false",
|
||||||
"required": false,
|
"required": false,
|
||||||
"helpMarkDown": "Treat package source failures as warnings"
|
"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."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
8
dist/azure/update-version.ps1
vendored
8
dist/azure/update-version.ps1
vendored
@@ -17,9 +17,9 @@ function update-task() {
|
|||||||
$patch
|
$patch
|
||||||
)
|
)
|
||||||
$file = Resolve-Path $file
|
$file = Resolve-Path $file
|
||||||
$jqMajor = '.version.Major=\"' + $major +'\"';
|
$jqMajor = '.version.Major="' + $major +'"';
|
||||||
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
$jqMinor = '.version.Minor="' + $minor +'"';
|
||||||
$jqPatch = '.version.Patch=\"' + $patch +'\"';
|
$jqPatch = '.version.Patch="' + $patch +'"';
|
||||||
Write-Host "Update task from $file to version $major.$minor.$patch"
|
Write-Host "Update task from $file to version $major.$minor.$patch"
|
||||||
|
|
||||||
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
|
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
|
||||||
@@ -36,7 +36,7 @@ function update-manifest() {
|
|||||||
$version
|
$version
|
||||||
)
|
)
|
||||||
$file = Resolve-Path $file
|
$file = Resolve-Path $file
|
||||||
$jqVersion = '.version=\"' + $version +'\"';
|
$jqVersion = '.version="' + $version +'"';
|
||||||
Write-Host "Update manifest version to $version"
|
Write-Host "Update manifest version to $version"
|
||||||
|
|
||||||
Get-Content $file | jq $jqVersion | Set-Content $file
|
Get-Content $file | jq $jqVersion | Set-Content $file
|
||||||
|
|||||||
9614
dist/github/gitreleasemanager/addasset/bundle.js
vendored
9614
dist/github/gitreleasemanager/addasset/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/close/bundle.js
vendored
9614
dist/github/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/create/bundle.js
vendored
9614
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/discard/bundle.js
vendored
9614
dist/github/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/open/bundle.js
vendored
9614
dist/github/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/publish/bundle.js
vendored
9614
dist/github/gitreleasemanager/publish/bundle.js
vendored
File diff suppressed because one or more lines are too long
9614
dist/github/gitreleasemanager/setup/bundle.js
vendored
9614
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
9428
dist/github/gitversion/execute/bundle.js
vendored
9428
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
9428
dist/github/gitversion/setup/bundle.js
vendored
9428
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
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- task: gitreleasemanager/close@0
|
- task: gitreleasemanager/close@0
|
||||||
inputs:
|
inputs:
|
||||||
token: '$(GITHUB_TOKEN)'
|
token: '$(GITHUB_TOKEN)'
|
||||||
owner: 'someOwner'
|
owner: 'someOwner'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- task: gitreleasemanager/open@0
|
- task: gitreleasemanager/open@0
|
||||||
inputs:
|
inputs:
|
||||||
token: '$(GITHUB_TOKEN)'
|
token: '$(GITHUB_TOKEN)'
|
||||||
owner: 'someOwner'
|
owner: 'someOwner'
|
||||||
|
|||||||
@@ -46,42 +46,44 @@ additionalArguments:
|
|||||||
|
|
||||||
The Execute GitVersion task creates the following job-scoped variables and multi-job output variables:
|
The Execute GitVersion task creates the following job-scoped variables and multi-job output variables:
|
||||||
|
|
||||||
- GitVersion.Major
|
- major
|
||||||
- GitVersion.Minor
|
- minor
|
||||||
- GitVersion.Patch
|
- patch
|
||||||
- GitVersion.PreReleaseTag
|
- preReleaseTag
|
||||||
- GitVersion.PreReleaseTagWithDash
|
- preReleaseTagWithDash
|
||||||
- GitVersion.PreReleaseLabel
|
- preReleaseLabel
|
||||||
- GitVersion.PreReleaseNumber
|
- preReleaseNumber
|
||||||
- GitVersion.WeightedPreReleaseNumber
|
- weightedPreReleaseNumber
|
||||||
- GitVersion.BuildMetaData
|
- buildMetaData
|
||||||
- GitVersion.BuildMetaDataPadded
|
- buildMetaDataPadded (removed in 6.0.0)
|
||||||
- GitVersion.FullBuildMetaData
|
- fullBuildMetaData
|
||||||
- GitVersion.MajorMinorPatch
|
- majorMinorPatch
|
||||||
- GitVersion.SemVer
|
- semVer
|
||||||
- GitVersion.LegacySemVer
|
- legacySemVer (removed in 6.0.0)
|
||||||
- GitVersion.LegacySemVerPadded
|
- legacySemVerPadded (removed in 6.0.0)
|
||||||
- GitVersion.AssemblySemVer
|
- assemblySemVer
|
||||||
- GitVersion.AssemblySemFileVer
|
- assemblySemFileVer
|
||||||
- GitVersion.FullSemVer
|
- fullSemVer
|
||||||
- GitVersion.InformationalVersion
|
- informationalVersion
|
||||||
- GitVersion.BranchName
|
- branchName
|
||||||
- GitVersion.EscapedBranchName (since 5.2.0)
|
- escapedBranchName (since 5.2.0)
|
||||||
- GitVersion.Sha
|
- sha
|
||||||
- GitVersion.ShortSha
|
- shortSha
|
||||||
- GitVersion.NuGetVersionV2
|
- nuGetVersionV2 (removed in 6.0.0)
|
||||||
- GitVersion.NuGetVersion
|
- nuGetVersion (removed in 6.0.0)
|
||||||
- GitVersion.NuGetPreReleaseTagV2
|
- nuGetPreReleaseTagV2 (removed in 6.0.0)
|
||||||
- GitVersion.NuGetPreReleaseTag
|
- nuGetPreReleaseTag (removed in 6.0.0)
|
||||||
- GitVersion.VersionSourceSha
|
- versionSourceSha
|
||||||
- GitVersion.CommitsSinceVersionSource
|
- commitsSinceVersionSource
|
||||||
- GitVersion.CommitsSinceVersionSourcePadded (since 5.2.0)
|
- commitsSinceVersionSourcePadded (since 5.2.0, removed in 6.0.0)
|
||||||
- GitVersion.UncommittedChanges (since 5.5.0)
|
- uncommittedChanges (since 5.5.0)
|
||||||
- GitVersion.CommitDate
|
- 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`.**
|
**GitVersion also automatically updates the pre-defined Build variable `Build.BuildNumber`.**
|
||||||
|
|
||||||
@@ -164,41 +166,78 @@ steps:
|
|||||||
# gitversion/setup@0 task omitted for brevity.
|
# gitversion/setup@0 task omitted for brevity.
|
||||||
|
|
||||||
- task: gitversion/execute@0
|
- task: gitversion/execute@0
|
||||||
|
name: version # id to later be referenced
|
||||||
displayName: Determine Version
|
displayName: Determine Version
|
||||||
|
|
||||||
- script: |
|
- displayName: Display GitVersion outputs (step output)
|
||||||
echo Major: $(GitVersion.Major)
|
script: |
|
||||||
echo Minor: $(GitVersion.Minor)
|
echo "Major: $(version.major)"
|
||||||
echo Patch: $(GitVersion.Patch)
|
echo "Minor: $(version.minor)"
|
||||||
echo PreReleaseTag: $(GitVersion.PreReleaseTag)
|
echo "Patch: $(version.patch)"
|
||||||
echo PreReleaseTagWithDash: $(GitVersion.PreReleaseTagWithDash)
|
echo "PreReleaseTag: $(version.preReleaseTag)"
|
||||||
echo PreReleaseLabel: $(GitVersion.PreReleaseLabel)
|
echo "PreReleaseTagWithDash: $(version.preReleaseTagWithDash)"
|
||||||
echo PreReleaseNumber: $(GitVersion.PreReleaseNumber)
|
echo "PreReleaseLabel: $(version.preReleaseLabel)"
|
||||||
echo WeightedPreReleaseNumber: $(GitVersion.WeightedPreReleaseNumber)
|
echo "PreReleaseNumber: $(version.preReleaseNumber)"
|
||||||
echo BuildMetaData: $(GitVersion.BuildMetaData)
|
echo "WeightedPreReleaseNumber: $(version.weightedPreReleaseNumber)"
|
||||||
echo BuildMetaDataPadded: $(GitVersion.BuildMetaDataPadded)
|
echo "BuildMetaData: $(version.buildMetaData)"
|
||||||
echo FullBuildMetaData: $(GitVersion.FullBuildMetaData)
|
echo "BuildMetaDataPadded: $(version.buildMetaDataPadded)"
|
||||||
echo MajorMinorPatch: $(GitVersion.MajorMinorPatch)
|
echo "FullBuildMetaData: $(version.fullBuildMetaData)"
|
||||||
echo SemVer: $(GitVersion.SemVer)
|
echo "MajorMinorPatch: $(version.majorMinorPatch)"
|
||||||
echo LegacySemVer: $(GitVersion.LegacySemVer)
|
echo "SemVer: $(version.semVer)"
|
||||||
echo LegacySemVerPadded: $(GitVersion.LegacySemVerPadded)
|
echo "LegacySemVer: $(version.legacySemVer)"
|
||||||
echo AssemblySemVer: $(GitVersion.AssemblySemVer)
|
echo "LegacySemVerPadded: $(version.legacySemVerPadded)"
|
||||||
echo AssemblySemFileVer: $(GitVersion.AssemblySemFileVer)
|
echo "AssemblySemVer: $(version.assemblySemVer)"
|
||||||
echo FullSemVer: $(GitVersion.FullSemVer)
|
echo "AssemblySemFileVer: $(version.assemblySemFileVer)"
|
||||||
echo InformationalVersion: $(GitVersion.InformationalVersion)
|
echo "FullSemVer: $(version.fullSemVer)"
|
||||||
echo BranchName: $(GitVersion.BranchName)
|
echo "InformationalVersion: $(version.informationalVersion)"
|
||||||
echo EscapedBranchName: $(GitVersion.EscapedBranchName)
|
echo "BranchName: $(version.branchName)"
|
||||||
echo Sha: $(GitVersion.Sha)
|
echo "EscapedBranchName: $(version.escapedBranchName)"
|
||||||
echo ShortSha: $(GitVersion.ShortSha)
|
echo "Sha: $(version.sha)"
|
||||||
echo NuGetVersionV2: $(GitVersion.NuGetVersionV2)
|
echo "ShortSha: $(version.shortSha)"
|
||||||
echo NuGetVersion: $(GitVersion.NuGetVersion)
|
echo "NuGetVersionV2: $(version.nuGetVersionV2)"
|
||||||
echo NuGetPreReleaseTagV2: $(GitVersion.NuGetPreReleaseTagV2)
|
echo "NuGetVersion: $(version.nuGetVersion)"
|
||||||
echo NuGetPreReleaseTag: $(GitVersion.NuGetPreReleaseTag)
|
echo "NuGetPreReleaseTagV2: $(version.nuGetPreReleaseTagV2)"
|
||||||
echo VersionSourceSha: $(GitVersion.VersionSourceSha)
|
echo "NuGetPreReleaseTag: $(version.nuGetPreReleaseTag)"
|
||||||
echo CommitsSinceVersionSource: $(GitVersion.CommitsSinceVersionSource)
|
echo "VersionSourceSha: $(version.versionSourceSha)"
|
||||||
echo CommitsSinceVersionSourcePadded: $(GitVersion.CommitsSinceVersionSourcePadded)
|
echo "CommitsSinceVersionSource: $(version.commitsSinceVersionSource)"
|
||||||
echo UncommittedChanges: $(GitVersion.UncommittedChanges)
|
echo "CommitsSinceVersionSourcePadded: $(version.commitsSinceVersionSourcePadded)"
|
||||||
echo CommitDate: $(GitVersion.CommitDate)
|
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
|
### Example 6
|
||||||
@@ -212,51 +251,123 @@ steps:
|
|||||||
- task: gitversion/execute@0
|
- task: gitversion/execute@0
|
||||||
displayName: Determine Version
|
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
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Pack Example
|
displayName: Pack Example
|
||||||
inputs:
|
inputs:
|
||||||
command: pack
|
command: pack
|
||||||
packagesToPack: src/Example/LibExample.csproj
|
packagesToPack: src/Example/LibExample.csproj
|
||||||
versioningScheme: byEnvVar
|
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
|
### 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
|
```yaml
|
||||||
job: CalculateVersion
|
jobs:
|
||||||
displayName: Calculate version using GitVersion
|
- job: CalculateVersion
|
||||||
steps:
|
displayName: Calculate version using GitVersion
|
||||||
# gitversion/setup@0 task omitted for brevity.
|
steps:
|
||||||
|
# gitversion/setup@0 task omitted for brevity.
|
||||||
|
|
||||||
- task: gitversion/execute@0
|
- task: gitversion/execute@0
|
||||||
displayName: Use GitVersion
|
displayName: Use GitVersion
|
||||||
name: Version # the step MUST be named to access its output variables in another job.
|
name: Version # the step MUST be named to access its output variables in another job.
|
||||||
|
|
||||||
job: CreateReleaseNotes
|
- job: CreateReleaseNotes
|
||||||
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion.BranchName'], 'main'))
|
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion_BranchName'], 'main'))
|
||||||
dependsOn: CalculateVersion
|
dependsOn: CalculateVersion
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 8
|
### 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
|
```yaml
|
||||||
job: CalculateVersion
|
jobs:
|
||||||
displayName: Calculate version using GitVersion
|
- job: CalculateVersion
|
||||||
steps:
|
displayName: Calculate version using GitVersion
|
||||||
# gitversion/setup@0 task omitted for brevity.
|
steps:
|
||||||
|
# gitversion/setup@0 task omitted for brevity.
|
||||||
|
|
||||||
- task: gitversion/execute@0
|
- task: gitversion/execute@0
|
||||||
displayName: Use GitVersion
|
displayName: Use GitVersion
|
||||||
name: Version # the step MUST be named to access its output variables in another job.
|
name: Version # the step MUST be named to access its output variables in another job.
|
||||||
|
|
||||||
job: BuildAndPack
|
- job: BuildAndPack
|
||||||
variables:
|
variables:
|
||||||
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion.MajorMinorPatch'] ]
|
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion_MajorMinorPatch'] ]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 9
|
### Example 9
|
||||||
@@ -277,7 +388,7 @@ stages:
|
|||||||
name: Version # the step MUST be named to access its output variables in another stage.
|
name: Version # the step MUST be named to access its output variables in another stage.
|
||||||
|
|
||||||
- stage: S2
|
- 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
|
dependsOn: S1
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -302,5 +413,5 @@ stages:
|
|||||||
jobs:
|
jobs:
|
||||||
- job: UpdateAssemblyVersions
|
- job: UpdateAssemblyVersions
|
||||||
variables:
|
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.
|
description: Treat package source failures as warnings.
|
||||||
required: false
|
required: false
|
||||||
default: 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
|
## 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
|
### Example 1
|
||||||
|
|
||||||
Install the latest GitVersion 5 version.
|
Install the latest GitVersion 5 version.
|
||||||
@@ -63,3 +75,16 @@ steps:
|
|||||||
versionSpec: '6.x'
|
versionSpec: '6.x'
|
||||||
includePrerelease: true
|
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
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/addasset@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/addasset@v0
|
||||||
name: Add asset to a release with GitReleaseManager
|
name: Add asset to a release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/close@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/close@v0
|
||||||
name: Close release with GitReleaseManager
|
name: Close release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/create@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/create@0
|
||||||
name: Create release with GitReleaseManager
|
name: Create release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/discard@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/discard@v0
|
||||||
name: Discard release with GitReleaseManager
|
name: Discard release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/open@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/open@v0
|
||||||
name: Open release with GitReleaseManager
|
name: Open release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/publish@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/publish@v0
|
||||||
name: Publish release with GitReleaseManager
|
name: Publish release with GitReleaseManager
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: gittools/actions/gitreleasemanager/setup@v0.9.2
|
- uses: gittools/actions/gitreleasemanager/setup@v0
|
||||||
name: Install GitReleaseManager
|
name: Install GitReleaseManager
|
||||||
with:
|
with:
|
||||||
versionSpec: '0.10.x'
|
versionSpec: '0.10.x'
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ The Execute GitVersion action creates the following outputs:
|
|||||||
- preReleaseNumber
|
- preReleaseNumber
|
||||||
- weightedPreReleaseNumber
|
- weightedPreReleaseNumber
|
||||||
- buildMetaData
|
- buildMetaData
|
||||||
- buildMetaDataPadded
|
- buildMetaDataPadded (removed in 6.0.0)
|
||||||
- fullBuildMetaData
|
- fullBuildMetaData
|
||||||
- majorMinorPatch
|
- majorMinorPatch
|
||||||
- semVer
|
- semVer
|
||||||
- legacySemVer
|
- legacySemVer (removed in 6.0.0)
|
||||||
- legacySemVerPadded
|
- legacySemVerPadded (removed in 6.0.0)
|
||||||
- assemblySemVer
|
- assemblySemVer
|
||||||
- assemblySemFileVer
|
- assemblySemFileVer
|
||||||
- fullSemVer
|
- fullSemVer
|
||||||
@@ -74,19 +74,19 @@ The Execute GitVersion action creates the following outputs:
|
|||||||
- escapedBranchName (since 5.2.0)
|
- escapedBranchName (since 5.2.0)
|
||||||
- sha
|
- sha
|
||||||
- shortSha
|
- shortSha
|
||||||
- nuGetVersionV2
|
- nuGetVersionV2 (removed in 6.0.0)
|
||||||
- nuGetVersion
|
- nuGetVersion (removed in 6.0.0)
|
||||||
- nuGetPreReleaseTagV2
|
- nuGetPreReleaseTagV2 (removed in 6.0.0)
|
||||||
- nuGetPreReleaseTag
|
- nuGetPreReleaseTag (removed in 6.0.0)
|
||||||
- versionSourceSha
|
- versionSourceSha
|
||||||
- commitsSinceVersionSource
|
- commitsSinceVersionSource
|
||||||
- commitsSinceVersionSourcePadded (since 5.2.0)
|
- commitsSinceVersionSourcePadded (since 5.2.0, removed in 6.0.0)
|
||||||
- uncommittedChanges (since 5.5.0)
|
- uncommittedChanges (since 5.5.0)
|
||||||
- commitDate
|
- 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).
|
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
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
# gitversion/setup@v0 action omitted for brevity.
|
||||||
|
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 2
|
### Example 2
|
||||||
@@ -113,7 +113,7 @@ Calculate the version for the build using a config file with the default name **
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
with:
|
with:
|
||||||
useConfigFile: true
|
useConfigFile: true
|
||||||
```
|
```
|
||||||
@@ -135,10 +135,10 @@ Calculate the version for the build using a config file named **VersionConfig.ym
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
# gitversion/setup@v0 action omitted for brevity.
|
||||||
|
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
with:
|
with:
|
||||||
useConfigFile: true
|
useConfigFile: true
|
||||||
configFilePath: VersionConfig.yml
|
configFilePath: VersionConfig.yml
|
||||||
@@ -150,10 +150,10 @@ Show the effective configuration for GitVersion by running the **/showConfig** c
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
# gitversion/setup@v0 action omitted for brevity.
|
||||||
|
|
||||||
- name: Display GitVersion config
|
- name: Display GitVersion config
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
with:
|
with:
|
||||||
useConfigFile: true
|
useConfigFile: true
|
||||||
additionalArguments: '/showConfig'
|
additionalArguments: '/showConfig'
|
||||||
@@ -165,13 +165,13 @@ Calculate the version for the build and display all the calculated variables in
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
# gitversion/setup@v0 action omitted for brevity.
|
||||||
|
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
id: gitversion
|
id: gitversion # id to later be referenced
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
|
|
||||||
- name: Display GitVersion outputs
|
- name: Display GitVersion outputs (step output)
|
||||||
run: |
|
run: |
|
||||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||||
@@ -205,22 +205,124 @@ steps:
|
|||||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
||||||
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
|
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
|
||||||
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
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
|
### 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
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# gitversion/setup@v0.9.7 action omitted for brevity.
|
# gitversion/setup@v0 action omitted for brevity.
|
||||||
|
|
||||||
- name: Determine Version
|
- 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: |
|
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
|
### Example 7
|
||||||
@@ -239,7 +341,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
id: gitversion
|
id: gitversion
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
|
|
||||||
create-release-notes:
|
create-release-notes:
|
||||||
name: Create Release Notes
|
name: Create Release Notes
|
||||||
@@ -268,7 +370,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Determine Version
|
- name: Determine Version
|
||||||
id: gitversion
|
id: gitversion
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
uses: gittools/actions/gitversion/execute@v0
|
||||||
|
|
||||||
display-semver:
|
display-semver:
|
||||||
name: Display Semantic Version
|
name: Display Semantic Version
|
||||||
|
|||||||
@@ -27,6 +27,17 @@ ignoreFailedSources:
|
|||||||
|
|
||||||
## Usage examples
|
## 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
|
### Example 1
|
||||||
|
|
||||||
Install the latest GitVersion 5 version.
|
Install the latest GitVersion 5 version.
|
||||||
@@ -34,7 +45,7 @@ Install the latest GitVersion 5 version.
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
uses: gittools/actions/gitversion/setup@v0
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.x'
|
versionSpec: '5.x'
|
||||||
```
|
```
|
||||||
@@ -46,7 +57,7 @@ Install GitVersion 5.5.0.
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
uses: gittools/actions/gitversion/setup@v0
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.5.0'
|
versionSpec: '5.5.0'
|
||||||
```
|
```
|
||||||
@@ -58,8 +69,21 @@ Install the latest GitVersion 6 pre-release version. For example **6.0.0-beta1.
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
uses: gittools/actions/gitversion/setup@v0
|
||||||
with:
|
with:
|
||||||
versionSpec: '6.x'
|
versionSpec: '6.x'
|
||||||
includePrerelease: true
|
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
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/addasset/bundle.js
|
main: ../../dist/github/gitreleasemanager/addasset/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/close/bundle.js
|
main: ../../dist/github/gitreleasemanager/close/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/create/bundle.js
|
main: ../../dist/github/gitreleasemanager/create/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/discard/bundle.js
|
main: ../../dist/github/gitreleasemanager/discard/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/open/bundle.js
|
main: ../../dist/github/gitreleasemanager/open/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/publish/bundle.js
|
main: ../../dist/github/gitreleasemanager/publish/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
owner:
|
owner:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitreleasemanager/setup/bundle.js
|
main: ../../dist/github/gitreleasemanager/setup/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec:
|
versionSpec:
|
||||||
@@ -20,3 +20,7 @@ inputs:
|
|||||||
description: Treat package source failures as warnings.
|
description: Treat package source failures as warnings.
|
||||||
required: false
|
required: false
|
||||||
default: '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
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitversion/execute/bundle.js
|
main: ../../dist/github/gitversion/execute/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
targetPath:
|
targetPath:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ branding:
|
|||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node20
|
||||||
main: ../../dist/github/gitversion/setup/bundle.js
|
main: ../../dist/github/gitversion/setup/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec:
|
versionSpec:
|
||||||
@@ -20,3 +20,7 @@ inputs:
|
|||||||
description: Treat package source failures as warnings.
|
description: Treat package source failures as warnings.
|
||||||
required: false
|
required: false
|
||||||
default: '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",
|
"name": "gittools-actions",
|
||||||
"version": "1.0.0",
|
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/GitTools/use-gitversion.git"
|
"url": "https://github.com/GitTools/use-gitversion.git"
|
||||||
@@ -26,34 +26,34 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2",
|
"@actions/io": "^1.1.3",
|
||||||
"@actions/tool-cache": "^2.0.1",
|
"@actions/tool-cache": "^2.0.1",
|
||||||
"azure-pipelines-task-lib": "^4.3.0",
|
"azure-pipelines-tool-lib": "^2.0.7",
|
||||||
"azure-pipelines-tool-lib": "^1.3.2",
|
"inversify": "^6.0.2",
|
||||||
"inversify": "^6.0.1",
|
"semver": "^7.6.0",
|
||||||
"typed-rest-client": "^1.8.9",
|
"typed-rest-client": "^1.8.11",
|
||||||
"uuid": "^9.0.0"
|
"uuid": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.15.0",
|
"@types/node": "^20.11.20",
|
||||||
"@types/q": "^1.5.5",
|
"@types/q": "^1.5.8",
|
||||||
"@types/semver-compare": "^1.0.1",
|
"@types/semver": "^7.5.8",
|
||||||
"@types/uuid": "^9.0.1",
|
"@types/uuid": "^9.0.8",
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"prettier": "^2.8.4",
|
"prettier": "^3.2.5",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.2.1",
|
||||||
"replace-in-file-webpack-plugin": "^1.0.6",
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"terser-webpack-plugin": "^5.3.7",
|
"terser-webpack-plugin": "^5.3.10",
|
||||||
"tfx-cli": "^0.14.0",
|
"tfx-cli": "^0.16.0",
|
||||||
"trim-newlines": ">=4.0.2",
|
"trim-newlines": ">=5.0.0",
|
||||||
"ts-loader": "^9.4.2",
|
"ts-loader": "^9.5.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^5.3.3",
|
||||||
"underscore": ">=1.13.6",
|
"underscore": ">=1.13.6",
|
||||||
"validator": "^13.9.0",
|
"validator": "^13.11.0",
|
||||||
"webpack": "^5.76.0",
|
"webpack": "^5.90.3",
|
||||||
"webpack-cli": "^5.0.1"
|
"webpack-cli": "^5.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,7 @@ class BuildAgent implements IBuildAgent {
|
|||||||
return toolLib.findLocalTool(toolName, versionSpec, arch)
|
return toolLib.findLocalTool(toolName, versionSpec, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(
|
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||||
sourceDir: string,
|
|
||||||
tool: string,
|
|
||||||
version: string,
|
|
||||||
arch?: string
|
|
||||||
): Promise<string> {
|
|
||||||
return toolLib.cacheDir(sourceDir, tool, version, arch)
|
return toolLib.cacheDir(sourceDir, tool, version, arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,8 +44,8 @@ class BuildAgent implements IBuildAgent {
|
|||||||
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done)
|
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
public exportVariable(name: string, val: string): void {
|
public setVariable(name: string, value: string): void {
|
||||||
taskLib.setVariable(name, val)
|
taskLib.setVariable(name, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVariable(name: string): string {
|
public getVariable(name: string): string {
|
||||||
@@ -83,7 +78,7 @@ class BuildAgent implements IBuildAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setOutput(name: string, value: string): void {
|
public setOutput(name: string, value: string): void {
|
||||||
taskLib.setVariable(name, value)
|
taskLib.setVariable(name, value, false, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInput(input: string, required?: boolean): string {
|
public getInput(input: string, required?: boolean): string {
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ import * as toolCache from '@actions/tool-cache'
|
|||||||
import { injectable } from 'inversify'
|
import { injectable } from 'inversify'
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from '../../core/models'
|
import { IBuildAgent, IExecResult } from '../../core/models'
|
||||||
import {
|
import { IRequestOptions, IProxyConfiguration } from 'typed-rest-client/Interfaces'
|
||||||
IRequestOptions,
|
|
||||||
IProxyConfiguration
|
|
||||||
} from 'typed-rest-client/Interfaces'
|
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
@@ -58,12 +55,7 @@ class BuildAgent implements IBuildAgent {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
let proxyURL =
|
let proxyURL = process.env.HTTP_PROXY || process.env.http_proxy || process.env.HTTPS_PROXY || process.env.https_proxy || null
|
||||||
process.env.HTTP_PROXY ||
|
|
||||||
process.env.http_proxy ||
|
|
||||||
process.env.HTTPS_PROXY ||
|
|
||||||
process.env.https_proxy ||
|
|
||||||
null
|
|
||||||
|
|
||||||
if (proxyURL) {
|
if (proxyURL) {
|
||||||
let url = new urlApi.URL(requestedUrl)
|
let url = new urlApi.URL(requestedUrl)
|
||||||
@@ -78,12 +70,7 @@ class BuildAgent implements IBuildAgent {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(
|
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||||
sourceDir: string,
|
|
||||||
tool: string,
|
|
||||||
version: string,
|
|
||||||
arch?: string
|
|
||||||
): Promise<string> {
|
|
||||||
return toolCache.cacheDir(sourceDir, tool, version, arch)
|
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)
|
core.exportVariable(name, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,24 +128,12 @@ class BuildAgent implements IBuildAgent {
|
|||||||
|
|
||||||
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
const dotnetPath = await io.which(exec, true)
|
const dotnetPath = await io.which(exec, true)
|
||||||
let resultCode = 0
|
let result = await exe.getExecOutput(`"${dotnetPath}"`, args);
|
||||||
let stdout = ''
|
|
||||||
let stderr = ''
|
|
||||||
resultCode = await exe.exec(`"${dotnetPath}"`, args, {
|
|
||||||
listeners: {
|
|
||||||
stderr: (data: Buffer) => {
|
|
||||||
stderr += data.toString()
|
|
||||||
},
|
|
||||||
stdout: (data: Buffer) => {
|
|
||||||
stdout += data.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
code: resultCode,
|
code: result.exitCode,
|
||||||
error: null,
|
error: null,
|
||||||
stderr,
|
stderr: result.stderr,
|
||||||
stdout
|
stdout: result.stdout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +143,6 @@ class BuildAgent implements IBuildAgent {
|
|||||||
|
|
||||||
public setOutput(name: string, value: string): void {
|
public setOutput(name: string, value: string): void {
|
||||||
core.setOutput(name, value)
|
core.setOutput(name, value)
|
||||||
core.exportVariable(`GITVERSION_${name.toUpperCase()}`, value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInput(input: string, required?: boolean): string {
|
public getInput(input: string, required?: boolean): string {
|
||||||
|
|||||||
@@ -19,12 +19,7 @@ class BuildAgent implements IBuildAgent {
|
|||||||
return 'find'
|
return 'find'
|
||||||
}
|
}
|
||||||
|
|
||||||
public cacheDir(
|
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||||
sourceDir: string,
|
|
||||||
tool: string,
|
|
||||||
version: string,
|
|
||||||
arch?: string
|
|
||||||
): Promise<string> {
|
|
||||||
console.log('cacheDir')
|
console.log('cacheDir')
|
||||||
return Promise.resolve('cacheDir')
|
return Promise.resolve('cacheDir')
|
||||||
}
|
}
|
||||||
@@ -46,8 +41,8 @@ class BuildAgent implements IBuildAgent {
|
|||||||
console.log('setSucceeded')
|
console.log('setSucceeded')
|
||||||
}
|
}
|
||||||
|
|
||||||
public exportVariable(name: string, val: string): void {
|
public setVariable(name: string, val: string): void {
|
||||||
console.log('exportVariable')
|
console.log('setVariable')
|
||||||
}
|
}
|
||||||
|
|
||||||
public getVariable(name: string): string {
|
public getVariable(name: string): string {
|
||||||
|
|||||||
@@ -4,16 +4,13 @@ import * as path from 'path'
|
|||||||
import * as http from 'typed-rest-client/HttpClient'
|
import * as http from 'typed-rest-client/HttpClient'
|
||||||
|
|
||||||
import { inject, injectable } from 'inversify'
|
import { inject, injectable } from 'inversify'
|
||||||
import { TYPES, IExecResult, IBuildAgent, ISetupSettings } from './models'
|
import { IBuildAgent, IExecResult, TYPES } from './models'
|
||||||
import { IVersionManager } from './versionManager'
|
import { IVersionManager } from './versionManager'
|
||||||
|
import { ISetupSettings } from '../tools/common/models'
|
||||||
|
|
||||||
export interface IDotnetTool {
|
export interface IDotnetTool {
|
||||||
disableTelemetry(): void
|
disableTelemetry(): void
|
||||||
toolInstall(
|
toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string>
|
||||||
toolName: string,
|
|
||||||
checkLatest: boolean,
|
|
||||||
setupSettings: ISetupSettings
|
|
||||||
): Promise<string>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
@@ -22,25 +19,17 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
protected versionManager: IVersionManager
|
protected versionManager: IVersionManager
|
||||||
private httpClient: http.HttpClient
|
private httpClient: http.HttpClient
|
||||||
|
|
||||||
private static readonly nugetRoot: string =
|
private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/query'
|
||||||
'https://api-v2v3search-0.nuget.org/'
|
|
||||||
|
|
||||||
constructor(
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
|
||||||
) {
|
|
||||||
this.buildAgent = buildAgent
|
this.buildAgent = buildAgent
|
||||||
this.versionManager = versionManager
|
this.versionManager = versionManager
|
||||||
this.httpClient = new http.HttpClient(
|
this.httpClient = new http.HttpClient('dotnet', undefined, this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot))
|
||||||
'dotnet',
|
|
||||||
undefined,
|
|
||||||
this.buildAgent.proxyConfiguration(DotnetTool.nugetRoot)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public disableTelemetry(): void {
|
public disableTelemetry(): void {
|
||||||
this.buildAgent.exportVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
this.buildAgent.setVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
||||||
this.buildAgent.exportVariable('DOTNET_NOLOGO', 'true')
|
this.buildAgent.setVariable('DOTNET_NOLOGO', 'true')
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
||||||
@@ -48,20 +37,17 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
return this.buildAgent.exec(cmd, args)
|
return this.buildAgent.exec(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async toolInstall(
|
public async toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string> {
|
||||||
toolName: string,
|
|
||||||
checkLatest: boolean,
|
|
||||||
setupSettings: ISetupSettings
|
|
||||||
): Promise<string> {
|
|
||||||
console.log('')
|
console.log('')
|
||||||
console.log('--------------------------')
|
console.log('--------------------------')
|
||||||
console.log(
|
console.log(`Acquiring ${toolName} version spec: ${setupSettings.versionSpec}`)
|
||||||
`Installing ${toolName} version ` + setupSettings.versionSpec
|
|
||||||
)
|
|
||||||
console.log('--------------------------')
|
console.log('--------------------------')
|
||||||
|
|
||||||
|
let version: string
|
||||||
|
let checkLatest = setupSettings.preferLatestVersion
|
||||||
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
|
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
|
||||||
checkLatest = false // check latest doesn't make sense when explicit version
|
checkLatest = false // check latest doesn't make sense when explicit version
|
||||||
|
version = setupSettings.versionSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
let toolPath: string
|
let toolPath: string
|
||||||
@@ -73,10 +59,7 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!toolPath) {
|
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.
|
// 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,
|
// If your tool doesn't offer a mechanism to query,
|
||||||
// then it can only support exact version inputs.
|
// then it can only support exact version inputs.
|
||||||
//
|
//
|
||||||
version = await this.queryLatestMatch(
|
version = await this.queryLatestMatch(toolName, setupSettings.versionSpec, setupSettings.includePrerelease)
|
||||||
toolName,
|
|
||||||
setupSettings.versionSpec,
|
|
||||||
setupSettings.includePrerelease
|
|
||||||
)
|
|
||||||
if (!version) {
|
if (!version) {
|
||||||
throw new Error(
|
throw new Error(`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`)
|
||||||
`Unable to find ${toolName} version '${setupSettings.versionSpec}'.`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -108,50 +85,38 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
//
|
//
|
||||||
// Download, extract, cache
|
// Download, extract, cache
|
||||||
//
|
//
|
||||||
toolPath = await this.acquireTool(
|
toolPath = await this.acquireTool(toolName, version, setupSettings.ignoreFailedSources)
|
||||||
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
|
// Prepend the tools path. This prepends the PATH for the current process and
|
||||||
// instructs the agent to prepend for each task that follows.
|
// instructs the agent to prepend for each task that follows.
|
||||||
//
|
//
|
||||||
this.buildAgent.debug(`toolPath: ${toolPath}`)
|
this.buildAgent.debug(`toolPath: ${toolPath}`)
|
||||||
|
|
||||||
if (
|
if (os.platform() !== 'win32' && !this.buildAgent.getVariable('DOTNET_ROOT')) {
|
||||||
os.platform() !== 'win32' &&
|
|
||||||
!this.buildAgent.getVariable('DOTNET_ROOT')
|
|
||||||
) {
|
|
||||||
let dotnetPath = await this.buildAgent.which('dotnet')
|
let dotnetPath = await this.buildAgent.which('dotnet')
|
||||||
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
|
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
|
||||||
const dotnetRoot = path.dirname(dotnetPath)
|
const dotnetRoot = path.dirname(dotnetPath)
|
||||||
this.buildAgent.exportVariable('DOTNET_ROOT', dotnetRoot)
|
this.buildAgent.setVariable('DOTNET_ROOT', dotnetRoot)
|
||||||
}
|
}
|
||||||
this.buildAgent.addPath(toolPath)
|
this.buildAgent.addPath(toolPath)
|
||||||
|
|
||||||
return toolPath
|
return toolPath
|
||||||
}
|
}
|
||||||
|
|
||||||
private async queryLatestMatch(
|
private async queryLatestMatch(toolName: string, versionSpec: string, includePrerelease: boolean): Promise<string> {
|
||||||
toolName: string,
|
|
||||||
versionSpec: string,
|
|
||||||
includePrerelease: boolean
|
|
||||||
): Promise<string> {
|
|
||||||
this.buildAgent.debug(
|
this.buildAgent.debug(
|
||||||
`querying tool versions for ${toolName}${
|
`querying tool versions for ${toolName}${versionSpec ? `@${versionSpec}` : ''} ${includePrerelease ? 'including pre-releases' : ''}`
|
||||||
versionSpec ? `@${versionSpec}` : ''
|
|
||||||
} ${includePrerelease ? 'including pre-releases' : ''}`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const downloadPath = `${
|
const toolNameParam = encodeURIComponent(toolName.toLowerCase())
|
||||||
DotnetTool.nugetRoot
|
const prereleaseParam = includePrerelease ? 'true' : 'false'
|
||||||
}query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${
|
const downloadPath = `${DotnetTool.nugetRoot}?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
|
||||||
includePrerelease ? 'true' : 'false'
|
|
||||||
}&semVerLevel=2.0.0`
|
|
||||||
|
|
||||||
const res = await this.httpClient.get(downloadPath)
|
const res = await this.httpClient.get(downloadPath)
|
||||||
|
|
||||||
@@ -162,23 +127,19 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
const body: string = await res.readBody()
|
const body: string = await res.readBody()
|
||||||
const data = JSON.parse(body).data
|
const data = JSON.parse(body).data
|
||||||
|
|
||||||
const versions = (data[0].versions as { version: string }[]).map(
|
const versions = (data[0].versions as { version: string }[]).map(x => x.version)
|
||||||
x => x.version
|
|
||||||
)
|
|
||||||
if (!versions || !versions.length) {
|
if (!versions || !versions.length) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buildAgent.debug(`got versions: ${versions.join(', ')}`)
|
this.buildAgent.debug(`got versions: ${versions.join(', ')}`)
|
||||||
|
|
||||||
return this.versionManager.evaluateVersions(versions, versionSpec)
|
return this.versionManager.evaluateVersions(versions, versionSpec, {
|
||||||
|
includePrerelease
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private async acquireTool(
|
private async acquireTool(toolName: string, version: string, ignoreFailedSources: boolean): Promise<string> {
|
||||||
toolName: string,
|
|
||||||
version: string,
|
|
||||||
ignoreFailedSources: boolean
|
|
||||||
): Promise<string> {
|
|
||||||
const tempDirectory = await this.buildAgent.createTempDir()
|
const tempDirectory = await this.buildAgent.createTempDir()
|
||||||
let args = ['tool', 'install', toolName, '--tool-path', tempDirectory]
|
let args = ['tool', 'install', toolName, '--tool-path', tempDirectory]
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,9 @@ export const TYPES = {
|
|||||||
IDotnetTool: Symbol.for('DotnetTool'),
|
IDotnetTool: Symbol.for('DotnetTool'),
|
||||||
IGitVersionTool: Symbol.for('GitVersionTool'),
|
IGitVersionTool: Symbol.for('GitVersionTool'),
|
||||||
IGitReleaseManagerTool: Symbol.for('GitReleaseManagerTool'),
|
IGitReleaseManagerTool: Symbol.for('GitReleaseManagerTool'),
|
||||||
IVersionManager: Symbol.for('VersionManager')
|
IVersionManager: Symbol.for('VersionManager'),
|
||||||
}
|
IGitVersionSettingsProvider: Symbol.for('GitVersionSettingsProvider'),
|
||||||
|
IGitReleaseManagerSettingsProvider: Symbol.for('GitReleaseManagerSettingsProvider')
|
||||||
export enum SetupFields {
|
|
||||||
includePrerelease = 'includePrerelease',
|
|
||||||
versionSpec = 'versionSpec',
|
|
||||||
ignoreFailedSources = 'ignoreFailedSources'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISetupSettings {
|
|
||||||
[SetupFields.versionSpec]: string
|
|
||||||
[SetupFields.includePrerelease]: boolean
|
|
||||||
[SetupFields.ignoreFailedSources]: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IExecResult {
|
export interface IExecResult {
|
||||||
@@ -26,22 +16,16 @@ export interface IExecResult {
|
|||||||
code: number
|
code: number
|
||||||
error: Error
|
error: Error
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBuildAgent {
|
export interface IBuildAgent {
|
||||||
agentName: string
|
agentName: string
|
||||||
proxyConfiguration(url: string): IRequestOptions
|
proxyConfiguration(url: string): IRequestOptions
|
||||||
find(toolName: string, versionSpec: string, arch?: string): string
|
find(toolName: string, versionSpec: string, arch?: string): string
|
||||||
cacheDir(
|
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>
|
||||||
sourceDir: string,
|
|
||||||
tool: string,
|
|
||||||
version: string,
|
|
||||||
arch?: string
|
|
||||||
): Promise<string>
|
|
||||||
createTempDir(): Promise<string>
|
createTempDir(): Promise<string>
|
||||||
debug(message: string): void
|
debug(message: string): void
|
||||||
setFailed(message: string, done?: boolean): void
|
setFailed(message: string, done?: boolean): void
|
||||||
setSucceeded(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
|
getVariable(name: string): string
|
||||||
addPath(inputPath: string): void
|
addPath(inputPath: string): void
|
||||||
which(tool: string, check?: boolean): Promise<string>
|
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 * as semver from 'semver'
|
||||||
import { injectable, inject } from 'inversify'
|
import { injectable, inject } from 'inversify'
|
||||||
|
|
||||||
@@ -6,7 +5,7 @@ import { IBuildAgent, TYPES } from './models'
|
|||||||
|
|
||||||
export interface IVersionManager {
|
export interface IVersionManager {
|
||||||
isExplicitVersion(versionSpec: string): boolean
|
isExplicitVersion(versionSpec: string): boolean
|
||||||
evaluateVersions(versions: string[], versionSpec: string): string
|
evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string
|
||||||
cleanVersion(version: string): string
|
cleanVersion(version: string): string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,13 +26,13 @@ export class VersionManager implements IVersionManager {
|
|||||||
return valid
|
return valid
|
||||||
}
|
}
|
||||||
|
|
||||||
public evaluateVersions(versions: string[], versionSpec: string): string {
|
public evaluateVersions(versions: string[], versionSpec: string, optionsOrLoose?: boolean | semver.RangeOptions): string {
|
||||||
let version: string
|
let version: string
|
||||||
this.buildAgent.debug('evaluating ' + versions.length + ' versions')
|
this.buildAgent.debug('evaluating ' + versions.length + ' versions')
|
||||||
versions = versions.sort(cmp)
|
versions = semver.sort(versions)
|
||||||
for (let i = versions.length - 1; i >= 0; i--) {
|
for (let i = versions.length - 1; i >= 0; i--) {
|
||||||
const potential: string = versions[i]
|
const potential: string = versions[i]
|
||||||
const satisfied: boolean = semver.satisfies(potential, versionSpec)
|
const satisfied: boolean = semver.satisfies(potential, versionSpec, optionsOrLoose)
|
||||||
if (satisfied) {
|
if (satisfied) {
|
||||||
version = potential
|
version = potential
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { addAsset } from './main'
|
import { addAsset } from './main'
|
||||||
|
|
||||||
addAsset()
|
await addAsset()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { close } from './main'
|
import { close } from './main'
|
||||||
|
|
||||||
close()
|
await close()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { create } from './main'
|
import { create } from './main'
|
||||||
|
|
||||||
create()
|
await create()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { discard } from './main'
|
import { discard } from './main'
|
||||||
|
|
||||||
discard()
|
await discard()
|
||||||
|
|||||||
@@ -1,34 +1,26 @@
|
|||||||
import { IBuildAgent, TYPES } from '../../core/models'
|
import { IBuildAgent, TYPES } from '../../core/models'
|
||||||
import {
|
import { IGitReleaseManagerTool, GitReleaseManagerTool } from '../../tools/gitreleasemanager/tool'
|
||||||
IGitReleaseManagerTool,
|
import { IGitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/models'
|
||||||
GitReleaseManagerTool
|
import { GitReleaseManagerSettingsProvider } from '../../tools/gitreleasemanager/settings'
|
||||||
} from '../../tools/gitreleasemanager/tool'
|
|
||||||
import { Settings as CommonSettings } from '../../core/settings'
|
|
||||||
import { Settings } from '../../tools/gitreleasemanager/settings'
|
|
||||||
|
|
||||||
import container from '../../core/ioc'
|
import container from '../../core/ioc'
|
||||||
|
|
||||||
container
|
container.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool)
|
||||||
.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool)
|
container.bind<IGitReleaseManagerSettingsProvider>(TYPES.IGitReleaseManagerSettingsProvider).to(GitReleaseManagerSettingsProvider)
|
||||||
.to(GitReleaseManagerTool)
|
|
||||||
|
|
||||||
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(
|
|
||||||
TYPES.IGitReleaseManagerTool
|
|
||||||
)
|
|
||||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
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() {
|
export async function setup() {
|
||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = CommonSettings.getSetupSettings(buildAgent)
|
const settings = settingsProvider.getSetupSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.install(settings)
|
await gitReleaseManagerTool.install(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager installed successfully', true)
|
||||||
'GitVersionManager installed successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -38,14 +30,11 @@ export async function create() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getCreateSettings(buildAgent)
|
const settings = settingsProvider.getCreateSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.create(settings)
|
await gitReleaseManagerTool.create(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager created release successfully', true)
|
||||||
'GitVersionManager created release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -55,14 +44,11 @@ export async function discard() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getDiscardSettings(buildAgent)
|
const settings = settingsProvider.getDiscardSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.discard(settings)
|
await gitReleaseManagerTool.discard(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager discarded release successfully', true)
|
||||||
'GitVersionManager discarded release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -72,14 +58,11 @@ export async function close() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getCloseSettings(buildAgent)
|
const settings = settingsProvider.getCloseSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.close(settings)
|
await gitReleaseManagerTool.close(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager closed release successfully', true)
|
||||||
'GitVersionManager closed release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -89,14 +72,11 @@ export async function open() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getOpenSettings(buildAgent)
|
const settings = settingsProvider.getOpenSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.open(settings)
|
await gitReleaseManagerTool.open(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager opened release successfully', true)
|
||||||
'GitVersionManager opened release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -106,14 +86,11 @@ export async function publish() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getPublishSettings(buildAgent)
|
const settings = settingsProvider.getPublishSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.publish(settings)
|
await gitReleaseManagerTool.publish(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager published release successfully', true)
|
||||||
'GitVersionManager published release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
@@ -123,14 +100,11 @@ export async function addAsset() {
|
|||||||
try {
|
try {
|
||||||
gitReleaseManagerTool.disableTelemetry()
|
gitReleaseManagerTool.disableTelemetry()
|
||||||
|
|
||||||
const settings = Settings.getAddAssetSettings(buildAgent)
|
const settings = settingsProvider.getAddAssetSettings()
|
||||||
|
|
||||||
await gitReleaseManagerTool.addAsset(settings)
|
await gitReleaseManagerTool.addAsset(settings)
|
||||||
|
|
||||||
buildAgent.setSucceeded(
|
buildAgent.setSucceeded('GitVersionManager added assets to release successfully', true)
|
||||||
'GitVersionManager added assets to release successfully',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
buildAgent.setFailed(error.message, true)
|
buildAgent.setFailed(error.message, true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { open } from './main'
|
import { open } from './main'
|
||||||
|
|
||||||
open()
|
await open()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { publish } from './main'
|
import { publish } from './main'
|
||||||
|
|
||||||
publish()
|
await publish()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { setup } from './main'
|
import { setup } from './main'
|
||||||
|
|
||||||
setup()
|
await setup()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { run } from './main'
|
import { run } from './main'
|
||||||
|
|
||||||
run()
|
await run()
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
import { IBuildAgent, TYPES } from '../../core/models'
|
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 { IGitVersionTool, GitVersionTool } from '../../tools/gitversion/tool'
|
||||||
import {
|
import { GitVersionSettings, GitVersionOutput, IGitVersionSettingsProvider } from '../../tools/gitversion/models'
|
||||||
GitVersionSettings,
|
import { GitVersionSettingsProvider } from '../../tools/gitversion/settings'
|
||||||
GitVersionOutput
|
|
||||||
} from '../../tools/gitversion/models'
|
|
||||||
|
|
||||||
import container from '../../core/ioc'
|
import container from '../../core/ioc'
|
||||||
|
|
||||||
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
|
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
|
||||||
|
container.bind<IGitVersionSettingsProvider>(TYPES.IGitVersionSettingsProvider).to(GitVersionSettingsProvider)
|
||||||
|
|
||||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
|
|
||||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
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() {
|
export async function setup() {
|
||||||
try {
|
try {
|
||||||
gitVersionTool.disableTelemetry()
|
gitVersionTool.disableTelemetry()
|
||||||
|
console.log(`Agent: '${buildAgent.agentName}'`)
|
||||||
|
|
||||||
const settings = CommonSettings.getSetupSettings(buildAgent)
|
const settings = settingsProvider.getSetupSettings()
|
||||||
|
|
||||||
await gitVersionTool.install(settings)
|
await gitVersionTool.install(settings)
|
||||||
|
|
||||||
@@ -31,23 +30,24 @@ export async function setup() {
|
|||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
gitVersionTool.disableTelemetry()
|
gitVersionTool.disableTelemetry()
|
||||||
|
console.log(`Agent: '${buildAgent.agentName}'`)
|
||||||
|
|
||||||
const settings: GitVersionSettings = Settings.getGitVersionSettings(
|
const settings: GitVersionSettings = settingsProvider.getGitVersionSettings()
|
||||||
buildAgent
|
|
||||||
)
|
|
||||||
|
|
||||||
const result = await gitVersionTool.run(settings)
|
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) {
|
if (result.code === 0) {
|
||||||
buildAgent.setSucceeded('GitVersion executed successfully', true)
|
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 {
|
} else {
|
||||||
buildAgent.setFailed(result.error.message, true)
|
buildAgent.setFailed(result.error.message, true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
import { setup } from './main'
|
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 {
|
export enum CommonFields {
|
||||||
repository = 'repository',
|
repository = 'repository',
|
||||||
owner = 'owner',
|
owner = 'owner',
|
||||||
@@ -35,6 +37,22 @@ export enum AddAssetFields {
|
|||||||
assets = 'assets'
|
assets = 'assets'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IGitReleaseManagerSettingsProvider extends ISettingsProvider {
|
||||||
|
getCreateSettings(): GitReleaseManagerCreateSettings
|
||||||
|
|
||||||
|
getDiscardSettings(): GitReleaseManagerDiscardSettings
|
||||||
|
|
||||||
|
getCloseSettings(): GitReleaseManagerCloseSettings
|
||||||
|
|
||||||
|
getOpenSettings(): GitReleaseManagerOpenSettings
|
||||||
|
|
||||||
|
getPublishSettings(): GitReleaseManagerPublishSettings
|
||||||
|
|
||||||
|
getAddAssetSettings(): GitReleaseManagerAddAssetSettings
|
||||||
|
|
||||||
|
getCommonSettings(): GitReleaseManagerSettings
|
||||||
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerSettings {
|
export interface GitReleaseManagerSettings {
|
||||||
[CommonFields.repository]: string
|
[CommonFields.repository]: string
|
||||||
[CommonFields.owner]: string
|
[CommonFields.owner]: string
|
||||||
@@ -42,8 +60,7 @@ export interface GitReleaseManagerSettings {
|
|||||||
[CommonFields.targetDirectory]: string
|
[CommonFields.targetDirectory]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerCreateSettings
|
export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[CreateFields.milestone]: string
|
[CreateFields.milestone]: string
|
||||||
[CreateFields.name]: string
|
[CreateFields.name]: string
|
||||||
[CreateFields.inputFileName]: string
|
[CreateFields.inputFileName]: string
|
||||||
@@ -52,28 +69,23 @@ export interface GitReleaseManagerCreateSettings
|
|||||||
[CreateFields.assets]?: string[]
|
[CreateFields.assets]?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerDiscardSettings
|
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[DiscardFields.milestone]: string
|
[DiscardFields.milestone]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerCloseSettings
|
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[CloseFields.milestone]: string
|
[CloseFields.milestone]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerOpenSettings
|
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[OpenFields.milestone]: string
|
[OpenFields.milestone]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerPublishSettings
|
export interface GitReleaseManagerPublishSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[PublishFields.tagName]: string
|
[PublishFields.tagName]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitReleaseManagerAddAssetSettings
|
export interface GitReleaseManagerAddAssetSettings extends GitReleaseManagerSettings {
|
||||||
extends GitReleaseManagerSettings {
|
|
||||||
[AddAssetFields.tagName]: string
|
[AddAssetFields.tagName]: string
|
||||||
[AddAssetFields.assets]: string[]
|
[AddAssetFields.assets]: string[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,39 @@
|
|||||||
import { IBuildAgent } from '../../core/models'
|
import { IBuildAgent, TYPES } from '../../core/models'
|
||||||
import {
|
import {
|
||||||
GitReleaseManagerSettings,
|
AddAssetFields,
|
||||||
|
CloseFields,
|
||||||
CommonFields,
|
CommonFields,
|
||||||
CreateFields,
|
CreateFields,
|
||||||
DiscardFields,
|
DiscardFields,
|
||||||
CloseFields,
|
GitReleaseManagerAddAssetSettings,
|
||||||
OpenFields,
|
GitReleaseManagerCloseSettings,
|
||||||
PublishFields,
|
|
||||||
AddAssetFields,
|
|
||||||
GitReleaseManagerCreateSettings,
|
GitReleaseManagerCreateSettings,
|
||||||
GitReleaseManagerDiscardSettings,
|
GitReleaseManagerDiscardSettings,
|
||||||
GitReleaseManagerCloseSettings,
|
|
||||||
GitReleaseManagerOpenSettings,
|
GitReleaseManagerOpenSettings,
|
||||||
GitReleaseManagerPublishSettings,
|
GitReleaseManagerPublishSettings,
|
||||||
GitReleaseManagerAddAssetSettings
|
GitReleaseManagerSettings,
|
||||||
|
IGitReleaseManagerSettingsProvider,
|
||||||
|
OpenFields,
|
||||||
|
PublishFields
|
||||||
} from './models'
|
} from './models'
|
||||||
|
import { SettingsProvider } from '../common/settings'
|
||||||
|
import { inject, injectable } from 'inversify'
|
||||||
|
|
||||||
export class Settings {
|
@injectable()
|
||||||
public static getCreateSettings(
|
export class GitReleaseManagerSettingsProvider extends SettingsProvider implements IGitReleaseManagerSettingsProvider {
|
||||||
buildAgent: IBuildAgent
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
|
||||||
): GitReleaseManagerCreateSettings {
|
super(buildAgent)
|
||||||
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)
|
|
||||||
|
|
||||||
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 {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone,
|
milestone,
|
||||||
@@ -41,61 +45,51 @@ export class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getDiscardSettings(
|
getDiscardSettings(): GitReleaseManagerDiscardSettings {
|
||||||
buildAgent: IBuildAgent
|
const milestone = this.buildAgent.getInput(DiscardFields.milestone)
|
||||||
): GitReleaseManagerDiscardSettings {
|
|
||||||
const milestone = buildAgent.getInput(DiscardFields.milestone)
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
const commonSettings = this.getCommonSettings()
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getCloseSettings(
|
getCloseSettings(): GitReleaseManagerCloseSettings {
|
||||||
buildAgent: IBuildAgent
|
const milestone = this.buildAgent.getInput(CloseFields.milestone)
|
||||||
): GitReleaseManagerCloseSettings {
|
|
||||||
const milestone = buildAgent.getInput(CloseFields.milestone)
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
const commonSettings = this.getCommonSettings()
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getOpenSettings(
|
getOpenSettings(): GitReleaseManagerOpenSettings {
|
||||||
buildAgent: IBuildAgent
|
const milestone = this.buildAgent.getInput(OpenFields.milestone)
|
||||||
): GitReleaseManagerOpenSettings {
|
|
||||||
const milestone = buildAgent.getInput(OpenFields.milestone)
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
const commonSettings = this.getCommonSettings()
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
milestone
|
milestone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getPublishSettings(
|
getPublishSettings(): GitReleaseManagerPublishSettings {
|
||||||
buildAgent: IBuildAgent
|
const tagName = this.buildAgent.getInput(PublishFields.tagName)
|
||||||
): GitReleaseManagerPublishSettings {
|
|
||||||
const tagName = buildAgent.getInput(PublishFields.tagName)
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
const commonSettings = this.getCommonSettings()
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
tagName
|
tagName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getAddAssetSettings(
|
getAddAssetSettings(): GitReleaseManagerAddAssetSettings {
|
||||||
buildAgent: IBuildAgent
|
const tagName = this.buildAgent.getInput(AddAssetFields.tagName)
|
||||||
): GitReleaseManagerAddAssetSettings {
|
const assets = this.buildAgent.getListInput(AddAssetFields.assets)
|
||||||
const tagName = buildAgent.getInput(AddAssetFields.tagName)
|
|
||||||
const assets = buildAgent.getListInput(AddAssetFields.assets)
|
|
||||||
|
|
||||||
const commonSettings = Settings.getCommonSettings(buildAgent)
|
const commonSettings = this.getCommonSettings()
|
||||||
return {
|
return {
|
||||||
...commonSettings,
|
...commonSettings,
|
||||||
tagName,
|
tagName,
|
||||||
@@ -103,15 +97,11 @@ export class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getCommonSettings(
|
getCommonSettings(): GitReleaseManagerSettings {
|
||||||
buildAgent: IBuildAgent
|
const owner = this.buildAgent.getInput(CommonFields.owner, true)
|
||||||
): GitReleaseManagerSettings {
|
const repository = this.buildAgent.getInput(CommonFields.repository, true)
|
||||||
const owner = buildAgent.getInput(CommonFields.owner, true)
|
const token = this.buildAgent.getInput(CommonFields.token, true)
|
||||||
const repository = buildAgent.getInput(CommonFields.repository, true)
|
const targetDirectory = this.buildAgent.getInput(CommonFields.targetDirectory)
|
||||||
const token = buildAgent.getInput(CommonFields.token, true)
|
|
||||||
const targetDirectory = buildAgent.getInput(
|
|
||||||
CommonFields.targetDirectory
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
owner,
|
owner,
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
import path = require('path')
|
import * as path from 'path'
|
||||||
|
|
||||||
import { TYPES, IBuildAgent, IExecResult, ISetupSettings } from '../../core/models'
|
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
|
||||||
import { injectable, inject } from 'inversify'
|
import { inject, injectable } from 'inversify'
|
||||||
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||||
import { IVersionManager } from '../../core/versionManager'
|
import { IVersionManager } from '../../core/versionManager'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
GitReleaseManagerSettings,
|
GitReleaseManagerAddAssetSettings,
|
||||||
|
GitReleaseManagerCloseSettings,
|
||||||
GitReleaseManagerCreateSettings,
|
GitReleaseManagerCreateSettings,
|
||||||
GitReleaseManagerDiscardSettings,
|
GitReleaseManagerDiscardSettings,
|
||||||
GitReleaseManagerCloseSettings,
|
|
||||||
GitReleaseManagerOpenSettings,
|
GitReleaseManagerOpenSettings,
|
||||||
GitReleaseManagerPublishSettings,
|
GitReleaseManagerPublishSettings,
|
||||||
GitReleaseManagerAddAssetSettings
|
GitReleaseManagerSettings
|
||||||
} from './models'
|
} from './models'
|
||||||
|
import { ISetupSettings } from '../common/models'
|
||||||
|
|
||||||
export interface IGitReleaseManagerTool extends IDotnetTool {
|
export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||||
install(setupSettings: ISetupSettings): Promise<void>
|
install(setupSettings: ISetupSettings): Promise<void>
|
||||||
@@ -26,43 +27,28 @@ export interface IGitReleaseManagerTool extends IDotnetTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class GitReleaseManagerTool
|
export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseManagerTool {
|
||||||
extends DotnetTool
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||||
implements IGitReleaseManagerTool {
|
|
||||||
constructor(
|
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
|
||||||
) {
|
|
||||||
super(buildAgent, versionManager)
|
super(buildAgent, versionManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async install(setupSettings: ISetupSettings): Promise<void> {
|
public async install(setupSettings: ISetupSettings): Promise<void> {
|
||||||
await this.toolInstall(
|
await this.toolInstall('GitReleaseManager.Tool', setupSettings)
|
||||||
'GitReleaseManager.Tool',
|
|
||||||
false,
|
|
||||||
setupSettings
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public create(
|
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {
|
||||||
settings: GitReleaseManagerCreateSettings
|
|
||||||
): Promise<IExecResult> {
|
|
||||||
const args = this.getCreateArguments(settings)
|
const args = this.getCreateArguments(settings)
|
||||||
|
|
||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public discard(
|
public discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult> {
|
||||||
settings: GitReleaseManagerDiscardSettings
|
|
||||||
): Promise<IExecResult> {
|
|
||||||
const args = this.getDiscardArguments(settings)
|
const args = this.getDiscardArguments(settings)
|
||||||
|
|
||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public close(
|
public close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult> {
|
||||||
settings: GitReleaseManagerCloseSettings
|
|
||||||
): Promise<IExecResult> {
|
|
||||||
const args = this.getCloseArguments(settings)
|
const args = this.getCloseArguments(settings)
|
||||||
|
|
||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
@@ -74,17 +60,13 @@ export class GitReleaseManagerTool
|
|||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public publish(
|
public publish(settings: GitReleaseManagerPublishSettings): Promise<IExecResult> {
|
||||||
settings: GitReleaseManagerPublishSettings
|
|
||||||
): Promise<IExecResult> {
|
|
||||||
const args = this.getPublishArguments(settings)
|
const args = this.getPublishArguments(settings)
|
||||||
|
|
||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
public addAsset(
|
public addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult> {
|
||||||
settings: GitReleaseManagerAddAssetSettings
|
|
||||||
): Promise<IExecResult> {
|
|
||||||
const args = this.getAddAssetArguments(settings)
|
const args = this.getAddAssetArguments(settings)
|
||||||
|
|
||||||
return this.execute('dotnet-gitreleasemanager', args)
|
return this.execute('dotnet-gitreleasemanager', args)
|
||||||
@@ -104,9 +86,7 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCreateArguments(
|
private getCreateArguments(settings: GitReleaseManagerCreateSettings): string[] {
|
||||||
settings: GitReleaseManagerCreateSettings
|
|
||||||
): string[] {
|
|
||||||
const args: string[] = ['create', ...this.getCommonArguments(settings)]
|
const args: string[] = ['create', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.milestone) {
|
if (settings.milestone) {
|
||||||
@@ -123,10 +103,7 @@ export class GitReleaseManagerTool
|
|||||||
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
||||||
args.push('--inputFilePath', settings.inputFileName)
|
args.push('--inputFilePath', settings.inputFileName)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error('GitReleaseManager inputFilePath not found at ' + settings.inputFileName)
|
||||||
'GitReleaseManager inputFilePath not found at ' +
|
|
||||||
settings.inputFileName
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (settings.isPreRelease) {
|
if (settings.isPreRelease) {
|
||||||
@@ -143,9 +120,7 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDiscardArguments(
|
private getDiscardArguments(settings: GitReleaseManagerDiscardSettings): string[] {
|
||||||
settings: GitReleaseManagerDiscardSettings
|
|
||||||
): string[] {
|
|
||||||
const args: string[] = ['discard', ...this.getCommonArguments(settings)]
|
const args: string[] = ['discard', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.milestone) {
|
if (settings.milestone) {
|
||||||
@@ -155,9 +130,7 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCloseArguments(
|
private getCloseArguments(settings: GitReleaseManagerCloseSettings): string[] {
|
||||||
settings: GitReleaseManagerCloseSettings
|
|
||||||
): string[] {
|
|
||||||
const args: string[] = ['close', ...this.getCommonArguments(settings)]
|
const args: string[] = ['close', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.milestone) {
|
if (settings.milestone) {
|
||||||
@@ -167,9 +140,7 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getOpenArguments(
|
private getOpenArguments(settings: GitReleaseManagerOpenSettings): string[] {
|
||||||
settings: GitReleaseManagerOpenSettings
|
|
||||||
): string[] {
|
|
||||||
const args: string[] = ['open', ...this.getCommonArguments(settings)]
|
const args: string[] = ['open', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.milestone) {
|
if (settings.milestone) {
|
||||||
@@ -179,9 +150,7 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPublishArguments(
|
private getPublishArguments(settings: GitReleaseManagerPublishSettings): string[] {
|
||||||
settings: GitReleaseManagerPublishSettings
|
|
||||||
): string[] {
|
|
||||||
const args: string[] = ['publish', ...this.getCommonArguments(settings)]
|
const args: string[] = ['publish', ...this.getCommonArguments(settings)]
|
||||||
|
|
||||||
if (settings.tagName) {
|
if (settings.tagName) {
|
||||||
@@ -191,13 +160,8 @@ export class GitReleaseManagerTool
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAddAssetArguments(
|
private getAddAssetArguments(settings: GitReleaseManagerAddAssetSettings): string[] {
|
||||||
settings: GitReleaseManagerAddAssetSettings
|
const args: string[] = ['addasset', ...this.getCommonArguments(settings)]
|
||||||
): string[] {
|
|
||||||
const args: string[] = [
|
|
||||||
'addasset',
|
|
||||||
...this.getCommonArguments(settings)
|
|
||||||
]
|
|
||||||
|
|
||||||
if (settings.tagName) {
|
if (settings.tagName) {
|
||||||
args.push('--tagName', settings.tagName)
|
args.push('--tagName', settings.tagName)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { ISettingsProvider } from '../common/models'
|
||||||
|
|
||||||
export enum ExecuteFields {
|
export enum ExecuteFields {
|
||||||
targetPath = 'targetPath',
|
targetPath = 'targetPath',
|
||||||
useConfigFile = 'useConfigFile',
|
useConfigFile = 'useConfigFile',
|
||||||
@@ -18,6 +20,10 @@ export interface GitVersionSettings {
|
|||||||
[ExecuteFields.srcDir]: string
|
[ExecuteFields.srcDir]: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IGitVersionSettingsProvider extends ISettingsProvider {
|
||||||
|
getGitVersionSettings(): GitVersionSettings
|
||||||
|
}
|
||||||
|
|
||||||
export interface GitVersionOutput {
|
export interface GitVersionOutput {
|
||||||
Major: number
|
Major: number
|
||||||
Minor: 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 {
|
@injectable()
|
||||||
public static getGitVersionSettings(
|
export class GitVersionSettingsProvider extends SettingsProvider implements IGitVersionSettingsProvider {
|
||||||
buildAgent: IBuildAgent
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent) {
|
||||||
): GitVersionSettings {
|
super(buildAgent)
|
||||||
const targetPath = buildAgent.getInput(ExecuteFields.targetPath)
|
}
|
||||||
|
|
||||||
const useConfigFile = buildAgent.getBooleanInput(
|
public getGitVersionSettings(): GitVersionSettings {
|
||||||
ExecuteFields.useConfigFile
|
const targetPath = this.buildAgent.getInput(ExecuteFields.targetPath)
|
||||||
)
|
|
||||||
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath)
|
|
||||||
|
|
||||||
const updateAssemblyInfo = buildAgent.getBooleanInput(
|
const useConfigFile = this.buildAgent.getBooleanInput(ExecuteFields.useConfigFile)
|
||||||
ExecuteFields.updateAssemblyInfo
|
const configFilePath = this.buildAgent.getInput(ExecuteFields.configFilePath)
|
||||||
)
|
|
||||||
const updateAssemblyInfoFilename = buildAgent.getInput(
|
|
||||||
ExecuteFields.updateAssemblyInfoFilename
|
|
||||||
)
|
|
||||||
|
|
||||||
const additionalArguments = buildAgent.getInput(
|
const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo)
|
||||||
ExecuteFields.additionalArguments
|
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 {
|
return {
|
||||||
targetPath,
|
targetPath,
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import path = require('path')
|
import { inject, injectable } from 'inversify'
|
||||||
|
import { IBuildAgent, IExecResult, TYPES } from '../../core/models'
|
||||||
import { injectable, inject } from 'inversify'
|
|
||||||
import { IExecResult, IBuildAgent, TYPES, ISetupSettings } from '../../core/models'
|
|
||||||
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
import { DotnetTool, IDotnetTool } from '../../core/dotnet-tool'
|
||||||
import { GitVersionSettings, GitVersionOutput } from './models'
|
import { GitVersionOutput, GitVersionSettings } from './models'
|
||||||
import { IVersionManager } from '../../core/versionManager'
|
import { IVersionManager } from '../../core/versionManager'
|
||||||
|
import { ISetupSettings } from '../common/models'
|
||||||
|
|
||||||
export interface IGitVersionTool extends IDotnetTool {
|
export interface IGitVersionTool extends IDotnetTool {
|
||||||
install(setupSettings: ISetupSettings): Promise<void>
|
install(setupSettings: ISetupSettings): Promise<void>
|
||||||
@@ -14,19 +13,12 @@ export interface IGitVersionTool extends IDotnetTool {
|
|||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||||
constructor(
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
|
||||||
@inject(TYPES.IVersionManager) versionManager: IVersionManager
|
|
||||||
) {
|
|
||||||
super(buildAgent, versionManager)
|
super(buildAgent, versionManager)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async install(setupSettings: ISetupSettings): Promise<void> {
|
public async install(setupSettings: ISetupSettings): Promise<void> {
|
||||||
await this.toolInstall(
|
await this.toolInstall('GitVersion.Tool', setupSettings)
|
||||||
'GitVersion.Tool',
|
|
||||||
false,
|
|
||||||
setupSettings
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(options: GitVersionSettings): Promise<IExecResult> {
|
public run(options: GitVersionSettings): Promise<IExecResult> {
|
||||||
@@ -52,33 +44,16 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
|||||||
return workDir.replace(/\\/g, '/')
|
return workDir.replace(/\\/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
private getArguments(
|
private getArguments(workDir: string, options: GitVersionSettings): string[] {
|
||||||
workDir: string,
|
|
||||||
options: GitVersionSettings
|
|
||||||
): string[] {
|
|
||||||
let args = [workDir, '/output', 'json', '/output', 'buildserver']
|
let args = [workDir, '/output', 'json', '/output', 'buildserver']
|
||||||
|
|
||||||
const {
|
const { useConfigFile, configFilePath, updateAssemblyInfo, updateAssemblyInfoFilename, additionalArguments } = options
|
||||||
useConfigFile,
|
|
||||||
configFilePath,
|
|
||||||
updateAssemblyInfo,
|
|
||||||
updateAssemblyInfoFilename,
|
|
||||||
additionalArguments
|
|
||||||
} = options
|
|
||||||
|
|
||||||
if (useConfigFile) {
|
if (useConfigFile) {
|
||||||
if (
|
if (this.buildAgent.isValidInputFile('configFilePath', configFilePath)) {
|
||||||
this.buildAgent.isValidInputFile(
|
|
||||||
'configFilePath',
|
|
||||||
configFilePath
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
args.push('/config', configFilePath)
|
args.push('/config', configFilePath)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error('GitVersion configuration file not found at ' + configFilePath)
|
||||||
'GitVersion configuration file not found at ' +
|
|
||||||
configFilePath
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (updateAssemblyInfo) {
|
if (updateAssemblyInfo) {
|
||||||
@@ -86,18 +61,10 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
|||||||
|
|
||||||
// You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.
|
// You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.
|
||||||
if (updateAssemblyInfoFilename?.length > 0) {
|
if (updateAssemblyInfoFilename?.length > 0) {
|
||||||
if (
|
if (this.buildAgent.isValidInputFile('updateAssemblyInfoFilename', updateAssemblyInfoFilename)) {
|
||||||
this.buildAgent.isValidInputFile(
|
|
||||||
'updateAssemblyInfoFilename',
|
|
||||||
updateAssemblyInfoFilename
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
args.push(updateAssemblyInfoFilename)
|
args.push(updateAssemblyInfoFilename)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error('AssemblyInfoFilename file not found at ' + updateAssemblyInfoFilename)
|
||||||
'AssemblyInfoFilename file not found at ' +
|
|
||||||
updateAssemblyInfoFilename
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,6 +83,9 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
|||||||
const name = this.toCamelCase(property)
|
const name = this.toCamelCase(property)
|
||||||
const value = gitversionOutput[property]
|
const value = gitversionOutput[property]
|
||||||
this.buildAgent.setOutput(name, value)
|
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 {
|
private toCamelCase(input: string): string {
|
||||||
return input.replace(
|
return input.replace(/^\w|[A-Z]|\b\w|\s+/g, function (match, index) {
|
||||||
/(?:^\w|[A-Z]|\b\w|\s+)/g,
|
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
||||||
function (match, index) {
|
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
||||||
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
})
|
||||||
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "CommonJS",
|
"module": "ES2022",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"target": "ES2016",
|
"target": "es2017",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": ["ES2016"],
|
"lib": [ "ES2016" ],
|
||||||
"types": ["reflect-metadata"],
|
"types": [ "reflect-metadata" ],
|
||||||
"esModuleInterop":true,
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true
|
"emitDecoratorMetadata": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function getConfig(mode, agent, entry) {
|
|||||||
entry: entry,
|
entry: entry,
|
||||||
target: 'node',
|
target: 'node',
|
||||||
mode: mode,
|
mode: mode,
|
||||||
devtool: mode == 'development' ? 'inline-source-map' : false,
|
devtool: mode === 'development' ? 'inline-source-map' : false,
|
||||||
module: {
|
module: {
|
||||||
rules: [{
|
rules: [{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
@@ -43,7 +43,10 @@ function getConfig(mode, agent, entry) {
|
|||||||
replace: 'let pkg = { version: "1.2.3" };'
|
replace: 'let pkg = { version: "1.2.3" };'
|
||||||
}]
|
}]
|
||||||
}])
|
}])
|
||||||
]
|
],
|
||||||
|
experiments: {
|
||||||
|
topLevelAwait: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,10 +65,10 @@ const entryPoints = [
|
|||||||
module.exports = (env) => {
|
module.exports = (env) => {
|
||||||
const task = env.task || 'compile';
|
const task = env.task || 'compile';
|
||||||
const agent = env.agent || 'mock';
|
const agent = env.agent || 'mock';
|
||||||
const mode = task == 'compile' ? 'development' : 'production';
|
const mode = task === 'compile' ? 'development' : 'production';
|
||||||
const entry = {};
|
const entry = {};
|
||||||
entryPoints.forEach(key => {
|
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);
|
entry[key] = path.resolve(__dirname, resource);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user