67 lines
2.3 KiB
YAML
67 lines
2.3 KiB
YAML
name: "🚀 Publish Plugin"
|
|
|
|
on:
|
|
push:
|
|
tags: ["*"]
|
|
|
|
env:
|
|
dotnet-version: 8.0.x
|
|
python-version: 3.8
|
|
project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
|
|
artifact: metashark
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build & Release
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Get tags (For CHANGELOG)
|
|
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
- name: Setup dotnet
|
|
uses: actions/setup-dotnet@v3
|
|
id: dotnet
|
|
with:
|
|
dotnet-version: ${{ env.dotnet-version }}
|
|
- name: Change default dotnet version
|
|
run: |
|
|
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
|
|
- name: Setup python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.python-version }}
|
|
- name: Initialize workflow variables
|
|
id: vars
|
|
run: |
|
|
VERSION=$(echo "${GITHUB_REF#refs/*/}" | sed s/^v//)
|
|
VERSION="$VERSION.0"
|
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "APP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT
|
|
- name: Build
|
|
run: |
|
|
dotnet restore ${{ env.project }} --no-cache
|
|
dotnet publish --nologo --no-restore --configuration=Release --framework=net8.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }}
|
|
mkdir -p artifacts
|
|
zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net8.0/Jellyfin.Plugin.MetaShark.dll
|
|
- name: Generate manifest
|
|
run: python3 ./scripts/generate_manifest.py ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/}
|
|
env:
|
|
CN_DOMAIN: ${{ vars.CN_DOMAIN }}
|
|
- name: Publish release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./artifacts/${{ env.artifact }}_*.zip
|
|
tag: ${{ github.ref }}
|
|
file_glob: true
|
|
overwrite: true
|
|
- name: Publish manifest
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./manifest*.json
|
|
tag: "manifest"
|
|
overwrite: true
|
|
file_glob: true
|