Skip to content

Commit

Permalink
Update dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizo55 committed Jul 2, 2024
1 parent cdce93f commit 0672fa1
Showing 1 changed file with 53 additions and 10 deletions.
63 changes: 53 additions & 10 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,66 @@
name: .NET
name: Build and Release

on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
dotnet-version: '8.x'

- name: Install dependencies
run: dotnet restore ./src/MulticlientCreator/MulticlientCreator.sln

- name: Build
run: dotnet build --no-restore --configuration Release
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

0 comments on commit 0672fa1

Please sign in to comment.