Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tbm0115 committed Feb 16, 2023
2 parents 3fd5f22 + 969cbc1 commit 0175f7c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish NuGet Package

on:
release:
types: [published]
workflow_dispatch:

env:
NUGET_REGISTRY: https://nuget.pkg.github.com/
NUGET_NAMESPACE: mtconnect
NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}
VS_PROJECT: MtconnectTranspiler.Sinks.CSharp

jobs:
build:
name: Build + Publish to GitHub Packages
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Add NuGet source
run: |
nuget sources add -name "GitHub Packages (MTConnect)" -source "https://nuget.pkg.github.com/mtconnect/index.json" -username ${{ github.actor }} -password ${{ secrets.GITHUB_TOKEN }}
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Build with dotnet
run: dotnet build "${{ env.VS_PROJECT }}\${{ env.VS_PROJECT }}.csproj" --configuration Release
- name: Pack NuGet package
run: dotnet pack "${{ env.VS_PROJECT }}\${{ env.VS_PROJECT }}.csproj" -c Release -o artifacts --no-build
- name: Publish Artifact
uses: actions/upload-artifact@master
with:
name: nupkg
path: artifacts
- name: Publish NuGet package to GitHub Packages
run: dotnet nuget push artifacts\*.nupkg --source ${{ env.NUGET_REGISTRY }}${{ env.NUGET_NAMESPACE }} --api-key ${{ env.NUGET_API_KEY }}

0 comments on commit 0175f7c

Please sign in to comment.