10
10
name : Build Preparation
11
11
runs-on : ubuntu-latest
12
12
outputs :
13
- build_number : ${{ steps.gitversion .outputs.buildMetaData }}
13
+ build_number : ${{ steps.revlist .outputs.totalCommits }}
14
14
new_version : ${{ steps.gitversion.outputs.majorMinorPatch }}
15
15
major : ${{ steps.gitversion.outputs.major }}
16
16
minor : ${{ steps.gitversion.outputs.minor }}
27
27
- name : Determine Version
28
28
id : gitversion
29
29
uses :
gittools/actions/gitversion/[email protected]
30
- - name : Get branch name
31
- id : branchname
32
-
30
+ - name : Get Commits From Source
31
+ id : revlist
32
+ shell : pwsh
33
+ run : |
34
+ $commits = git rev-list HEAD --count
35
+ Write-Output "::set-output name=totalCommits::$commits"
33
36
- name : Display GitVersion outputs
34
37
run : |
35
38
echo "Major: ${{ steps.gitversion.outputs.major }}"
64
67
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
65
68
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
66
69
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
70
+ echo "TotalCommits: ${{ steps.revlist.outputs.totalCommits }}"
67
71
build :
68
72
name : Build (Visual Studio)
69
73
needs : pre_job
73
77
new_version : ${{ needs.pre_job.outputs.new_version }}
74
78
steps :
75
79
- uses : actions/checkout@v4
80
+ with :
81
+ fetch-depth : 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
76
82
- name : Run Upversion
77
83
id : upversion
78
84
shell : pwsh
84
90
PATCHVERSION : ${{ needs.pre_job.outputs.patch }}
85
91
- name : Checkout submodules
86
92
run : git submodule update --init --recursive
87
- - name : Remove .git folders
88
- shell : bash
89
- run : rm -rf .git
90
93
- name : Turn on problem matcher
91
94
uses : ammaraskar/msvc-problem-matcher@master
92
- - name : Remove .git folders
93
- shell : bash
94
- run : rm -rf .git
95
95
- name : Run build powershell
96
96
shell : pwsh
97
97
run : |
@@ -126,6 +126,8 @@ jobs:
126
126
new_version : ${{ needs.pre_job.outputs.new_version }}
127
127
steps :
128
128
- uses : actions/checkout@v4
129
+ with :
130
+ fetch-depth : 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
129
131
- name : Run Upversion
130
132
id : upversion
131
133
shell : pwsh
@@ -137,14 +139,8 @@ jobs:
137
139
PATCHVERSION : ${{ needs.pre_job.outputs.patch }}
138
140
- name : Checkout submodules
139
141
run : git submodule update --init --recursive
140
- - name : Remove .git folders
141
- shell : bash
142
- run : rm -rf .git
143
142
- name : Turn on problem matcher
144
143
uses : ammaraskar/msvc-problem-matcher@master
145
- - name : Remove .git folders
146
- shell : bash
147
- run : rm -rf .git
148
144
- name : Run build-x32 powershell
149
145
shell : pwsh
150
146
run : |
@@ -190,25 +186,6 @@ jobs:
190
186
PATCHVERSION : ${{ needs.pre_job.outputs.patch }}
191
187
- name : Checkout submodules
192
188
run : git submodule update --init --recursive
193
- - name : Remove .git folders
194
- shell : bash
195
- run : rm -rf .git
196
- - name : Create tar.gz
197
- shell : bash
198
- run : |
199
- touch odamex-src-${{ env.new_version }}.tar.gz
200
- tar --transform 's,^,odamex-src-${{ env.new_version }}/,' --exclude='*.zip' --exclude='*.tar.gz' --exclude='*.tar.xz' --exclude-vcs -czvf odamex-src-${{ env.new_version }}.tar.gz **
201
- - name : Create tar.xz
202
- shell : bash
203
- run : |
204
- touch odamex-src-${{ env.new_version }}.tar.xz
205
- tar --transform 's,^,odamex-src-${{ env.new_version }}/,' --exclude='*.zip' --exclude='*.tar.gz' --exclude='*.tar.xz' --exclude-vcs -cJvf odamex-src-${{ env.new_version }}.tar.xz **
206
- - name : Create zip
207
- shell : pwsh
208
- run : |
209
- Copy-Item -Recurse -Force -Path "." -Destination "..\odamex-src-${{ env.new_version }}" -Exclude "*.zip","*.tar.gz","*.tar.xz"
210
- Remove-Item -Path "..\odamex-src-${{ env.new_version }}\.git*" -Recurse -Force
211
- Compress-Archive -Path "..\odamex-src-${{ env.new_version }}" -DestinationPath "odamex-src-${{ env.new_version }}.zip"
212
189
- name : Download x86 artifacts
213
190
uses : actions/download-artifact@v4
214
191
with :
@@ -226,21 +203,6 @@ jobs:
226
203
with :
227
204
name : Odamex-Installer
228
205
path : ' Output/*.exe'
229
- - name : Upload tar.xz
230
- uses : actions/upload-artifact@v4
231
- with :
232
- name : Odamex-tar-xz
233
- path : ' ./*.tar.xz'
234
- - name : Upload tar.gz
235
- uses : actions/upload-artifact@v4
236
- with :
237
- name : Odamex-tar-gz
238
- path : ' ./*.tar.gz'
239
- - name : Upload zip
240
- uses : actions/upload-artifact@v4
241
- with :
242
- name : Odamex-src-zip
243
- path : ' ./odamex-src-${{ env.new_version }}.zip'
244
206
# build-mingw:
245
207
# name: Build (MinGW)
246
208
# runs-on: windows-latest
0 commit comments