Files
sourcegit/.github/workflows/build.yml
Sina Hinderks 9fa6a7f9d6 fix: set macOS (Intel) runner to macos-15-intel (#1960)
This is the last version supported by GitHub Actions for macOS x86_64. 
The runner image `macos-13` is now deprecated.  See
https://github.com/actions/runner-images/issues/13046.

For Apple Silicon the runner image is already set to `macos-latest`.
2025-12-08 10:22:52 +08:00

80 lines
2.9 KiB
YAML

name: Build
on:
workflow_call:
jobs:
build:
strategy:
matrix:
include:
- name: Windows x64
os: windows-2022
runtime: win-x64
- name: Windows ARM64
os: windows-2022
runtime: win-arm64
- name: macOS (Intel)
os: macos-15-intel
runtime: osx-x64
- name: macOS (Apple Silicon)
os: macos-latest
runtime: osx-arm64
- name: Linux
os: ubuntu-latest
runtime: linux-x64
container: ubuntu:20.04
- name: Linux (arm64)
os: ubuntu-latest
runtime: linux-arm64
container: ubuntu:20.04
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container || '' }}
steps:
- name: Install common CLI tools
if: startsWith(matrix.runtime, 'linux-')
run: |
export DEBIAN_FRONTEND=noninteractive
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
apt-get update
apt-get install -y sudo
sudo apt-get install -y curl wget git unzip zip libicu66 tzdata clang
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Configure arm64 packages
if: matrix.runtime == 'linux-arm64'
run: |
sudo dpkg --add-architecture arm64
echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted' \
| sudo tee /etc/apt/sources.list.d/arm64.list
sudo sed -i -e 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
sudo sed -i -e 's/^deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
- name: Install cross-compiling dependencies
if: matrix.runtime == 'linux-arm64'
run: |
sudo apt-get update
sudo apt-get install -y llvm gcc-aarch64-linux-gnu
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }}
- name: Rename executable file
if: startsWith(matrix.runtime, 'linux-')
run: mv publish/SourceGit publish/sourcegit
- name: Tar artifact
if: startsWith(matrix.runtime, 'linux-') || startsWith(matrix.runtime, 'osx-')
run: |
tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
rm -r publish/*
mv "sourcegit.${{ matrix.runtime }}.tar" publish
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sourcegit.${{ matrix.runtime }}
path: publish/*