Skip to content

Commit f6e0eb3

Browse files
committed
move ci to github
1 parent 230eed7 commit f6e0eb3

8 files changed

Lines changed: 79 additions & 88 deletions

File tree

ci/ci.ps1 renamed to .github/workflows/ci.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ function Set-VersionSuffixOnTag([string]$dir, [string]$branch)
1818
{
1919
Set-VersionSuffix $dir $suffix
2020
}
21+
22+
return
2123
}
24+
25+
Set-VersionSuffix $dir "ci"
2226
}
2327

2428
# Add xml element "VersionSuffix" to *.csproj files in $dir.
@@ -40,7 +44,7 @@ function Set-VersionSuffix([string]$dir, [string]$suffix)
4044
if ($content.Project.PropertyGroup -eq $null)
4145
{
4246
$propertyGroup = $content.CreateElement("PropertyGroup");
43-
$content.Project.AppendChild($propertyGroup);
47+
[void] $content.Project.AppendChild($propertyGroup);
4448
}
4549
else
4650
{

.github/workflows/main.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,26 @@ jobs:
1212

1313
steps:
1414

15-
- name: install .NET Core 10 SDKs
15+
- name: install .NET Core 10 SDK
1616
uses: actions/setup-dotnet@v2
1717
with:
1818
include-prerelease: false
1919
dotnet-version: |
2020
10.0.x
2121
22+
- name: .NET info
23+
run: dotnet --info
24+
shell: pwsh
25+
2226
- name: checkout repository
2327
uses: actions/checkout@v2
2428

29+
- name: set version
30+
run: |
31+
. ./.github/workflows/ci.ps1
32+
Set-VersionSuffixOnTag "$Env:GITHUB_WORKSPACE/src" "$Env:GITHUB_REF"
33+
shell: pwsh
34+
2535
- name: dotnet restore
2636
run: dotnet restore
2737

@@ -38,3 +48,56 @@ jobs:
3848
with:
3949
check_name: tests results
4050
trx_files: "**/test-results/**/*.trx"
51+
52+
- name: test results badge color
53+
shell: bash
54+
run: |
55+
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
56+
success)
57+
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
58+
;;
59+
failure)
60+
echo "BADGE_COLOR=800000" >> $GITHUB_ENV
61+
;;
62+
neutral)
63+
echo "BADGE_COLOR=696969" >> $GITHUB_ENV
64+
;;
65+
esac
66+
67+
- name: create test result badge
68+
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1
69+
with:
70+
label: tests
71+
status: '${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}'
72+
color: ${{ env.BADGE_COLOR }}
73+
path: badge.svg
74+
75+
- name: Upload badge to Gist
76+
if: >
77+
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'master' ||
78+
github.event_name != 'workflow_run' && github.ref == 'refs/heads/master'
79+
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
80+
with:
81+
token: ${{ secrets.GIST_TOKEN }}
82+
gistURL: https://gist.github.com/PawelGerr/2311eb236eb4a66e7c422005bd498060
83+
file: badge.svg
84+
85+
- name: pack
86+
run: dotnet pack --configuration Release --no-build --output out
87+
88+
- uses: actions/upload-artifact@v4
89+
with:
90+
name: nuget-packages
91+
path: |
92+
out/*.nupkg
93+
out/*.snupkg
94+
if-no-files-found: 'error'
95+
96+
- name: push to nuget.org
97+
if: startsWith(github.ref, 'refs/tags/')
98+
run: |
99+
cd out
100+
dotnet nuget push "*.nupkg" -k "$env:API_KEY" --skip-duplicate
101+
shell: pwsh
102+
env:
103+
API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
<VersionPrefix>10.0.0</VersionPrefix>
66
<Authors>Pawel Gerr</Authors>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8-
<PackageProjectUrl>https://dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore</PackageProjectUrl>
8+
<PackageProjectUrl>https://github.com/PawelGerr/Thinktecture.EntityFrameworkCore</PackageProjectUrl>
99
<PackageIcon>icon.png</PackageIcon>
1010
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
11+
<PackageReadmeFile>README.md</PackageReadmeFile>
1112
<RepositoryType>git</RepositoryType>
12-
<RepositoryUrl>https://pawelgerr@dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore/_git/Thinktecture.EntityFrameworkCore</RepositoryUrl>
13+
<RepositoryUrl>https://github.com/PawelGerr/Thinktecture.EntityFrameworkCore</RepositoryUrl>
1314
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1415
<RootNamespace>Thinktecture</RootNamespace>
1516
<TargetFrameworks>net10.0;</TargetFrameworks>

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.2" />
1515
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="10.0.2" />
1616
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
17-
<PackageVersion Include="Microsoft.SourceLink.AzureRepos.Git" Version="10.0.102" PrivateAssets="all" />
17+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1818
<PackageVersion Include="NSubstitute" Version="5.3.0" />
1919
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0" />
2020
<PackageVersion Include="Serilog.Sinks.XUnit" Version="3.0.19" />

Readme.md renamed to README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Thinktecture.EntityFrameworkCore
22

3-
[![Build Status](https://dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore/_apis/build/status/Thinktecture.EntityFrameworkCore/Thinktecture.EntityFrameworkCore%20CI?branchName=master)](https://dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore/_build/latest?definitionId=4&branchName=master)
3+
![Build](https://github.com/PawelGerr/Thinktecture.EntityFrameworkCore/workflows/CI/badge.svg)
44
![NuGet Downloads](https://img.shields.io/nuget/dt/Thinktecture.EntityFrameworkCore.Relational)
5-
5+
![TestResults](https://gist.githubusercontent.com/PawelGerr/2311eb236eb4a66e7c422005bd498060/raw/badge.svg)
66

77
[![Thinktecture.EntityFrameworkCore.Relational](https://img.shields.io/nuget/vpre/Thinktecture.EntityFrameworkCore.Relational.svg?label=Thinktecture.EntityFrameworkCore.Relational&maxAge=3600)](https://www.nuget.org/packages/Thinktecture.EntityFrameworkCore.Relational/)
88
[![Thinktecture.EntityFrameworkCore.SqlServer](https://img.shields.io/nuget/vpre/Thinktecture.EntityFrameworkCore.SqlServer.svg?label=Thinktecture.EntityFrameworkCore.SqlServer&maxAge=3600)](https://www.nuget.org/packages/Thinktecture.EntityFrameworkCore.SqlServer/)

Thinktecture.EntityFrameworkCore.slnx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
<Folder Name="/assets/">
33
<File Path=".editorconfig" />
44
<File Path=".gitattributes" />
5-
<File Path=".github/workflows/main.yml" />
5+
<File Path=".github\workflows\main.yml" />
66
<File Path=".gitignore" />
7-
<File Path="azure-pipelines.yml" />
8-
<File Path="ci/ci.ps1" />
97
<File Path="Directory.Build.props" />
108
<File Path="Directory.Packages.props" />
119
<File Path="global.json" />
@@ -15,6 +13,7 @@
1513
<File Path="CLAUDE.md" />
1614
</Folder>
1715
<Folder Name="/assets/.github/">
16+
<File Path=".github/workflows/ci.ps1" />
1817
<File Path=".github\copilot-instructions.md" />
1918
<File Path=".github\workflows\main.yml" />
2019
<File Path=".github\workflows\claude.yml" />

azure-pipelines.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
<ItemGroup>
1616
<None Include="./../../icon.png" Pack="true" PackagePath="" />
1717
<None Include="./../../LICENSE.md" Pack="true" PackagePath="$(PackageLicenseFile)" />
18+
<None Include="./../../README.md" Pack="true" PackagePath="$(PackageReadmeFile)" />
1819
</ItemGroup>
1920

2021
<ItemGroup>
21-
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" PrivateAssets="all" />
22+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" />
2223
</ItemGroup>
2324

2425
</Project>

0 commit comments

Comments
 (0)