-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (74 loc) · 2.4 KB
/
ci.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
83
84
85
86
name: 'CI'
on:
workflow_dispatch:
inputs:
publish_release:
description: If this build should publish nuget packages
required: true
type: boolean
version_suffix:
description: Suffix of the version number. Can be used to create a preview package.
required: false
type: string
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
env:
configuration: Release
publish_release: ${{ github.event.inputs.publish_release }}
version_suffix: ${{ github.event.inputs.version_suffix }}
tester_framework: net8.0
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
steps:
- name: Checkout with submodules
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Prepare .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Verify code format
if: matrix.os == 'ubuntu-latest'
run: dotnet format --verify-no-changes
working-directory: './src'
- name: Run unit tests ubuntu
if: matrix.os == 'ubuntu-latest'
env:
RuntimeIdentifier: unix
run: dotnet test -c ${{ env.configuration }}
working-directory: './src'
- name: Run unit tests macos
if: matrix.os == 'macos-latest'
env:
RuntimeIdentifier: unix
run: dotnet test -c ${{ env.configuration }}
working-directory: './src'
- name: Run unit tests windows
if: matrix.os == 'windows-latest'
env:
RuntimeIdentifier: win
run: dotnet test -c ${{ env.configuration }}
working-directory: './src'
- name: Build solution
run: dotnet fsi build.fsx
working-directory: './src'
- name: Pack release version
if: env.publish_release == 'true' && matrix.os == 'ubuntu-latest'
run: dotnet pack WCharT.Net/WCharT.Net.csproj --no-build --nologo -c ${{ env.configuration }} --version-suffix "${{ env.version_suffix }}" -o ../Nuget
working-directory: './src'
- name: Publish to nuget org
if: env.publish_release == 'true' && matrix.os == 'ubuntu-latest'
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s nuget.org
working-directory: './Nuget'