Skip to content

Commit e3b9348

Browse files
committed
Add CI
1 parent 3b84571 commit e3b9348

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: '**'
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Setup .NET Core
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: '7.0.x'
22+
23+
- name: Install dependencies
24+
run: dotnet restore
25+
26+
- name: Build
27+
run: dotnet build --configuration Release --no-restore
28+
29+
- name: Test
30+
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
31+
32+
- name: Get version
33+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
34+
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV
35+
36+
- name: Pack
37+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
38+
run: dotnet pack --configuration Release -o artifacts/ -p:Version=$VERSION
39+
40+
- name: Push
41+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
42+
run: dotnet nuget push artifacts/**.nupkg -s nuget.org --api-key ${{secrets.NUGET_API_KEY}}

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<ImplicitUsings>enable</ImplicitUsings>
44
<Nullable>enable</Nullable>
55
<LangVersion>latest</LangVersion>
6+
<IsPackable>false</IsPackable>
67
</PropertyGroup>
7-
</Project>
8+
</Project>

src/External/Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<ImplicitUsings>enable</ImplicitUsings>
44
<Nullable>disable</Nullable>
55
<LangVersion>latest</LangVersion>
6+
<IsPackable>false</IsPackable>
67
</PropertyGroup>
7-
</Project>
8+
</Project>

src/Fast.PRNGs/Fast.PRNGs.csproj

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
2+
33
<PropertyGroup>
44
<TargetFramework>net7.0</TargetFramework>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<IsPackable>true</IsPackable>
7+
8+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
10+
<PackageProjectUrl>https://github.com/martinothamar/Fast.PRNGs.NET</PackageProjectUrl>
11+
<RepositoryUrl>https://github.com/martinothamar/Fast.PRNGs.NET</RepositoryUrl>
12+
<PackageTags>csharp prng vectorization simd pseudorandom</PackageTags>
13+
<RepositoryType>git</RepositoryType>
14+
<Authors>Martin Othamar</Authors>
15+
<Copyright>Copyright 2023 Martin Othamar</Copyright>
16+
<Description>
17+
Fast PRNG implementations in .NET. Your PRNG is unlikely to be a bottleneck in anything you do, but there are exceptions like for instance Monte Carlo simulations, where generating random samples can take some time.
18+
</Description>
619
</PropertyGroup>
720

821
<ItemGroup>
@@ -14,7 +27,7 @@
1427
</ItemGroup>
1528

1629
<ItemGroup>
17-
<ProjectReference Include="..\External\RawIntrinsics\RawIntrinsics.csproj" />
30+
<Compile Include="..\External\RawIntrinsics\*.cs" />
1831
</ItemGroup>
1932

2033
</Project>

0 commit comments

Comments
 (0)