Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gitversion/command task/action, remove additionalArguments from gitversion/execute #1203

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .azure/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ jobs:
node gitversion/setup/main.mjs
displayName: gitversion/setup
workingDirectory: dist/vsix
- pwsh: |
# set the inputs for the 'gitversion/command' action
$env:INPUT_TARGETPATH = './'
$env:INPUT_ARGUMENTS = '/showvariable FullSemVer'

# run the 'gitversion/command' action
node gitversion/command/main.mjs
displayName: gitversion/command (showvariable)
workingDirectory: dist/vsix
- pwsh: |
# set the inputs for the 'gitversion/command' action
$env:INPUT_TARGETPATH = './'
$env:INPUT_ARGUMENTS = '/format {Major}.{Minor}'

# run the 'gitversion/command' action
node gitversion/command/main.mjs
displayName: gitversion/command (format)
workingDirectory: dist/vsix
- pwsh: |
# set the inputs for the 'gitversion/execute' action
$env:INPUT_TARGETPATH = './'
Expand Down
93 changes: 0 additions & 93 deletions .azure/example-10.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .azure/example-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
trigger: none

variables:
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 'true'
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 'true'

jobs:
- job: GitVersion_v6_same_job
displayName: GitVersion v6 (same job)
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
fetchDepth: 0

- task: gitversion/setup@2.0.1
displayName: Install GitVersion
inputs:
versionSpec: '6.x'

- task: gitversion/execute@2.0.1
displayName: Determine Version
name: version_step # step id used as reference for output values
inputs:
overrideConfig: |
update-build-number=false

- pwsh: |
echo "FullSemVer (fullSemVer) : $(fullSemVer)"
displayName: Display GitVersion variables (without prefix)

- pwsh: |
echo "FullSemVer (GitVersion_FullSemVer) : $(GitVersion_FullSemVer)"
displayName: Display GitVersion variables (with prefix)

- pwsh: |
echo "FullSemVer (version_step.fullSemVer) : $(version_step.fullSemVer)"
displayName: Display GitVersion outputs (step output without prefix)

- pwsh: |
echo "FullSemVer (version_step.GitVersion_FullSemVer) : $(version_step.GitVersion_FullSemVer)"
displayName: Display GitVersion outputs (step output with prefix)

- pwsh: |
echo "FullSemVer (env:myvar_fullSemVer) : $env:myvar_fullSemVer"
displayName: Display mapped local env (pwsh - outputs without prefix)
env:
myvar_fullSemVer: $(version_step.fullSemVer)

- pwsh: |
echo "FullSemVer (env:myvar_GitVersion_FullSemVer) : $env:myvar_GitVersion_FullSemVer"
displayName: Display mapped local env (pwsh - outputs with prefix)
env:
myvar_GitVersion_FullSemVer: $(version_step.GitVersion_FullSemVer)

- bash: |
echo "FullSemVer (myvar_fullSemVer) : $myvar_fullSemVer"
displayName: Display mapped local env (bash - outputs without prefix)
env:
myvar_fullSemVer: $(version_step.fullSemVer)

- bash: |
echo "FullSemVer (myvar_GitVersion_FullSemVer) : $myvar_GitVersion_FullSemVer"
displayName: Display mapped local env (bash - outputs with prefix)
env:
myvar_GitVersion_FullSemVer: $(version_step.GitVersion_FullSemVer)
70 changes: 44 additions & 26 deletions .azure/example-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ variables:
value: 'true'

jobs:
- job: GitVersion_v6_same_job
displayName: GitVersion v6 (same job)
- job: GitVersion_v6_cross_job
displayName: GitVersion v6 (cross job)
pool:
vmImage: ubuntu-latest
steps:
Expand All @@ -27,42 +27,60 @@ jobs:
overrideConfig: |
update-build-number=false

- job: GitVersion_v6_cross_job_consumer_without_prefix
displayName: GitVersion v6 (cross job consumer) - without prefix
dependsOn: GitVersion_v6_cross_job
condition: and(succeeded(), eq(dependencies.GitVersion_v6_cross_job.outputs['version_step.branchName'], 'main')) # use in condition
variables:
myvar_fullSemVer: $[ dependencies.GitVersion_v6_cross_job.outputs['version_step.fullSemVer'] ]
pool:
vmImage: ubuntu-latest
steps:
- pwsh: |
echo "FullSemVer (fullSemVer) : $(fullSemVer)"
displayName: Display GitVersion variables (without prefix)
echo "FullSemVer (myvar_fullSemVer) : $(myvar_fullSemVer)"
displayName: Use mapped job variables (pwsh - outputs without prefix)

