Merge pull request #40 from ChrisPulman/dependabot/nuget/xunit-2.5.1 #18
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: SerialPortRx CI-Build | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build-and-release: | |
runs-on: windows-2022 | |
outputs: | |
nbgv: ${{ steps.nbgv.outputs.SemVer2 }} | |
steps: | |
- name: Get Current Visual Studio Information | |
shell: bash | |
run: | | |
dotnet tool update -g dotnet-vs | |
echo "-- About RELEASE --" | |
vs where release | |
- name: Update Visual Studio Latest Release | |
shell: bash | |
run: | | |
echo "-- Update RELEASE --" | |
vs update release Enterprise | |
vs modify release Enterprise +mobile +desktop +uwp +web | |
echo "-- About RELEASE Updated --" | |
vs where release | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v1.1.3 | |
with: | |
vs-prerelease: true | |
- name: NBGV | |
id: nbgv | |
uses: dotnet/nbgv@master | |
with: | |
setAllVars: true | |
- run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}' | |
- name: NuGet Restore | |
run: dotnet restore SerialPortRx.sln | |
working-directory: src | |
- name: Build | |
run: msbuild /t:build,pack /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=Release SerialPortRx.sln | |
working-directory: src | |
- name: Create NuGet Artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: nuget | |
path: '**/*.nupkg' | |
- name: Changelog | |
uses: glennawatson/ChangeLog@v1 | |
id: changelog | |
- name: Create Release | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps.nbgv.outputs.SemVer2 }} | |
release_name: ${{ steps.nbgv.outputs.SemVer2 }} | |
body: | | |
${{ steps.changelog.outputs.commitLog }} | |
- name: NuGet Push | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} | |
SOURCE_URL: https://api.nuget.org/v3/index.json | |
run: | | |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg --skip-duplicate |