Skip to content

Commit

Permalink
ci: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfksword committed Nov 17, 2023
1 parent 05d94bb commit ee22e96
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "🚀 Beta"

on:
workflow_dispatch:

env:
dotnet-version: 6.0.x
python-version: 3.8
project: Jellyfin.Plugin.Danmu/Jellyfin.Plugin.Danmu.csproj
artifact: danmu

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
with:
dotnet-version: ${{ env.dotnet-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 ${{ env.project }}
mkdir -p artifacts
cp ./Jellyfin.Plugin.Danmu/bin/Release/net6.0/Jellyfin.Plugin.Danmu.dll ./artifacts/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{steps.vars.outputs.APP_NAME}}
path: artifacts
retention-days: 7
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
VERSION="$VERSION.0"
echo ::set-output name=VERSION::${VERSION}
echo ::set-output name=APP_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
- name: Install dependencies
run: dotnet restore ${{ env.project }} --no-cache
- name: Build
run: dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 --output=artifacts -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }}
- name: Clean publish dll
run: cd artifacts && rm -rf MediaBrowser*.dll Microsoft*.dll Newtonsoft*.dll System*.dll Emby*.dll Jellyfin.Data*.dll Jellyfin.Extensions*.dll *.json *.pdb
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.Danmu/bin/Release/net6.0/Jellyfin.Plugin.Danmu.dll ./artifacts/
- name: Compress build files
uses: thedoctor0/zip-release@main
with:
Expand Down

0 comments on commit ee22e96

Please sign in to comment.