Add unofficial builds
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import shutil, os, subprocess, zipfile, json, sys
|
||||
|
||||
from itertools import chain
|
||||
|
||||
PROJECT_NAME = sys.argv[1]
|
||||
OFFICIAL_ZIP = f"{PROJECT_NAME}/bin/x64/Release/{PROJECT_NAME}/latest.zip"
|
||||
UNOFFICIAL_ZIP = f"{PROJECT_NAME}/bin/x64/Release/{PROJECT_NAME}/latestUnofficial.zip"
|
||||
|
||||
shutil.copy(OFFICIAL_ZIP, UNOFFICIAL_ZIP)
|
||||
|
||||
subprocess.check_call(['7z', 'd', UNOFFICIAL_ZIP, f"{PROJECT_NAME}.json"])
|
||||
|
||||
with zipfile.ZipFile(UNOFFICIAL_ZIP) as file:
|
||||
members = file.namelist()
|
||||
|
||||
subprocess.check_call(['7z', 'rn', UNOFFICIAL_ZIP] + list(chain.from_iterable((m, m.replace(PROJECT_NAME, f"{PROJECT_NAME}Unofficial")) for m in members)))
|
||||
|
||||
with open(f"{PROJECT_NAME}/bin/x64/Release/{PROJECT_NAME}/{PROJECT_NAME}.json") as file:
|
||||
manifest = json.load(file)
|
||||
|
||||
manifest['Punchline'] = f"Unofficial/uncertified build of {manifest['Name']}. {manifest['Punchline']}"
|
||||
manifest['InternalName'] += 'Unofficial'
|
||||
manifest['Name'] += ' (Unofficial)'
|
||||
manifest['IconUrl'] = f"https://raw.githubusercontent.com/WorkingRobot/MyDalamudPlugins/main/icons/{manifest['InternalName']}.png"
|
||||
|
||||
with zipfile.ZipFile(UNOFFICIAL_ZIP, "a", zipfile.ZIP_DEFLATED, compresslevel = 7) as file:
|
||||
file.writestr(f"{PROJECT_NAME}Unofficial.json", json.dumps(manifest, indent = 2))
|
||||
@@ -6,6 +6,7 @@ on:
|
||||
env:
|
||||
PLUGIN_REPO: WorkingRobot/MyDalamudPlugins
|
||||
PROJECT_NAME: Craftimizer
|
||||
IS_OFFICIAL: ${{true}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -32,7 +33,7 @@ jobs:
|
||||
|
||||
- name: Restore
|
||||
run: |
|
||||
dotnet restore -r win ${{env.PROJECT_NAME}}.sln
|
||||
dotnet restore -r win
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -42,6 +43,10 @@ jobs:
|
||||
run: |
|
||||
dotnet test --configuration Release --logger "trx;logfilename=results.trx" --logger "html;logfilename=results.html" --logger "console;verbosity=detailed" --no-build --results-directory="TestResults"
|
||||
|
||||
- name: Create Unofficial Builds
|
||||
if: ${{env.IS_OFFICIAL}}
|
||||
run: python ./.github/create_unofficial.py ${{env.PROJECT_NAME}}
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
@@ -51,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Upload Test Results
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ always() }}
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: TestResults
|
||||
path: TestResults
|
||||
|
||||
Reference in New Issue
Block a user