Skip to content

Fix system logger

Fix system logger #6

Workflow file for this run

name: .NET
on:
push:
tags:
- '*'
jobs:
release:
name: Release
strategy:
matrix:
kind: ['linux', 'windows', 'winforms']
include:
- kind: linux
version : Console
os: ubuntu-latest
target: linux-x64
project: TwitchDropsBot.Console/TwitchDropsBot.Console.csproj
- kind: windows
version : Console
os: windows-latest
target: win-x64
project: TwitchDropsBot.Console/TwitchDropsBot.Console.csproj
- kind: winforms
version : WinForms
os: windows-latest
target: win-x64
project: TwitchDropsBot.WinForms/TwitchDropsBot.WinForms.csproj
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="TwitchDropsBot-${{ matrix.version }}-${{ matrix.target }}-$tag"
if [ "${{ matrix.kind }}" == "winforms" ]; then
framework="net8.0-windows"
# Build with native libraries for self-extract
dotnet publish ${{ matrix.project }} -f $framework -r "${{ matrix.target }}" -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -c Release -o "$release_name"
else
framework="net8.0"
dotnet publish ${{ matrix.project }} -f $framework -r "${{ matrix.target }}" -p:PublishSingleFile=true -c Release -o "$release_name"
fi
find "$release_name" -name '*.sln' -delete
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: "TwitchDropsBot*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}