Skip to content

Commit 2e31462

Browse files
authored
Update ci.yml
1 parent 9e34363 commit 2e31462

1 file changed

Lines changed: 50 additions & 65 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
3.1.x
6262
6.0.x
6363
8.0.x
64+
cache: true
6465

6566
- name: Display dotnet version
6667
run: dotnet --info
@@ -97,6 +98,13 @@ jobs:
9798
-p:RepositoryBranch="${{ github.ref_name }}"
9899
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
99100
101+
- name: Upload release bundle
102+
uses: actions/upload-artifact@v4
103+
if: ${{ matrix.configuration == 'Release' && matrix.os == 'windows-latest' && steps.build.conclusion == 'success' }}
104+
with:
105+
name: bundle-${{ matrix.configuration }}
106+
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}
107+
100108
- name: Test
101109
if: ${{ !matrix.coverage }}
102110
run: >
@@ -120,33 +128,6 @@ jobs:
120128
with:
121129
name: test-results
122130
path: TestResults
123-
124-
- name: Prepare package
125-
if: ${{ matrix.configuration == 'Release' }}
126-
run: >
127-
dotnet publish "${{ env.PUBLISH_PROJECT_PATH }}" --no-build
128-
-p:TargetFramework=netcoreapp3.1
129-
-p:Configuration=${{ matrix.configuration }}
130-
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
131-
-p:PublishDir="${{ env.PUBLISH_PATH }}/Release/netcoreapp3.1"
132-
&&
133-
dotnet publish "${{ env.PUBLISH_PROJECT_PATH }}" --no-build
134-
-p:TargetFramework=net6.0
135-
-p:Configuration=${{ matrix.configuration }}
136-
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
137-
-p:PublishDir="${{ env.PUBLISH_PATH }}/Release/net6.0"
138-
&&
139-
dotnet publish "${{ env.PUBLISH_PROJECT_PATH }}" --no-build
140-
-p:TargetFramework=net8.0
141-
-p:Configuration=${{ matrix.configuration }}
142-
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
143-
-p:PublishDir="${{ env.PUBLISH_PATH }}/Release/net8.0"
144-
145-
- name: list
146-
if: ${{ matrix.configuration == 'Release' }}
147-
run: |
148-
cd "${{ env.PUBLISH_PATH }}"
149-
ls -R
150131

151132
- name: Test Report
152133
uses: dorny/test-reporter@v2
@@ -156,27 +137,6 @@ jobs:
156137
path: '**/TestResults/*.trx,*.trx'
157138
reporter: dotnet-trx
158139

159-
- name: Upload build artifacts 3.1
160-
uses: actions/upload-artifact@v4
161-
if: ${{ matrix.configuration == 'Release' && matrix.os == 'windows-latest' && steps.build.conclusion == 'success' }}
162-
with:
163-
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-netcoreapp3.1
164-
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/netcoreapp3.1
165-
166-
- name: Upload build artifacts 6.0
167-
uses: actions/upload-artifact@v4
168-
if: ${{ matrix.configuration == 'Release' && matrix.os == 'windows-latest' && steps.build.conclusion == 'success' }}
169-
with:
170-
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-net6.0
171-
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/net6.0
172-
173-
- name: Upload build artifacts 8.0
174-
uses: actions/upload-artifact@v4
175-
if: ${{ matrix.configuration == 'Release' && matrix.os == 'windows-latest' && steps.build.conclusion == 'success' }}
176-
with:
177-
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-net8.0
178-
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/net8.0
179-
180140
report:
181141
needs: build
182142
if: always()
@@ -220,20 +180,52 @@ jobs:
220180
if: steps.create_coverage_badge.outcome == 'success'
221181
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"
222182

