Fix typo on README #8
Workflow file for this run
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: Release NuGet | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build_test_package_release: | |
name: Build Test Package Release | |
runs-on: ubuntu-latest | |
steps: | |
# - name: Check event payload | |
# shell: pwsh | |
# run: | | |
# echo ${{ toJSON(github.event) }} | |
- name: Set release version | |
id: release | |
shell: pwsh | |
run: | | |
$version = "${{ github.event.ref }}" -replace "refs/tags/v", "" | |
echo "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
- name: Check release module and version | |
shell: pwsh | |
run: | | |
echo "version: ${{ steps.release.outputs.version }}" | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x' | |
# - name: Add MSBuild to PATH | |
# uses: microsoft/[email protected] | |
- name: Restore NuGet packages | |
shell: pwsh | |
run: | | |
dotnet restore | |
- name: Build solution | |
shell: pwsh | |
run: | | |
dotnet build -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal | |
- name: Test solution | |
shell: pwsh | |
run: | | |
dotnet test -c Release | |
- name: List Package | |
id: package | |
shell: pwsh | |
run: | | |
$package = Get-ChildItem -Path ./src -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" } | |
$path = $package[0].FullName | |
$name = $package[0].Name | |
echo "path=$path" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
echo "name=$name" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append | |
- name: Check package path and name | |
shell: pwsh | |
run: | | |
echo "path: ${{ steps.package.outputs.path }}" | |
echo "name: ${{ steps.package.outputs.name }}" | |
- name: Release package to GitHub | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
${{ steps.package.outputs.path }} | |
- name: Release package to NuGet | |
shell: pwsh | |
run: | | |
dotnet nuget push ${{ steps.package.outputs.path }} --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |