-
Notifications
You must be signed in to change notification settings - Fork 14
41 lines (36 loc) · 2 KB
/
publish.yml
File metadata and controls
41 lines (36 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Publish
on:
workflow_call:
inputs:
new_tag:
type: string
required: true
secrets:
nuget-token:
required: true
jobs:
publish:
strategy:
matrix:
package: [MaintainabilityAnalyzers, DuplicateCodeAnalyzer, MoqAnalyzers, MsTestAnalyzers]
runs-on: ubuntu-latest
name: Publish
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v5
- uses: dorny/paths-filter@9d7afb8d214ad99e78fbd4247752c4caed2b6e4c #v4.0.0
id: changes
with:
filters: |
${{ matrix.package }}:
- 'Philips.CodeAnalysis.${{ matrix.package }}/**'
- name: Download artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v5
with:
name: Philips.CodeAnalysis.${{ matrix.package }}-${{ inputs.new_tag }}
- name: Nuget
if: (steps.changes.outputs.MaintainabilityAnalyzers == 'true' && matrix.package == 'MaintainabilityAnalyzers') || (steps.changes.outputs.DuplicateCodeAnalyzer == 'true' && matrix.package == 'DuplicateCodeAnalyzer') || (steps.changes.outputs.MoqAnalyzers == 'true' && matrix.package == 'MoqAnalyzers') || (steps.changes.outputs.MsTestAnalyzers == 'true' && matrix.package == 'MsTestAnalyzers') || (steps.changes.outputs.SecurityAnalyzers == 'true' && matrix.package == 'SecurityAnalyzers')
run: |
echo Publishing to Nuget Philips.CodeAnalysis.${{ matrix.package }}.${{ inputs.new_tag }}.*.nupkg >> $GITHUB_STEP_SUMMARY
echo Publishing to Nuget Philips.CodeAnalysis.${{ matrix.package }}.${{ inputs.new_tag }}.*.snupkg >> $GITHUB_STEP_SUMMARY
# dotnet nuget push Philips.CodeAnalysis.${{ matrix.package }}.${{ inputs.new_tag }}.*.nupkg --api-key ${{ secrets.nuget-token }} --source https://api.nuget.org/v3/index.json
# dotnet nuget push Philips.CodeAnalysis.${{ matrix.package }}.${{ inputs.new_tag }}.*.snupkg --api-key ${{ secrets.nuget-token }} --source https://api.nuget.org/v3/index.json