build: update build script #71
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "🚀 Publish Plugin" | |
on: | |
push: | |
tags: ["*"] | |
env: | |
dotnet-version: 6.0.x | |
python-version: 3.10 | |
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 ::set-output name=VERSION::${VERSION} | |
echo ::set-output name=APP_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}') | |
- name: Build | |
run: | | |
dotnet restore ${{ env.project }} --no-cache | |
dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }} | |
mkdir -p artifacts | |
cp ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll ./artifacts/ | |
- name: Compress build files | |
uses: thedoctor0/zip-release@main | |
with: | |
type: "zip" | |
directory: "artifacts" | |
filename: "${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip" | |
exclusions: "*.json *.pdb" | |
- name: Generate manifest | |
run: cd artifacts && python3 ../generate_manifest.py ${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/} | |
- name: Deploy to jellyfin release repo | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.PAT }} | |
external_repository: cxfksword/jellyfin-release | |
destination_dir: ${{ env.artifact }} | |
publish_branch: master | |
publish_dir: ./artifacts | |
- 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 | |
# - name: Publish manifest | |
# uses: svenstaro/upload-release-action@v2 | |
# with: | |
# repo_token: ${{ secrets.GITHUB_TOKEN }} | |
# file: ./artifacts/manifest*.json | |
# tag: "manifest" | |
# overwrite: true | |
# file_glob: true |