Fix github action build

This commit is contained in:
cxfksword
2022-10-11 18:43:18 +08:00
parent 3c058fd7a3
commit 4abb42cd73
3 changed files with 24 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ env:
project: Jellyfin.Plugin.Danmu/Jellyfin.Plugin.Danmu.csproj
branch: main
artifact: danmu
manifest: https://github.com/cxfksword/jellyfin-plugin-danmu/releases/download/manifest/manifest.json
jobs:
build:
@@ -40,8 +41,16 @@ jobs:
tag: ${{ github.ref }}
file_glob: true
- name: Update manifest
uses: stefanzweifel/git-auto-commit-action@v4
uses: svenstaro/upload-release-action@v2
with:
branch: ${{ env.branch }}
commit_message: Update repo manifest
file_pattern: "*.json"
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*.json
tag: "manifest"
overwrite: true
file_glob: true
# - name: Update manifest
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# branch: ${{ env.branch }}
# commit_message: Update repo manifest
# file_pattern: "*.json"

View File

@@ -1,6 +1,7 @@
import os
import sys
import argparse
import os.path
parser = argparse.ArgumentParser()
parser.add_argument('--version', required=True)
@@ -26,10 +27,19 @@ version = '.'.join(version_list)
if prerelease:
jellyfin_repo_file = "./manifest-unstable.json"
jellyfin_manifest = "https://github.com/cxfksword/jellyfin-plugin-danmu/releases/manifest/download/manifest-unstable.json"
else:
jellyfin_repo_file = "./manifest.json"
# jellyfin_repo_file_cn = jellyfin_repo_file.replace(".json", "_cn.json")
jellyfin_manifest = "https://github.com/cxfksword/jellyfin-plugin-danmu/releases/manifest/download/manifest.json"
# download old manifest
jellyfin_manifest_template = "./doc/manifest-template.json"
os.system('wget -q "%s"' % (jellyfin_manifest))
if not os.path.isfile(jellyfin_manifest):
os.system('cp -f %s %s' % (jellyfin_manifest_template, jellyfin_manifest))
# build and generate new manifest
jellyfin_repo_url = "https://github.com/cxfksword/jellyfin-plugin-danmu/releases/download"
zipfile = os.popen('jprm --verbosity=debug plugin build "." --output="%s" --version="%s" --dotnet-framework="net6.0"' %
@@ -39,10 +49,4 @@ os.system('jprm repo add --url=%s %s %s' % (jellyfin_repo_url, jellyfin_repo_fil
os.system('sed -i "s/\/danmu\//\/%s\//" %s' % (git_version, jellyfin_repo_file))
# 国内加速
# os.system('cp -f %s %s' % (jellyfin_repo_file, jellyfin_repo_file_cn))
# os.system('sed -i "s/github.com/ghproxy.com\/https:\/\/github.com/" %s' % (jellyfin_repo_file_cn))
print(version)