@@ -21,58 +21,57 @@ jobs:
21
21
- name : Linux
22
22
os : ubuntu-latest
23
23
runtime : linux-x64
24
+ container : ubuntu:20.04
24
25
- name : Linux (arm64)
25
26
os : ubuntu-latest
26
27
runtime : linux-arm64
28
+ container : ubuntu:20.04
27
29
name : Build ${{ matrix.name }}
28
30
runs-on : ${{ matrix.os }}
31
+ container : ${{ matrix.container || '' }}
29
32
steps :
30
- # For Linux builds, we don't use containers anymore - simpler and more reliable
31
- - name : Setup Linux environment
33
+ - name : Install common CLI tools
32
34
if : startsWith(matrix.runtime, 'linux-')
33
35
run : |
34
- sudo apt-get update
35
- sudo apt-get install -y curl wget git unzip zip tzdata clang
36
-
37
- - name : Configure arm64 cross-compilation
38
- if : matrix.runtime == 'linux-arm64'
39
- run : |
40
- sudo dpkg --add-architecture arm64
41
- sudo bash -c 'cat > /etc/apt/sources.list.d/arm64-cross-compile.list << EOF
42
- deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs) main restricted universe multiverse
43
- deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe multiverse
44
- deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-security main restricted universe multiverse
45
- EOF'
46
- sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
47
- sudo sed -i 's/deb mirror/deb [arch=amd64,i386] mirror/' /etc/apt/sources.list
48
- sudo apt-get update
49
- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
50
-
36
+ export DEBIAN_FRONTEND=noninteractive
37
+ ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
38
+ apt-get update
39
+ apt-get install -y sudo
40
+ sudo apt-get install -y curl wget git unzip zip libicu66 tzdata clang
51
41
- name : Checkout sources
52
42
uses : actions/checkout@v4
53
-
54
43
- name : Setup .NET
55
44
uses : actions/setup-dotnet@v4
56
45
with :
57
46
dotnet-version : 9.0.x
58
-
47
+ - name : Configure arm64 packages
48
+ if : matrix.runtime == 'linux-arm64'
49
+ run : |
50
+ sudo dpkg --add-architecture arm64
51
+ echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
52
+ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
53
+ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted' \
54
+ | sudo tee /etc/apt/sources.list.d/arm64.list
55
+ sudo sed -i -e 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
56
+ sudo sed -i -e 's/^deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
57
+ - name : Install cross-compiling dependencies
58
+ if : matrix.runtime == 'linux-arm64'
59
+ run : |
60
+ sudo apt-get update
61
+ sudo apt-get install -y llvm gcc-aarch64-linux-gnu
59
62
- name : Build
60
63
run : dotnet build -c Release
61
-
62
64
- name : Publish
63
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }} --self-contained
64
-
65
- - name : Rename Linux executable
65
+ run : dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }}
66
+ - name : Rename executable file
66
67
if : startsWith(matrix.runtime, 'linux-')
67
68
run : mv publish/SourceGit publish/sourcegit
68
-
69
- - name : Create tar archive
69
+ - name : Tar artifact
70
70
if : startsWith(matrix.runtime, 'linux-') || startsWith(matrix.runtime, 'osx-')
71
71
run : |
72
- tar -czf "sourcegit.${{ matrix.runtime }}.tar.gz " -C publish .
72
+ tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
73
73
rm -r publish/*
74
- mv "sourcegit.${{ matrix.runtime }}.tar.gz" publish/
75
-
74
+ mv "sourcegit.${{ matrix.runtime }}.tar" publish
76
75
- name : Upload artifact
77
76
uses : actions/upload-artifact@v4
78
77
with :
0 commit comments