Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Merge pull request #55 from AngeloDotNet/dependabot/nuget/src/NET6Cus… #95

Merge pull request #55 from AngeloDotNet/dependabot/nuget/src/NET6Cus…

Merge pull request #55 from AngeloDotNet/dependabot/nuget/src/NET6Cus… #95

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build and Pack on Github
on:
push:
branches: [ main ]
paths: [ 'src/NET6CustomLibrary/**' ]
workflow_dispatch:
env:
NET_VERSION: '6.x'
PROJECT_NAME: src/NET6CustomLibrary
PROJECT_FILE: NET6CustomLibrary.csproj
RELEASE_NAME: NET6CustomLibrary
jobs:
build:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core SDK ${{ env.NET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.NET_VERSION }}
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@v0.4
id: nbgv
with:
path: ${{ env.PROJECT_NAME }}
- name: Package
run: dotnet pack -c Release -o . '${{ env.PROJECT_NAME }}/${{ env.PROJECT_FILE }}' -p:Version=${{ steps.gitversion.outputs.SemVer }}
- name: Publish
run: |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
dotnet nuget push **\*.nupkg --source github --api-key ${{ secrets.GITHUB_TOKEN }}