Skip to content

Commit

Permalink
Update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wassim-k committed Nov 12, 2024
1 parent dde80de commit e76815e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 26 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,65 @@
name: .NET Core

on: [push, pull_request]
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
branches:
- master
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: |
cd Orleans.Providers.MongoDB
dotnet pack --configuration Release
dotnet build --configuration Release
- name: Test
run: |
cd UnitTest
dotnet test Orleans.Providers.MongoDB.UnitTest.csproj --configuration Release
publish:
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Pack
run: |
cd Orleans.Providers.MongoDB
dotnet pack --configuration Release /p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Publish
run: |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.nuget }}
if: github.ref == 'refs/heads/master'
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.nuget }}
24 changes: 6 additions & 18 deletions UnitTest/Orleans.Providers.MongoDB.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand All @@ -10,26 +10,14 @@

<ItemGroup>
<PackageReference Include="EphemeralMongo6" Version="1.1.3" />
<PackageReference Include="FakeItEasy" Version="8.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Orleans.CodeGenerator" Version="8.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\libs\orleans\src\Orleans.CodeGenerator\Orleans.CodeGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\libs\orleans\test\TesterInternal\TesterInternal.csproj" />
<ProjectReference Include="..\Orleans.Providers.MongoDB\Orleans.Providers.MongoDB.csproj" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion libs/orleans
Submodule orleans updated 608 files

0 comments on commit e76815e

Please sign in to comment.