@@ -21,62 +21,60 @@ jobs:
21
21
- name : Linux
22
22
os : ubuntu-latest
23
23
runtime : linux-x64
24
- container : ubuntu:24.04
25
24
- name : Linux (arm64)
26
25
os : ubuntu-latest
27
26
runtime : linux-arm64
28
- container : ubuntu:24.04
29
27
name : Build ${{ matrix.name }}
30
28
runs-on : ${{ matrix.os }}
31
- container : ${{ matrix.container || '' }}
32
29
steps :
33
- - name : Install common CLI tools
30
+ # For Linux builds, we don't use containers anymore - simpler and more reliable
31
+ - name : Setup Linux environment
34
32
if : startsWith(matrix.runtime, 'linux-')
35
33
run : |
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 libicu74 tzdata clang
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
+
41
51
- name : Checkout sources
42
52
uses : actions/checkout@v4
43
- - name : Configure Git safe directory
44
- if : startsWith(matrix.runtime, 'linux-')
45
- run : git config --global --add safe.directory /__w/sourcegit/sourcegit
53
+
46
54
- name : Setup .NET
47
55
uses : actions/setup-dotnet@v4
48
56
with :
49
57
dotnet-version : 9.0.x
50
- - name : Configure arm64 packages
51
- if : matrix.runtime == 'linux-arm64'
52
- run : |
53
- sudo dpkg --add-architecture arm64
54
- echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted
55
- deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted
56
- deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted' \
57
- | sudo tee /etc/apt/sources.list.d/arm64.list
58
- sudo sed -i -e 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
59
- sudo sed -i -e 's/^deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
60
- - name : Install cross-compiling dependencies
61
- if : matrix.runtime == 'linux-arm64'
62
- run : |
63
- sudo apt-get update
64
- sudo apt-get install -y llvm gcc-aarch64-linux-gnu
58
+
65
59
- name : Build
66
60
run : dotnet build -c Release
61
+
67
62
- name : Publish
68
- run : dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }}
69
- - name : Rename executable file
63
+ run : dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }} --self-contained
64
+
65
+ - name : Rename Linux executable
70
66
if : startsWith(matrix.runtime, 'linux-')
71
67
run : mv publish/SourceGit publish/sourcegit
72
- - name : Tar artifact
68
+
69
+ - name : Create tar archive
73
70
if : startsWith(matrix.runtime, 'linux-') || startsWith(matrix.runtime, 'osx-')
74
71
run : |
75
- tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
72
+ tar -czf "sourcegit.${{ matrix.runtime }}.tar.gz " -C publish .
76
73
rm -r publish/*
77
- mv "sourcegit.${{ matrix.runtime }}.tar" publish
74
+ mv "sourcegit.${{ matrix.runtime }}.tar.gz" publish/
75
+
78
76
- name : Upload artifact
79
77
uses : actions/upload-artifact@v4
80
78
with :
81
79
name : sourcegit.${{ matrix.runtime }}
82
- path : publish/*
80
+ path : publish/*
0 commit comments