2024-03-03 13:11:25 -08:00
|
|
|
name: Continuous Integration
|
|
|
|
on:
|
|
|
|
push:
|
2024-08-02 06:03:50 -07:00
|
|
|
branches: [develop]
|
2024-03-03 13:11:25 -08:00
|
|
|
pull_request:
|
2024-05-05 20:20:32 -07:00
|
|
|
branches: [develop]
|
2024-03-04 20:07:15 -08:00
|
|
|
workflow_dispatch:
|
2024-08-02 12:22:38 -07:00
|
|
|
workflow_call:
|
2024-03-03 13:11:25 -08:00
|
|
|
jobs:
|
2024-08-02 06:03:50 -07:00
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name : Windows x64
|
|
|
|
os: windows-2019
|
|
|
|
runtime: win-x64
|
2024-08-02 07:25:25 -07:00
|
|
|
- name : Windows ARM64
|
|
|
|
os: windows-2019
|
|
|
|
runtime: win-arm64
|
2024-08-02 06:03:50 -07:00
|
|
|
- name : macOS (Intel)
|
|
|
|
os: macos-13
|
|
|
|
runtime: osx-x64
|
|
|
|
- name : macOS (Apple Silicon)
|
|
|
|
os: macos-latest
|
|
|
|
runtime: osx-arm64
|
|
|
|
- name : Linux
|
|
|
|
os: ubuntu-20.04
|
|
|
|
runtime: linux-x64
|
|
|
|
- name : Linux (arm64)
|
|
|
|
os: ubuntu-20.04
|
|
|
|
runtime: linux-arm64
|
|
|
|
name: Build ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
2024-08-02 02:11:45 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
|
|
uses: actions/setup-dotnet@v4
|
|
|
|
with:
|
|
|
|
dotnet-version: 8.0.x
|
|
|
|
- name: Configure arm64 packages
|
2024-08-02 06:03:50 -07:00
|
|
|
if: ${{ matrix.runtime == 'linux-arm64' }}
|
2024-08-02 02:11:45 -07:00
|
|
|
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
|
2024-08-02 06:03:50 -07:00
|
|
|
if: ${{ matrix.runtime == 'linux-arm64' }}
|
2024-08-02 02:11:45 -07:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install clang llvm gcc-aarch64-linux-gnu zlib1g-dev:arm64
|
|
|
|
- name: Build
|
|
|
|
run: dotnet build -c Release
|
|
|
|
- name: Publish
|
2024-08-02 06:03:50 -07:00
|
|
|
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }}
|
|
|
|
- name: Rename executable file
|
|
|
|
if: ${{ startsWith(matrix.runtime, 'linux-') }}
|
2024-08-02 02:11:45 -07:00
|
|
|
run: mv publish/SourceGit publish/sourcegit
|
2024-08-03 06:50:57 -07:00
|
|
|
- name: Tar artifact
|
|
|
|
if: ${{ startsWith(matrix.runtime, 'linux-') }}
|
|
|
|
run: |
|
|
|
|
tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish .
|
|
|
|
rm -r publish/*
|
|
|
|
mv "sourcegit.${{ matrix.runtime }}.tar" publish
|
2024-08-02 06:03:50 -07:00
|
|
|
- name: Upload artifact
|
2024-08-02 02:11:45 -07:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-08-02 06:03:50 -07:00
|
|
|
name: sourcegit.${{ matrix.runtime }}
|
2024-08-02 08:06:42 -07:00
|
|
|
path: publish
|