Skip to content

Add unit tests and comprehensive documentation #4

Add unit tests and comprehensive documentation

Add unit tests and comprehensive documentation #4

Workflow file for this run

name: Build and Release
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish Single-File Executable
run: |
dotnet publish OpenTweak/OpenTweak.csproj `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-o ./publish
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: OpenTweak-win-x64
path: ./publish/
if-no-files-found: error
release:
needs: build
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: OpenTweak-win-x64
path: ./release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./release/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}