-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (85 loc) · 2.56 KB
/
CI.yml
File metadata and controls
98 lines (85 loc) · 2.56 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
tags:
- '*'
branches:
- master
- renovate/**
pull_request:
env:
ProjectName: ${{ github.event.repository.name }}
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
NET_VERSION: 10.0.x
jobs:
check_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.NET_VERSION }}
- name: Check .NET format
run: dotnet format -v diag --verify-no-changes
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.NET_VERSION }}
- name: Test build
run: dotnet build -c Release
- name: Run tests
working-directory: test/${{ env.ProjectName }}.Tests
run: dotnet test -c Release
- name: Run tests (Disable AVX)
if: matrix.os != 'macos-latest'
working-directory: test/${{ env.ProjectName }}.Tests
run: dotnet test -c Release
env:
DOTNET_EnableAVX: 0
build:
needs: [check_format, test]
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
NugetProjectName:
- CryptoBase
- CryptoBase.Abstractions
- CryptoBase.BouncyCastle
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.NET_VERSION }}
- name: Build
working-directory: src/${{ matrix.NugetProjectName }}
run: dotnet pack
- name: Push nuget packages
working-directory: src/${{ matrix.NugetProjectName }}/bin/Release
run: |
dotnet nuget push *.nupkg -s https://nuget.pkg.github.com/HMBSbige -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate
dotnet nuget push *.snupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false