-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (115 loc) · 4.09 KB
/
MainCI.yml
File metadata and controls
132 lines (115 loc) · 4.09 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
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
name: SpaRcle Common Main CI
on:
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/checkout@v3
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}}
#HandleIssues:
# name: Issues.
# needs: [BuildWindowsJob, BuildLinuxJob]
# if: ${{ always() }}
# uses: ./.github/workflows/IssuesCI.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