Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying out CICD w/ https://github.com/brandedoutcast/publish-nuget #8

Merged
merged 3 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build and test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand All @@ -13,13 +11,19 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal --filter "Category!=LongRunning"
40 changes: 40 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build, test, and deploy

on:
push:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal --filter "Category!=LongRunning"

- name: Publish Orleans.SyncWork to NuGet
uses: brandedoutcast/publish-nuget@v2.5.2
with:
PROJECT_FILE_PATH: src/Orleans.SyncWork/Orleans.SyncWork.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
NUGET_SOURCE: https://api.nuget.org
PACKAGE_NAME: Orleans.SyncWork
VERSION_FILE_PATH: Directory.Build.props
VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$
INCLUDE_SYMBOLS: true
8 changes: 7 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
<PropertyGroup>
<OrleansSyncWorkVersion Condition=" '$(OrleansSyncWorkVersion)'=='' ">0.1.0</OrleansSyncWorkVersion>
</PropertyGroup>
</Project>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<Version>3.4.244</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions src/Orleans.SyncWork/Orleans.SyncWork.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
<PackageProjectUrl>https://github.com/Kritner/Orleans.SyncWork</PackageProjectUrl>
<RepositoryUrl>https://github.com/Kritner/Orleans.SyncWork</RepositoryUrl>

<FileVersion>$(OrleansSyncWorkVersion)</FileVersion>
<Version>$(OrleansSyncWorkVersion)</Version>
<AssemblyVersion>$(OrleansSyncWorkVersion)</AssemblyVersion>

</PropertyGroup>

Expand Down
13 changes: 13 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0-beta",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}