@@ -21,58 +21,57 @@ jobs:
2121 - name : Linux
2222 os : ubuntu-latest
2323 runtime : linux-x64
24+ container : ubuntu:20.04
2425 - name : Linux (arm64)
2526 os : ubuntu-latest
2627 runtime : linux-arm64
28+ container : ubuntu:20.04
2729 name : Build ${{ matrix.name }}
2830 runs-on : ${{ matrix.os }}
31+ container : ${{ matrix.container || '' }}
2932 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
3234 if : startsWith(matrix.runtime, 'linux-')
3335 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
5141 - name : Checkout sources
5242 uses : actions/checkout@v4
53-
5443 - name : Setup .NET
5544 uses : actions/setup-dotnet@v4
5645 with :
5746 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
5962 - name : Build
6063 run : dotnet build -c Release
61-
6264 - 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
6667 if : startsWith(matrix.runtime, 'linux-')
6768 run : mv publish/SourceGit publish/sourcegit
68-
69- - name : Create tar archive
69+ - name : Tar artifact
7070 if : startsWith(matrix.runtime, 'linux-') || startsWith(matrix.runtime, 'osx-')
7171 run : |
72- tar -czf "sourcegit.${{ matrix.runtime }}.tar.gz " -C publish .
72+ tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
7373 rm -r publish/*
74- mv "sourcegit.${{ matrix.runtime }}.tar.gz" publish/
75-
74+ mv "sourcegit.${{ matrix.runtime }}.tar" publish
7675 - name : Upload artifact
7776 uses : actions/upload-artifact@v4
7877 with :
0 commit comments