merge: pull request #18 from gigi81/feature/git-actions

Added github actions build for windows/linux/macos
This commit is contained in:
leo 2024-03-05 09:27:25 +08:00 committed by GitHub
commit 67cfd21b38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 10 deletions

42
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Continuous Integration
on:
push:
branches:
- main
- 'feature/**'
pull_request:
branches: [main]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux-x64
- os: windows-latest
platform: win-x64
- os: macos-latest
platform: osx-x64
- os: macos-latest
platform: osx-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.platform }} -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}
path: publish

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ build
obj
*.user
.DS_Store
publish

View file

@ -1,25 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34408.163
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGit", "SourceGit.csproj", "{89AD3F88-E72C-4399-AD61-6A87FC424E7B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceGit", "src\SourceGit.csproj", "{CD98D9AA-079A-4A79-9212-850EB97CF2ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{89AD3F88-E72C-4399-AD61-6A87FC424E7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89AD3F88-E72C-4399-AD61-6A87FC424E7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89AD3F88-E72C-4399-AD61-6A87FC424E7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89AD3F88-E72C-4399-AD61-6A87FC424E7B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DA70C1D9-A8D2-4C89-98F3-B263CCBC5F28}
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CD98D9AA-079A-4A79-9212-850EB97CF2ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD98D9AA-079A-4A79-9212-850EB97CF2ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD98D9AA-079A-4A79-9212-850EB97CF2ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD98D9AA-079A-4A79-9212-850EB97CF2ED}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal