Skip to content

Commit

Permalink
publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
softlion committed Nov 25, 2023
1 parent 85bc404 commit 91c7d11
Showing 1 changed file with 10 additions and 47 deletions.
57 changes: 10 additions & 47 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# This is a basic workflow to help you get started with Actions

name: publish to nuget

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
Expand All @@ -22,6 +18,7 @@ env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
NuGetDirectory: ${{ github.workspace}}/nuget

jobs:
build:
Expand All @@ -43,53 +40,19 @@ jobs:
run: dotnet build --configuration Release

- name: Pack
run: dotnet pack --configuration Release --no-build
run: dotnet pack --configuration Release --no-build --output "${{ env.NuGetDirectory }}"

publish:
runs-on: ubuntu-latest
needs: build
steps:
# - name: Set up NuGet CLI
# run: dotnet tool install --global NuGet.CommandLine

- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}

- name: Push NuGet package
run: |
- name: Push NuGet package
run: |
dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
# publish:
# name: build, pack & publish
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# # - name: Setup dotnet
# # uses: actions/setup-dotnet@v1
# # with:
# # dotnet-version: 3.1.200
#
# # Publish
# - name: publish NotionSharp on nuget on change
# id: publish_nuget_notionsharp
# uses: rohith/publish-nuget@v2
# with:
# # Filepath of the project to be packaged, relative to root of repository
# PROJECT_FILE_PATH: NotionSharp/NotionSharp.csproj
#
# # NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: Softlion.NotionSharp
#
# # API key to authenticate with NuGet server
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}
#
# - name: publish NotionSharp project templates on nuget on change
# id: publish_nuget_notionsharp_projecttemplates
# uses: rohith/publish-nuget@v2
# with:
# # Filepath of the project to be packaged, relative to root of repository
# PROJECT_FILE_PATH: Demos/PackTemplateProjects.csproj
#
# # NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: Softlion.NotionSharp.TemplateProjects
#
# # API key to authenticate with NuGet server
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}
dotnet nuget push "${{ env.NuGetDirectory }}/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}}

0 comments on commit 91c7d11

Please sign in to comment.