-
Notifications
You must be signed in to change notification settings - Fork 5
108 lines (101 loc) · 2.98 KB
/
cicd.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: '♻️ CI/CD'
on:
pull_request:
paths:
- 'GitVersion.yml'
- 'src/**'
- '!src/qodana.yml'
- '.github/actions/**'
- '.github/workflows/**'
- '!.github/workflows/codeql.yml'
- '!.github/workflows/fossa-scan.yml'
- '!.github/workflows/qodana.yml'
- '!.github/workflows/semgrep.yml'
- '!.github/workflows/snyk.yml'
types: [opened, synchronize, reopened]
push:
branches:
- 'master'
paths:
- 'GitVersion.yml'
- 'src/**'
- '!src/qodana.yml'
- '.github/actions/**'
- '.github/workflows/**'
- '!.github/workflows/codeql.yml'
- '!.github/workflows/fossa-scan.yml'
- '!.github/workflows/qodana.yml'
- '!.github/workflows/semgrep.yml'
- '!.github/workflows/snyk.yml'
workflow_dispatch:
inputs:
buildAutoFakeItEasy:
description: 'Build AutoFakeItEasy'
required: true
type: boolean
default: true
buildAutoMoq:
description: 'Build AutoMoq'
required: true
type: boolean
default: true
buildAutoNSubstitute:
description: 'Build AutoNSubstitute'
required: true
type: boolean
default: true
environment:
description: 'Environment'
type: environment
required: true
default: prod
defaults:
run:
shell: pwsh
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
init:
permissions:
contents: read
uses: ./.github/workflows/init.yml
with:
buildAutoFakeItEasy: ${{github.event_name != 'workflow_dispatch' || inputs.buildAutoFakeItEasy == true}}
buildAutoMoq: ${{github.event_name != 'workflow_dispatch' || inputs.buildAutoMoq == true}}
buildAutoNSubstitute: ${{github.event_name != 'workflow_dispatch' || inputs.buildAutoNSubstitute == true}}
build-test-pack:
needs: [init]
if: ${{ needs.init.outputs.modules != '' }}
permissions:
contents: read
strategy:
matrix:
module-name: ${{ fromJSON(needs.init.outputs.modules) }}
uses: ./.github/workflows/build-test-pack.yml
with:
configuration: ${{ needs.init.outputs.configuration }}
module-name: ${{ matrix.module-name }}
module-namespace: ${{ needs.init.outputs.namespace }}
version: ${{ needs.init.outputs.version }}
secrets:
signing-key-value: ${{ secrets.SIGNING_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
publish:
needs: [build-test-pack]
if: ${{ inputs.environment != null }}
permissions:
packages: write
uses: ./.github/workflows/publish.yml
with:
environment: ${{ inputs.environment }}
secrets: inherit
tag:
needs: [publish, init]
# Allow tagging only on the master branch when publish was successful
if: ${{ github.ref_name == 'master' && needs.publish.result == 'success' }}
permissions:
contents: write
uses: ./.github/workflows/tag.yml
with:
version: ${{ needs.init.outputs.version }}