Skip to content

Commit

Permalink
CI and NuGet
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Dec 10, 2023
1 parent dbc3e2b commit 0865894
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 25 deletions.
20 changes: 20 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageVersion>$(Version)</PackageVersion>
<Company>Cysharp</Company>
<Authors>Cysharp</Authors>
<Copyright>© Cysharp, Inc.</Copyright>
<PackageProjectUrl>https://github.com/Cysharp/R3</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Icon.png</PackageIcon>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../opensource.snk</AssemblyOriginatorKeyFile>
<!-- For BenchmarkDotNet generated project-->
<AssemblyOriginatorKeyFile Condition="EXISTS('./../../../../../../opensource.snk')">../../../../../../opensource.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>
Binary file added Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opensource.snk
Binary file not shown.
31 changes: 16 additions & 15 deletions sandbox/ConsoleApp1/ConsoleApp1.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="System.Reactive.Linq" Version="6.0.0" />
<PackageReference Include="ZLogger" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="System.Reactive.Linq" Version="6.0.0" />
<PackageReference Include="ZLogger" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\R3\R3.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\R3\R3.csproj" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions src/R3/.github/workflows/build-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build-Debug

on:
push:
branches:
- "main"
pull_request:
branches:
- "mainr"

jobs:
build-dotnet:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- run: dotnet build -c Debug
- run: dotnet test -c Debug --no-build
54 changes: 54 additions & 0 deletions src/R3/.github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build-Release

on:
workflow_dispatch:
inputs:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry-run:
description: "dry-run: true will never create relase/nuget."
required: true
default: false
type: boolean

env:
GIT_TAG: ${{ github.event.inputs.tag }}
DRY_RUN: ${{ github.event.inputs.dry-run }}

jobs:
build-dotnet:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- run: dotnet build -c Release -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release --no-build
- run: dotnet pack -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
# Store artifacts.
- uses: actions/upload-artifact@v2
with:
name: nuget
path: ./publish/

create-release:
if: github.event.inputs.dry-run == 'false'
needs: [build-dotnet]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
# Create Releases
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GIT_TAG }}
release_name: Ver.${{ env.GIT_TAG }}
draft: true
prerelease: false
# Download (All) Artifacts to current directory
- uses: actions/download-artifact@v2
# Upload to NuGet
- run: dotnet nuget push "./nuget/*.nupkg" --skip-duplicate -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}
10 changes: 10 additions & 0 deletions src/R3/.github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Close stale issues"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
uses: Cysharp/Actions/.github/workflows/stale-issue.yaml@main
32 changes: 22 additions & 10 deletions src/R3/R3.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591;1573</NoWarn>

<!-- NuGet Packaging -->
<PackageTags>rx</PackageTags>
<Description>Third Generation of Reactive Extensions.</Description>
</PropertyGroup>

<ItemGroup>
<None Include="../../Icon.png" Pack="true" PackagePath="/" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>

</Project>

0 comments on commit 0865894

Please sign in to comment.