Build .NET and Publish #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build .NET Framework and Publish to NuGet | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '^[0-9]+\.[0-9]+\.[0-9]+$' | |
jobs: | |
build: | |
runs-on: windows-2019 | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v2 | |
- name: Restore dependencies | |
run: nuget restore src/Eliot.UELib.csproj | |
- name: Build | |
run: msbuild src/Eliot.UELib.csproj -t:rebuild -property:Configuration=Release | |
- name: Publish Eliot.UELib to NuGet | |
id: nuget | |
uses: alirezanet/[email protected] | |
with: | |
PROJECT_FILE_PATH: src/Eliot.UELib.csproj | |
VERSION_STATIC: ${{ github.ref_name }} | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} | |
- name: Publish Eliot.UELib to GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Eliot.UELib | |
path: ${{ steps.nuget.outputs.PACKAGE_PATH }}/${{ steps.nuget.outputs.PACKAGE_NAME }} | |
release: | |
runs-on: ubuntu | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Create a Release | |
uses: elgohr/Github-Release-Action@v5 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: ${{ github.ref_name }} |