Skip to content

Commit 87b05f5

Browse files
authored
Merge pull request #4 from episerver/CG-9150-Creating-nuget-package-using-Github-action
CG-9150-Creating-nuget-package-using-Github-action
2 parents ea4264d + 553029e commit 87b05f5

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/nuget-publish.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Nuget Publish
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
9+
jobs:
10+
Publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Git Semantic Version
17+
id: semver
18+
uses: PaulHatch/[email protected]
19+
- name: Create Tag
20+
id: tag_version
21+
uses: mathieudutour/[email protected]
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
custom_tag: ${{ steps.semver.outputs.version }}
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: 8.0.x
29+
- name: Restore dependencies
30+
run: dotnet restore ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.sln
31+
- name: Build
32+
run: dotnet build --no-restore ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.sln
33+
- name: Package
34+
run: dotnet pack ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.csproj --configuration Release -p:PackageVersion=${{ steps.semver.outputs.version }}
35+
- name: Publish to Optimizely
36+
run: dotnet nuget push ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk/bin/Release/Optimizely.Graph.Source.Sdk.${{ steps.semver.outputs.version }}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.optimizely.com/feed/packages.svc
37+
- name: Publish to Episerver
38+
run: dotnet nuget push ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk/bin/Release/Optimizely.Graph.Source.Sdk.${{ steps.semver.outputs.version }}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/episerver/index.json

Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.csproj

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<Authors>Optimizely</Authors>
8+
<Description>C# SDK for Content Graph Services api.</Description>
9+
<PackageProjectUrl>https://github.com/episerver/graph-source-sdk</PackageProjectUrl>
10+
<PackageReadmeFile>README.md</PackageReadmeFile>
11+
<RepositoryUrl>https://github.com/episerver/graph-source-sdk</RepositoryUrl>
712
</PropertyGroup>
813

914
<ItemGroup>
@@ -12,6 +17,13 @@
1217
<None Remove="Expression\**" />
1318
</ItemGroup>
1419

20+
<ItemGroup>
21+
<None Include="..\..\README.md">
22+
<Pack>True</Pack>
23+
<PackagePath>\</PackagePath>
24+
</None>
25+
</ItemGroup>
26+
1527
<ItemGroup>
1628
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1729
</ItemGroup>

0 commit comments

Comments
 (0)