Skip to content

Commit

Permalink
Merge pull request #4 from episerver/CG-9150-Creating-nuget-package-u…
Browse files Browse the repository at this point in the history
…sing-Github-action

CG-9150-Creating-nuget-package-using-Github-action
  • Loading branch information
jakeminard authored Dec 16, 2024
2 parents ea4264d + 553029e commit 87b05f5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Nuget Publish

on:
workflow_dispatch:

env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git Semantic Version
id: semver
uses: PaulHatch/[email protected]
- name: Create Tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.semver.outputs.version }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.sln
- name: Build
run: dotnet build --no-restore ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.sln
- name: Package
run: dotnet pack ./Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk/Optimizely.Graph.Source.Sdk.csproj --configuration Release -p:PackageVersion=${{ steps.semver.outputs.version }}
- name: Publish to Optimizely
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
- name: Publish to Episerver
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Optimizely</Authors>
<Description>C# SDK for Content Graph Services api.</Description>
<PackageProjectUrl>https://github.com/episerver/graph-source-sdk</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/episerver/graph-source-sdk</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,6 +17,13 @@
<None Remove="Expression\**" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
Expand Down

0 comments on commit 87b05f5

Please sign in to comment.