183+
repack-per-framework:
184+
name: Repackage per framework
185+
if: always()
186+
needs: [build, semver]
187+
runs-on: ubuntu-latest
188+
189+
strategy:
190+
fail-fast: false
191+
matrix:
192+
app-dotnet: [netcoreapp3.1, net6.0, net8.0]
193+
configuration: [Release]
194+
195+
steps:
196+
- name: Grab bundle
197+
id: cli
198+
uses: actions/download-artifact@v4
199+
with:
200+
name: bundle-${{ matrix.configuration }}
201+
path: ${{ env.OUTPUT_PATH }}
202+
203+
- name: Prepare publish package for
204+
if: ${{ matrix.configuration == 'Release' }}
205+
run: >
206+
dotnet publish "${{ env.PUBLISH_PROJECT_PATH }}" --no-build
207+
-p:TargetFramework=${{ matrix.app-dotnet }}
208+
-p:Configuration=${{ matrix.configuration }}
209+
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
210+
-p:PublishDir="${{ env.PUBLISH_PATH }}/Release/${{ matrix.app-dotnet }}"
211+
212+
- name: Upload build for ${{ matrix.app-dotnet }}
213+
uses: actions/upload-artifact@v4
214+
with:
215+
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-${{ matrix.app-dotnet }}
216+
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/${{ matrix.app-dotnet }}
217+
223218
repack-with-plugins:
224219
name: Repackage with plugins
225220
if: always()
226-
needs: [build, semver]
221+
needs: [build, semver, repack-per-framework]
227222
runs-on: ubuntu-latest
228-
229-
defaults:
230-
run:
231-
shell: bash
232223

233224
strategy:
234225
fail-fast: false
235226
matrix:
236227
# plugin: [TeamTools.Linter.TSQL, TeamTools.Linter.SSDT]
228+
configuration: [Release]
237229
dotnet: [netstandard2.0, net6.0, net8.0]
238230
include:
239231
- dotnet: net6.0
@@ -248,8 +240,8 @@ jobs:
248240
id: cli
249241
uses: actions/download-artifact@v4
250242
with:
251-
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-Release-${{ matrix.app-dotnet }}
252-
path: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-Release-${{ matrix.app-dotnet }}
243+
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-${{ matrix.app-dotnet }}
244+
path: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-${{ matrix.app-dotnet }}
253245

254246
- name: Grab TSQL plugin ${{ matrix.dotnet }}
255247
uses: dawidd6/action-download-artifact@v11
@@ -259,7 +251,7 @@ jobs:
259251
workflow: ci.yml
260252
workflow_conclusion: completed
261253
branch: main
262-
name: TeamTools\.Linter\.TSQL-[\d.]+-Release-${{ matrix.dotnet }}
254+
name: TeamTools\.Linter\.TSQL-[\d.]+-${{ matrix.configuration }}-${{ matrix.dotnet }}
263255
name_is_regexp: true
264256
path: ${{ steps.cli.outputs.download-path }}/Plugins
265257

@@ -271,7 +263,7 @@ jobs:
271263
workflow: ci.yml
272264
workflow_conclusion: completed
273265
branch: main
274-
name: TeamTools\.Linter\.SSDT-[\d.]+-Release-${{ matrix.dotnet }}
266+
name: TeamTools\.Linter\.SSDT-[\d.]+-${{ matrix.configuration }}-${{ matrix.dotnet }}
275267
name_is_regexp: true
276268
path: ${{ steps.cli.outputs.download-path }}/Plugins
277269

@@ -285,15 +277,8 @@ jobs:
285277
mv "${dir}" "TeamTools.Linter.SSDT";
286278
done
287279
288-
- name: Remove dev config
289-
if: ${{ matrix.app-dotnet == 'netcoreapp3.1' }}
290-
run: |
291-
cd "${{ steps.cli.outputs.download-path }}"
292-
ls *.json
293-
rm -f TeamTools.Linter.CommandLine.runtimeconfig.dev.json
294-
295280
- name: Upload repack
296281
uses: actions/upload-artifact@v4
297282
with:
298-
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-Release-${{ matrix.app-dotnet }}-with-plugins-TSQL-SSDT
283+
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-${{ matrix.app-dotnet }}-with-plugins-TSQL-SSDT
299284
path: ${{ steps.cli.outputs.download-path }}

0 commit comments

Comments
 (0)