Skip to content

GitHubCI: upgrade .NET to fix restore issue #18

GitHubCI: upgrade .NET to fix restore issue

GitHubCI: upgrade .NET to fix restore issue #18

Workflow file for this run

name: CI
on:
release:
types: [published]
push:
pull_request:
workflow_dispatch:
env:
DOTNET_VERSION: 5.0.302
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Build
run: dotnet build Jellyfin.Plugins.Telegram/
release:
needs: build
name: Release
strategy:
matrix:
kind: ['linux', 'windows', 'macOS']
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
- kind: macOS
os: macos-latest
target: osx-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Zip
shell: bash
run: |
# Define some variables for things we need
tag=$(git describe --tags --abbrev=0)
release_name="Jellyfin.Plugins.Telegram-$tag-${{ matrix.target }}"
# Build everything
dotnet publish Jellyfin.Plugins.Telegram/Jellyfin.Plugins.Telegram.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; 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"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "Jellyfin.Plugins.Telegram*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}