- pwsh: |
echo "FullSemVer (GitVersion_FullSemVer) : $(GitVersion_FullSemVer)"
displayName: Display GitVersion variables (with prefix)
echo "FullSemVer (env:localvar_fullSemVer) : $env:localvar_fullSemVer"
displayName: Use mapped local env from job variables (pwsh - outputs without prefix)
env:
localvar_fullSemVer: $(myvar_fullSemVer)

- pwsh: |
echo "FullSemVer (version_step.fullSemVer) : $(version_step.fullSemVer)"
displayName: Display GitVersion outputs (step output without prefix)
- bash: |
echo "FullSemVer (myvar_fullSemVer) : $(myvar_fullSemVer)"
displayName: Use mapped job variables (bash - outputs without prefix)

- pwsh: |
echo "FullSemVer (version_step.GitVersion_FullSemVer) : $(version_step.GitVersion_FullSemVer)"
displayName: Display GitVersion outputs (step output with prefix)
- bash: |
echo "FullSemVer (localvar_fullSemVer) : $localvar_fullSemVer"
displayName: Use mapped local env from job variables (bash - outputs without prefix)
env:
localvar_fullSemVer: $(myvar_fullSemVer)

- job: GitVersion_v6_cross_job_consumer_with_prefix
displayName: GitVersion v6 (cross job consumer) - with prefix
dependsOn: GitVersion_v6_cross_job
condition: and(succeeded(), eq(dependencies.GitVersion_v6_cross_job.outputs['version_step.GitVersion_BranchName'], 'main')) # use in condition
variables:
myvar_GitVersion_FullSemVer: $[ dependencies.GitVersion_v6_cross_job.outputs['version_step.GitVersion_FullSemVer'] ]
pool:
vmImage: ubuntu-latest
steps:
- pwsh: |
echo "FullSemVer (env:myvar_fullSemVer) : $env:myvar_fullSemVer"
displayName: Display mapped local env (pwsh - outputs without prefix)
env:
myvar_fullSemVer: $(version_step.fullSemVer)
echo "FullSemVer (myvar_GitVersion_FullSemVer) : $(myvar_GitVersion_FullSemVer)"
displayName: Use mapped job variables (pwsh - outputs with prefix)

- pwsh: |
echo "FullSemVer (env:myvar_GitVersion_FullSemVer) : $env:myvar_GitVersion_FullSemVer"
displayName: Display mapped local env (pwsh - outputs with prefix)
echo "FullSemVer (env:localvar_GitVersion_FullSemVer) : $env:localvar_GitVersion_FullSemVer"
displayName: Use mapped local env from job variables (pwsh - outputs with prefix)
env:
myvar_GitVersion_FullSemVer: $(version_step.GitVersion_FullSemVer)
localvar_GitVersion_FullSemVer: $(myvar_GitVersion_FullSemVer)

- bash: |
echo "FullSemVer (myvar_fullSemVer) : $myvar_fullSemVer"
displayName: Display mapped local env (bash - outputs without prefix)
env:
myvar_fullSemVer: $(version_step.fullSemVer)
echo "FullSemVer (myvar_GitVersion_FullSemVer) : $(myvar_GitVersion_FullSemVer)"
displayName: Use mapped job variables (bash - outputs with prefix)

- bash: |
echo "FullSemVer (myvar_GitVersion_FullSemVer) : $myvar_GitVersion_FullSemVer"
displayName: Display mapped local env (bash - outputs with prefix)
echo "FullSemVer (localvar_GitVersion_FullSemVer) : $localvar_GitVersion_FullSemVer"
displayName: Use mapped local env from job variables (bash - outputs with prefix)
env:
myvar_GitVersion_FullSemVer: $(version_step.GitVersion_FullSemVer)
localvar_GitVersion_FullSemVer: $(myvar_GitVersion_FullSemVer)
Loading