Skip to content

Commit 62047aa

Browse files
authored
Create nuget-publish.yml
Created Nuget publish action.
1 parent ea4264d commit 62047aa

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
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

0 commit comments

Comments
 (0)