diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 228b3ac23..5e0c2e6e1 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -36,9 +36,9 @@ jobs: - os: macos-latest kind: macOS target: osx-x64 -# - os: macos-latest -# kind: macOS -# target: osx-arm64 + - os: macos-latest + kind: macOS + target: osx-arm64 steps: - name: Get the sources uses: actions/checkout@v2 @@ -136,78 +136,78 @@ jobs: ${{ env.RELEASE_NAME }}.dmg env: GITHUB_TOKEN: ${{ secrets.gh_token }} -# build_and_upload: -# name: Build & Upload -# runs-on: ${{ matrix.os }} -# if: contains(github.event.head_commit.message, '[no build]') == false -# strategy: -# matrix: -# include: -# - os: ubuntu-latest -# kind: linux -# target: linux-x64 -# - os: ubuntu-latest -# kind: linux -# target: linux-arm -# - os: windows-latest -# kind: windows -# target: win-x64 -# steps: -# - name: Get the sources -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Setup .NET Core -# uses: actions/setup-dotnet@v1 -# with: -# dotnet-version: 6.0.x -# -# - name: Clean -# run: dotnet clean --configuration Release && dotnet nuget locals all --clear -# -# - name: Install dependencies -# run: dotnet restore -r "${{ matrix.target}}" -# -# - name: Build -# shell: bash -# run: | -# # Define some variables for things we need -# release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}" -# echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV -# -# # Build everything -# dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true -# -# # Pack files -# if [ "${{ matrix.kind }}" == "windows" ]; then -# 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" -# env: -# AC_USERNAME: ${{ secrets.ac_username }} -# AC_PASSWORD: ${{ secrets.ac_password }} -# -# - name: Delete old release assets -# uses: mknejp/delete-release-assets@v1 -# with: -# token: ${{ secrets.gh_token }} -# tag: ${{ inputs.release_tag }} -# fail-if-no-assets: false -# assets: | -# *${{ matrix.target }}.zip -# *${{ matrix.target }}.tar.gz -# - name: Publish -# uses: softprops/action-gh-release@v1 -# with: -# prerelease: true -# tag_name: ${{ inputs.release_tag }} -# files: | -# ${{ env.RELEASE_NAME }}.zip -# ${{ env.RELEASE_NAME }}.tar.gz -# env: -# GITHUB_TOKEN: ${{ secrets.gh_token }} + build_and_upload: + name: Build & Upload + runs-on: ${{ matrix.os }} + if: contains(github.event.head_commit.message, '[no build]') == false + strategy: + matrix: + include: + - os: ubuntu-latest + kind: linux + target: linux-x64 + - os: ubuntu-latest + kind: linux + target: linux-arm + - os: windows-latest + kind: windows + target: win-x64 + steps: + - name: Get the sources + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + + - name: Clean + run: dotnet clean --configuration Release && dotnet nuget locals all --clear + + - name: Install dependencies + run: dotnet restore -r "${{ matrix.target}}" + + - name: Build + shell: bash + run: | + # Define some variables for things we need + release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}" + echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV + + # Build everything + dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true + + # Pack files + if [ "${{ matrix.kind }}" == "windows" ]; then + 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" + env: + AC_USERNAME: ${{ secrets.ac_username }} + AC_PASSWORD: ${{ secrets.ac_password }} + + - name: Delete old release assets + uses: mknejp/delete-release-assets@v1 + with: + token: ${{ secrets.gh_token }} + tag: ${{ inputs.release_tag }} + fail-if-no-assets: false + assets: | + *${{ matrix.target }}.zip + *${{ matrix.target }}.tar.gz + - name: Publish + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ inputs.release_tag }} + files: | + ${{ env.RELEASE_NAME }}.zip + ${{ env.RELEASE_NAME }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.gh_token }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d4bc09eb..abd0f7bef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,13 +46,13 @@ jobs: ac_username: ${{ secrets.AC_USERNAME }} ac_password: ${{ secrets.AC_PASSWORD }} gh_token: ${{ secrets.GITHUB_TOKEN }} -# build_and_push: -# uses: jasongdove/ersatztv/.github/workflows/docker.yml@main -# needs: calculate_version -# with: -# base_version: develop -# info_version: ${{ needs.calculate_version.outputs.git_tag }} -# tag_version: ${{ github.sha }} -# secrets: -# docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} -# docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + build_and_push: + uses: jasongdove/ersatztv/.github/workflows/docker.yml@main + needs: calculate_version + with: + base_version: develop + info_version: ${{ needs.calculate_version.outputs.git_tag }} + tag_version: ${{ github.sha }} + secrets: + docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} + docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e3d4341a3..30c88d595 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix `HLS Segmenter` streaming mode with multiple ffmpeg-based clients - Jellyfin (web) and TiviMate (Android) were specifically tested +### Added +- Also write logs to text files in the `logs` config subfolder + ## [0.3.8-alpha] - 2022-01-23 ### Fixed - Fix issue preventing some versions of ffmpeg (usually 4.4.x) from streaming MPEG-TS (Legacy) channels at all diff --git a/ErsatzTV.Core/FileSystemLayout.cs b/ErsatzTV.Core/FileSystemLayout.cs index 23766f8f9..a6f57870c 100644 --- a/ErsatzTV.Core/FileSystemLayout.cs +++ b/ErsatzTV.Core/FileSystemLayout.cs @@ -21,6 +21,7 @@ namespace ErsatzTV.Core public static readonly string DatabasePath = Path.Combine(AppDataFolder, "ersatztv.sqlite3"); public static readonly string LogDatabasePath = Path.Combine(AppDataFolder, "logs.sqlite3"); + public static readonly string LogFilePath = Path.Combine(AppDataFolder, "logs", "ersatztv.log"); public static readonly string LegacyImageCacheFolder = Path.Combine(AppDataFolder, "cache", "images"); public static readonly string ResourcesCacheFolder = Path.Combine(AppDataFolder, "cache", "resources"); diff --git a/ErsatzTV/Program.cs b/ErsatzTV/Program.cs index a9859176b..60278b88d 100644 --- a/ErsatzTV/Program.cs +++ b/ErsatzTV/Program.cs @@ -43,6 +43,7 @@ namespace ErsatzTV .ReadFrom.Configuration(Configuration) .Enrich.FromLogContext() .WriteTo.SQLite(FileSystemLayout.LogDatabasePath, retentionPeriod: TimeSpan.FromDays(1)) + .WriteTo.File(FileSystemLayout.LogFilePath, rollingInterval: RollingInterval.Day) .CreateLogger(); try