Skip to content

Commit b241c1c

Browse files
authored
Merge pull request #7 from ghost1face/actions
Github Actions
2 parents 853651b + 077a112 commit b241c1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+73
-33
lines changed

.editorconfig

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ root = true
22

33
[*]
44
indent_style = space
5+
indent_size = 2
6+
insert_final_newline = true
57

68
# Code files
79
[*.{cs}]
8-
indent_size = 4
9-
insert_final_newline = true
10-
11-
[*.{js, json}]
12-
indent_size = 2
13-
insert_final_newline = true
10+
indent_size = 4
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Upload dotnet package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: '6.0.x' # SDK Version to use.
21+
- name: Build
22+
working-directory: ./src
23+
run: dotnet build --configuration Release .
24+
- name: Create the package
25+
working-directory: ./src
26+
run: dotnet pack --configuration Release .
27+
- name: Publish the package to nuget.org
28+
working-directory: ./src
29+
run: dotnet nuget push FileTypeInterrogator/bin/Release/FileTypeInterrogator.*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
30+
env:
31+
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}

.github/workflows/dotnet.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,26 @@ jobs:
1010
build:
1111

1212
runs-on: ubuntu-latest
13-
1413
steps:
14+
- name: Clean
15+
run: rm -rf *.*
1516
- uses: actions/checkout@v2
16-
- name: Setup .NET
17+
- name: Setup .NET 6
1718
uses: actions/setup-dotnet@v1
1819
with:
1920
dotnet-version: '6.0.x'
21+
- name: Setup .NET 5
22+
uses: actions/setup-dotnet@v1
23+
with:
24+
dotnet-version: '5.0.x'
25+
- name: Setup .NET Core 3.1
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '3.1.x'
29+
- name: Setup .NET Core 2.1
30+
uses: actions/setup-dotnet@v1
31+
with:
32+
dotnet-version: '2.1.x'
2033
- name: Restore dependencies
2134
working-directory: ./src
2235
run: dotnet restore
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
5-
<IsPackable>false</IsPackable>
6-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
77

8-
<ItemGroup>
9-
<PackageReference Include="coverlet.collector" Version="1.2.0">
10-
<PrivateAssets>all</PrivateAssets>
11-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12-
</PackageReference>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
14-
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
15-
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
16-
</ItemGroup>
8+
<ItemGroup>
9+
<PackageReference Include="coverlet.collector" Version="1.2.0">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
</PackageReference>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
14+
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
15+
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
16+
</ItemGroup>
1717

18-
<ItemGroup>
19-
<ProjectReference Include="..\FileTypeInterrogator\FileTypeInterrogator.csproj" />
20-
</ItemGroup>
21-
22-
<ItemGroup>
23-
<None Update="TestFiles\*.*">
24-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
25-
</None>
26-
</ItemGroup>
18+
<ItemGroup>
19+
<ProjectReference Include="..\FileTypeInterrogator\FileTypeInterrogator.csproj" />
20+
</ItemGroup>
2721

22+
<ItemGroup>
23+
<None Update="TestFiles\*.*">
24+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
25+
</None>
26+
</ItemGroup>
2827
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)