Update dotnet.yml #10
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 and Release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '8.x' | |
- name: Install dependencies | |
run: dotnet restore ./src/MulticlientCreator/MulticlientCreator.sln | |
- name: Build | |
run: dotnet build ./src/MulticlientCreator/MulticlientCreator.sln --configuration Release --no-restore | |
- name: Run tests | |
run: dotnet test ./src/MulticlientCreator/MulticlientCreator.sln --no-restore --verbosity normal | |
release: | |
runs-on: windows-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '8.x' | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v1.0.0 | |
release_name: Release v1.0.0 | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./src/MulticlientCreator/bin/Release/net8.0-windows/MulticlientCreator.exe | |
asset_name: MulticlientCreator.exe | |
asset_content_type: application/octet-stream |