build: update build script
This commit is contained in:
parent
7776b87e18
commit
0ed27ce2f3
|
@ -43,14 +43,7 @@ jobs:
|
|||
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"
|
||||
zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll
|
||||
- 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
|
||||
|
@ -61,13 +54,13 @@ jobs:
|
|||
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 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:
|
||||
|
|
|
@ -46,7 +46,7 @@ def main():
|
|||
|
||||
# 解析旧 manifest
|
||||
try:
|
||||
with urlopen('https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/maniest.json') as f:
|
||||
with urlopen('https://raw.githubusercontent.com/cxfksword/jellyfin-release/master/metashark/manifest.json') as f:
|
||||
manifest = json.load(f)
|
||||
except HTTPError as err:
|
||||
if err.code == 404:
|
||||
|
@ -63,7 +63,8 @@ def main():
|
|||
# 国内加速
|
||||
with open('manifest_cn.json', 'w') as f:
|
||||
manifest_cn = json.dumps(manifest, indent=2)
|
||||
manifest_cn = re.sub("github.com", "gh-proxy.com/https://github.com", manifest_cn)
|
||||
manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/raw/main/doc/logo.png', "https://jellyfin-plugin-release.pages.dev/metashark/logo.png", manifest_cn)
|
||||
manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v[0-9.]+', "https://jellyfin-plugin-release.pages.dev/metashark", manifest_cn)
|
||||
f.write(manifest_cn)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue