-
-
Notifications
You must be signed in to change notification settings - Fork 12
133 lines (116 loc) · 4.11 KB
/
MainCI.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: SpaRcle Engine Main CI
on:
workflow_dispatch:
push:
paths-ignore:
- 'Documentation/**'
- '**.md'
branches:
- master
- dev
- features/*
pull_request:
paths-ignore:
- 'Documentation/**'
- '**.md'
branches:
- master
- dev
- features/*
jobs:
manage:
name: Choose platforms.
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '#SR_CI_NONE')"
outputs:
buildRelease: ${{ steps.globals.outputs.buildRelease }}
buildDebug: ${{ steps.globals.outputs.buildDebug }}
artifactPush: ${{ steps.globals.outputs.artifactPush }}
buildWindows: ${{ steps.globals.outputs.buildWindows }}
buildLinux: ${{ steps.globals.outputs.buildLinux }}
steps:
- name: Fetching repository.
uses: actions/[email protected]
with:
fetch-depth: 1
- if: "contains(github.event.head_commit.message, '#SR_CI_RELEASE')"
name: Handling "#SR_CI_RELEASE" argument.
shell: bash
run: |
echo "buildRelease=true" >> "$GITHUB_ENV"
- if: "contains(github.event.head_commit.message, '#SR_CI_DEBUG')"
name: Handling "#SR_CI_DEBUG" argument.
shell: bash
run: |
echo "buildDebug=true" >> "$GITHUB_ENV"
- if: "contains(github.event.head_commit.message, '#SR_CI_ALL')"
name: Handling "#SR_CI_ALL" argument.
shell: bash
run: |
echo "buildRelease=true" >> "$GITHUB_ENV"
echo "buildDebug=true" >> "$GITHUB_ENV"
- if: "contains(github.event.head_commit.message, '#SR_CI_ARTIFACT')"
name: Handling "#SR_CI_ARTIFACT" argument.
shell: bash
run: |
echo "artifactPush=true" >> $GITHUB_ENV
- if: "contains(github.event.head_commit.message, '#SR_CI_LINUX')"
name: Handling "#SR_CI_LINUX" argument.
shell: bash
run: |
echo "buildLinux=true" >> "$GITHUB_ENV"
- if: "contains(github.event.head_commit.message, '#SR_CI_WINDOWS')"
name: Handling "#SR_CI_WINDOWS" argument.
shell: bash
run: |
echo "buildWindows=true" >> "$GITHUB_ENV"
- if: env.buildRelease != 'true' && env.buildDebug != 'true'
name: Setting default build type.
shell: bash
run: |
echo "buildDebug=true" >> "$GITHUB_ENV"
- if: env.buildWindows != 'true' && env.buildLinux != 'true'
name: Setting default platform type.
shell: bash
run: |
echo "buildWindows=true" >> "$GITHUB_ENV"
echo "buildLinux=true" >> "$GITHUB_ENV"
- name: Set global variables.
id: globals
run: |
echo "buildDebug=${{env.buildDebug}}" >> $GITHUB_OUTPUT
echo "buildRelease=${{env.buildRelease}}" >> $GITHUB_OUTPUT
echo "buildWindows=${{env.buildWindows}}" >> $GITHUB_OUTPUT
echo "buildLinux=${{env.buildLinux}}" >> $GITHUB_OUTPUT
echo "artifactPush=${{env.artifactPush}}" >> $GITHUB_OUTPUT
BuildWindowsJob:
name: Windows.
needs: [manage]
if: needs.manage.outputs.buildWindows == 'true'
uses: ./.github/workflows/WindowsCI.yml
with:
buildRelease: ${{needs.manage.outputs.buildRelease}}
buildDebug: ${{needs.manage.outputs.buildDebug}}
artifactPush: ${{needs.manage.outputs.artifactPush}}
BuildLinuxJob:
name: Linux.
needs: [manage]
if: needs.manage.outputs.buildLinux == 'true'
uses: ./.github/workflows/LinuxCI.yml
with:
buildRelease: ${{needs.manage.outputs.buildRelease}}
buildDebug: ${{needs.manage.outputs.buildDebug}}
artifactPush: ${{needs.manage.outputs.artifactPush}}
PostBuild:
name: PostBuild.
needs: [BuildWindowsJob, BuildLinuxJob]
if: ${{ always() }}
uses: ./.github/workflows/PostBuild.yml
with:
windowsBuildState: ${{needs.BuildWindowsJob.result}}
linuxBuildState: ${{needs.BuildLinuxJob.result}}
commitActor: ${{github.actor}}
commitSha: ${{github.sha}}
commitBranch: ${{github.ref_name}}
commitMessage: ${{github.event.head_commit.message}}
secrets: inherit