@@ -56,11 +56,16 @@ jobs:
5656 apt update
5757 apt install -y git
5858 - uses : actions/checkout@v4
59+
60+ - name : Install build tools
61+ run : |
62+ ./scripts/container.setup.sh
5963
6064 - name : Configure
6165 run : |
6266 git config --global --add safe.directory $PWD
6367 ./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
68+
6469 - name : Build
6570 run :
6671 ./scripts/cmake.build.sh
@@ -88,12 +93,20 @@ jobs:
8893 run : choco install ninja
8994 - name : Install gcovr
9095 if : ${{ matrix.BuildType == 'Profile' }}
91- run : pip install git+https://github.com/gcovr/gcovr.git # gcovr==8.3
96+ run : pip install gcovr==8.3
9297
9398 - name : Configure
9499 run : ./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
100+
95101 - name : Build
96102 run : ./scripts/cmake.build.sh
103+ - name : Upload FileOp.7z
104+ if : always()
105+ uses : actions/upload-artifact@v4
106+ with :
107+ name : app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
108+ path : build/FileOp.7z
109+
97110 - name : Test
98111 run : |
99112 ./scripts/cmake.test.sh || ExitCode=$?
@@ -104,6 +117,12 @@ jobs:
104117 - name : Run performance test
105118 if : always()
106119 run : ./scripts/run_test_performance.sh 2>&1 | tee performance.txt
120+ - name : Upload performance report
121+ if : ${{ matrix.BuildType == 'Release' && always() }}
122+ uses : actions/upload-artifact@v4
123+ with :
124+ name : performance
125+ path : performance.txt
107126
108127 - name : Create coverage report
109128 if : ${{ matrix.BuildType == 'Profile' && always() }}
@@ -112,7 +131,6 @@ jobs:
112131 --filter src/ \
113132 --exclude-noncode-lines build \
114133 --txt coverage.txt \
115- --markdown coverage.md --markdown-title "Test coverage report" --markdown-file-link 'https://github.com/Spacetown/FileOp/blob/${{ github.sha }}/{file}' \
116134 --json coverage.json --json-pretty \
117135 --html-single-page --html-title "GCOVR report for $(git rev-parse HEAD)" --html-details coverage.html
118136 cat coverage.txt
@@ -124,32 +142,30 @@ jobs:
124142 name : coverage
125143 path : coverage.*
126144
127- - name : Upload ZIP
128- if : always()
129- uses : actions/upload-artifact@v4
130- with :
131- name : app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
132- path : build/FileOp.7z
133-
134- - name : Add job summary
135- if : ${{ matrix.BuildType == 'Profile' && always() }}
136- run : |
137- (
138- cat coverage.md
139- echo ""
140- cat performance.txt
141- ) >> $GITHUB_STEP_SUMMARY
142-
143145 deploy :
144146 needs :
145147 - container-build
146148 - build
147149 runs-on : Windows-latest
150+ permissions :
151+ contents : write
148152 steps :
149- - name : Download artifacts
153+ - uses : actions/checkout@v4
154+ - name : Set up environment
155+ run : |
156+ echo "FILEOP_VERSION=$(scripts/get_version.sh)" >> $GITHUB_ENV
157+ - name : Download apps
150158 uses : actions/download-artifact@v4
151159 with :
152160 pattern : app-*
161+ - name : Download coverage report
162+ uses : actions/download-artifact@v4
163+ with :
164+ name : coverage
165+ - name : Download performance report
166+ uses : actions/download-artifact@v4
167+ with :
168+ name : performance
153169 # cspell:ignore oapp
154170 - name : Test container release build
155171 run : |
@@ -163,3 +179,46 @@ jobs:
163179 run : |
164180 7z x -oapp-windows-profile app-windows-profile/FileOp.7z
165181 ./app-windows-profile/FileOp.exe --help
182+
183+ - name : Create release notes
184+ run : |
185+ sed -n '/^## / { p; :a; n; /^## /q; p; ba; }' Changelog.md | sed -e 's/^## /# /;' > release_notes.md
186+
187+ - name : Add job summary
188+ run : |
189+ (
190+ cat release_notes.md
191+ echo ""
192+ echo "# Test coverage report"
193+ echo ""
194+ echo '```'
195+ cat coverage.txt
196+ echo '```'
197+ echo ""
198+ cat performance.txt
199+ ) >> $GITHUB_STEP_SUMMARY
200+
201+ - name : Create new tag
202+ run : |
203+ # Set git user info
204+ git config --global user.email "noreply@zf.com"
205+ git config --global user.name "FileOp authors"
206+
207+ # Create the tag and print the output.
208+ sed -e "/^# / { s/^# //; s/$/ $(date -I)/; }" release_notes.md | tee commit_msg.txt
209+ git tag -a "$FILEOP_VERSION" -F commit_msg.txt
210+ git tag --list -n "$FILEOP_VERSION"
211+
212+ - name : Push new tag
213+ if : ${{ (github.repository == 'ZF-Group/FileOp') && (github.event.ref == 'refs/heads/main') && (env.FILEOP_VERSION != '0.0.0') }}
214+ run : |
215+ git push origin "refs/tags/$FILEOP_VERSION"
216+
217+ - name : Create release and upload build artifacts
218+ if : ${{ (github.repository == 'ZF-Group/FileOp') && (github.event.ref == 'refs/heads/main') && (env.FILEOP_VERSION != '0.0.0') }}
219+ uses : softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
220+ with :
221+ tag_name : ${{ env.FILEOP_VERSION }}
222+ body_path : release_notes.md
223+ files : ./app-windows/FileOp.exe
224+
0 commit comments