File tree Expand file tree Collapse file tree 5 files changed +56
-227
lines changed
actions/determine-version Expand file tree Collapse file tree 5 files changed +56
-227
lines changed Original file line number Diff line number Diff line change 1+ name : ' Determine version'
2+ author : ' Pete Sramek'
3+ description : ' Determines versions for the build.'
4+ inputs :
5+ # Required
6+ # Optional
7+ version-format :
8+ description : ' Version format. Default: '' (<Major>?/d+).(<Minor>?/d+)'' '
9+ required : false
10+ default : ' (<Major>?/d+).(<Minor>?/d+)'
11+ branch-name :
12+ description : ' Branch name. Default: '' ${{ github.ref_name }}'' '
13+ required : false
14+ default : ' ${{ github.ref_name }}'
15+ dotnet_sdk_version :
16+ description : ' .NET SDK version. Default: '' 9.x'' '
17+ required : false
18+ default : ' 9.x'
19+
20+ runs :
21+ using : " composite"
22+ steps :
23+ - name : ' Checkout ${{ github.head_ref || github.ref }}'
24+ uses : actions/checkout@v5
25+
26+ - name : ' Setup .NET ${{ inputs.dotnet_sdk_version }}'
27+ uses : actions/setup-dotnet@v4
28+ with :
29+ dotnet-version : ${{ inputs.dotnet_sdk_version }}
30+
31+ - name : ' Capture version in branch name'
32+ shell : bash
33+ run : |
34+ echo "branch-name=${{ inputs.branch-name }}" >> $GITHUB_ENV
35+ echo "version-format=${{ inputs.version-format }}" >> $GITHUB_ENV
36+ echo "version=$(dotnet --version | sed -E 's/([0-9]+)\.([0-9]+).*/\1.\2/')" >> $GITHUB_ENV
37+ echo "major=$(echo ${{ inputs.branch-name }} | sed -E 's/${{ inputs.version-format }}/\1/')" >> $GITHUB_ENV
38+ echo "minor=$(echo ${{ inputs.branch-name }} | sed -E 's/${{ inputs.version-format }}/\2/')" >> $GITHUB_ENV
Original file line number Diff line number Diff line change 5555 config-file-path : ' ./.gitversion/version.yml'
5656 run-number : ${{ needs.workflow-variables.outputs.github-run-number }}
5757
58+ versioning-new :
59+ name : ' Determine versions (new)'
60+ needs : [workflow-variables]
61+ runs-on : ubuntu-latest
62+ steps :
63+ - name : ' Checkout ${{ github.head_ref || github.ref }}'
64+ uses : actions/checkout@v5
65+ - name : ' Setup .NET ${{ env.dotnet-sdk-version }}'
66+ uses : actions/setup-dotnet@v4
67+ with :
68+ dotnet-version : ${{ env.dotnet-sdk-version }}
69+ - name : ' Determine versions'
70+ id : versioning
71+ uses : ' ./.github/actions/determine-version'
72+ with :
73+ branch-name : ${{ github.ref_name }}
74+ version-format : ' (<Major>?/d+).(<Minor>?/d+)'
75+
5876 build :
5977 name : ' Compile source code'
6078 needs : [workflow-variables, versioning]
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments