Build .NET and Publish #94
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 and Publish | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '^[0-9]+\.[0-9]+\.[0-9]+$' | |
jobs: | |
build: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
dotnet: [ '8.0.x' ] | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Install | |
run: dotnet restore src/Eliot.UELib.csproj | |
- name: Build | |
run: dotnet build src/Eliot.UELib.csproj | |
- name: Restore | |
run: dotnet restore src/Eliot.UELib.csproj | |
- name: Test | |
run: dotnet test Test/Eliot.UELib.Test.csproj | |
- name: Pack | |
run: dotnet pack --configuration Release src/Eliot.UELib.csproj | |
#- name: Push | |
# run: dotnet nuget push src/Eliot.UELib.csproj -k ${{ secrets.NUGET_API_KEY }}} -s https://api.nuget.org/v3/index.json | |
- 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 }} |