forked from microsoft/formula
-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (79 loc) · 3.72 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: .NET
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- name: Restore dependencies
working-directory: ./Src/CommandLine
run: dotnet restore CommandLine.sln
- name: Build
working-directory: ./Src/CommandLine
run: dotnet build CommandLine.sln /p:Configuration=Release /p:Platform=x64
- name: Pack Nuget Package (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' && github.ref_name == 'master' }}
working-directory: ./Src/CommandLine
run: dotnet pack CommandLine.csproj -c Release -p:PackageVersion="1.0.${{ github.run_number }}" /p:Platform=x64
- name: Publish Nuget Package (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' && github.ref_name == 'master' }}
working-directory: ./nupkg
run: dotnet nuget push VUISIS.Formula.x64.1.0.${{ github.run_number }}.nupkg --api-key ${{ secrets.BUILD_SECRET }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Test Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./Src/Tests
run: |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/Src/CommandLine/bin/Release/Linux/x64/net6.0/runtimes/linux-x64/native
dotnet test Tests.csproj --logger "console;verbosity=detailed" /p:Configuration=Release /p:Platform=x64
- name: Test Windows
if: ${{ matrix.os == 'windows-latest' }}
working-directory: ./Src/Tests
run: |
set PATH="%PATH%;${GITHUB_WORKSPACE}\Src\CommandLine\bin\Release\Windows\x64\net6.0\runtimes\win-x64\native"
dotnet test Tests.csproj --logger "console;verbosity=detailed" /p:Configuration=Release /p:Platform=x64
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- name: Restore dependencies
working-directory: ./Src/CommandLine
run: dotnet restore CommandLine.sln
- name: Build
working-directory: ./Src/CommandLine
run: dotnet build CommandLine.sln /p:Configuration=Release /p:Platform=ARM64
- name: Pack Nuget Package (macOS)
if: github.ref_name == 'master'
working-directory: ./Src/CommandLine
run: dotnet pack CommandLine.csproj -c Release -p:PackageVersion="1.0.${{ github.run_number }}" /p:Platform=ARM64
- name: Publish Nuget Package (macOS)
if: github.ref_name == 'master'
working-directory: ./nupkg
run: dotnet nuget push VUISIS.Formula.ARM64.1.0.${{ github.run_number }}.nupkg --api-key ${{ secrets.BUILD_SECRET }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Copy to Liblibz3 MacOS
run: cp ${GITHUB_WORKSPACE}/Src/CommandLine/bin/Release/MacOS/ARM64/net6.0/runtimes/osx-ARM64/native/libz3.dylib ${GITHUB_WORKSPACE}/Src/CommandLine/bin/Release/MacOS/ARM64/net6.0/runtimes/osx-ARM64/native/liblibz3.dylib
- name: Test MacOS
working-directory: ./Src/Tests
run: |
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/Src/CommandLine/bin/Release/MacOS/ARM64/net6.0/runtimes/osx-ARM64/native
dotnet test Tests.csproj --logger "console;verbosity=detailed" /p:Configuration=Release /p:Platform=ARM64