1
1
name : Continuous Integration
2
2
on :
3
3
push :
4
- branches :
5
- - develop
4
+ branches : [develop]
6
5
pull_request :
7
6
branches : [develop]
8
7
workflow_dispatch :
8
+ workflow_call :
9
9
jobs :
10
- build-windows :
11
- name : Build Windows x64
12
- runs-on : windows-2019
13
- steps :
14
- - name : Checkout sources
15
- uses : actions/checkout@v4
16
- with :
17
- fetch-depth : 0
18
- - name : Setup .NET
19
- uses : actions/setup-dotnet@v4
20
- with :
21
- dotnet-version : 8.0.x
22
- - name : Build
23
- run : dotnet build -c Release
24
- - name : Publish
25
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64
26
- - name : Upload Artifact
27
- uses : actions/upload-artifact@v4
28
- with :
29
- name : sourcegit.win-x64
30
- path : publish
31
- build-macos-intel :
32
- name : Build macOS (Intel)
33
- runs-on : macos-13
34
- steps :
35
- - name : Checkout sources
36
- uses : actions/checkout@v4
37
- with :
38
- fetch-depth : 0
39
- - name : Setup .NET
40
- uses : actions/setup-dotnet@v4
41
- with :
42
- dotnet-version : 8.0.x
43
- - name : Build
44
- run : dotnet build -c Release
45
- - name : Publish
46
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64
47
- - name : Packing Program
48
- run : tar -cvf sourcegit.osx-x64.tar -C publish/ .
49
- - name : Upload Artifact
50
- uses : actions/upload-artifact@v4
51
- with :
52
- name : sourcegit.osx-x64
53
- path : sourcegit.osx-x64.tar
54
- build-macos-arm64 :
55
- name : Build macOS (Apple Silicon)
56
- runs-on : macos-latest
57
- steps :
58
- - name : Checkout sources
59
- uses : actions/checkout@v4
60
- with :
61
- fetch-depth : 0
62
- - name : Setup .NET
63
- uses : actions/setup-dotnet@v4
64
- with :
65
- dotnet-version : 8.0.x
66
- - name : Build
67
- run : dotnet build -c Release
68
- - name : Publish
69
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64
70
- - name : Packing Program
71
- run : tar -cvf sourcegit.osx-arm64.tar -C publish/ .
72
- - name : Upload Artifact
73
- uses : actions/upload-artifact@v4
74
- with :
75
- name : sourcegit.osx-arm64
76
- path : sourcegit.osx-arm64.tar
77
- build-linux :
78
- name : Build Linux
79
- runs-on : ubuntu-20.04
10
+ build :
11
+ strategy :
12
+ matrix :
13
+ include :
14
+ - name : Windows x64
15
+ os : windows-2019
16
+ runtime : win-x64
17
+ - name : Windows ARM64
18
+ os : windows-2019
19
+ runtime : win-arm64
20
+ - name : macOS (Intel)
21
+ os : macos-13
22
+ runtime : osx-x64
23
+ - name : macOS (Apple Silicon)
24
+ os : macos-latest
25
+ runtime : osx-arm64
26
+ - name : Linux
27
+ os : ubuntu-20.04
28
+ runtime : linux-x64
29
+ - name : Linux (arm64)
30
+ os : ubuntu-20.04
31
+ runtime : linux-arm64
32
+ name : Build ${{ matrix.name }}
33
+ runs-on : ${{ matrix.os }}
80
34
steps :
81
35
- name : Checkout sources
82
36
uses : actions/checkout@v4
83
- with :
84
- fetch-depth : 0
85
- - name : Setup .NET
86
- uses : actions/setup-dotnet@v4
87
- with :
88
- dotnet-version : 8.0.x
89
- - name : Build
90
- run : dotnet build -c Release
91
- - name : Publish
92
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64
93
- - name : Rename Executable File
94
- run : mv publish/SourceGit publish/sourcegit
95
- - name : Packing Program
96
- run : tar -cvf sourcegit.linux-x64.tar -C publish/ .
97
- - name : Upload Artifact
98
- uses : actions/upload-artifact@v4
99
- with :
100
- name : sourcegit.linux-x64
101
- path : sourcegit.linux-x64.tar
102
- build-linux-arm64 :
103
- name : Build Linux (arm64)
104
- runs-on : ubuntu-20.04
105
- steps :
106
- - name : Checkout sources
107
- uses : actions/checkout@v4
108
- with :
109
- fetch-depth : 0
110
37
- name : Setup .NET
111
38
uses : actions/setup-dotnet@v4
112
39
with :
113
40
dotnet-version : 8.0.x
114
41
- name : Configure arm64 packages
42
+ if : ${{ matrix.runtime == 'linux-arm64' }}
115
43
run : |
116
44
sudo dpkg --add-architecture arm64
117
45
echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
@@ -121,19 +49,25 @@ jobs:
121
49
sudo sed -i -e 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
122
50
sudo sed -i -e 's/^deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
123
51
- name : Install cross-compiling dependencies
52
+ if : ${{ matrix.runtime == 'linux-arm64' }}
124
53
run : |
125
54
sudo apt-get update
126
55
sudo apt-get install clang llvm gcc-aarch64-linux-gnu zlib1g-dev:arm64
127
56
- name : Build
128
57
run : dotnet build -c Release
129
58
- name : Publish
130
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-arm64
131
- - name : Rename Executable File
59
+ run : dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }}
60
+ - name : Rename executable file
61
+ if : ${{ startsWith(matrix.runtime, 'linux-') }}
132
62
run : mv publish/SourceGit publish/sourcegit
133
- - name : Packing Program
134
- run : tar -cvf sourcegit.linux-arm64.tar -C publish/ .
135
- - name : Upload Artifact
63
+ - name : Tar artifact
64
+ if : ${{ startsWith(matrix.runtime, 'linux-') }}
65
+ run : |
66
+ tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
67
+ rm -r publish/*
68
+ mv "sourcegit.${{ matrix.runtime }}.tar" publish
69
+ - name : Upload artifact
136
70
uses : actions/upload-artifact@v4
137
71
with :
138
- name : sourcegit.linux-arm64
139
- path : sourcegit.linux-arm64.tar
72
+ name : sourcegit.${{ matrix.runtime }}
73
+ path : publish
0 commit comments