Merge branch 'master' of https://github.com/Lyoko-Jeremie/DoLModLoade… #51
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: Build Html Package | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 手动设定版本 | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
fail-fast: false | |
matrix: | |
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs | |
os: [ windows-latest ] | |
#os: [ ubuntu-latest, windows-latest ] | |
node-version: [ 18.x ] | |
steps: | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: SugarCube-2 | |
uses: actions/checkout@v4 | |
with: | |
repository: Lyoko-Jeremie/sugarcube-2_Vrelnir | |
path: SC2 | |
ref: TS | |
#submodules: recursive | |
- name: init ModLoader | |
working-directory: ${{ github.workspace }}/ModLoader | |
run: git submodule update --init --recursive | |
# - name: ModLoader | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: Lyoko-Jeremie/sugarcube-2-ModLoader | |
# path: ModLoader | |
# ref: master | |
# submodules: recursive | |
# - name: DoL | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: Vrelnir/degrees-of-lewdity.git | |
# path: DoL | |
# ref: master | |
# github-server-url: 'https://gitgud.io' | |
# submodules: recursive | |
# /ModLoader Init ========================================= | |
- name: Build ModLoader | |
working-directory: ${{ github.workspace }}/ModLoader | |
run: | | |
yarn install | |
yarn run ts:BeforeSC2 | |
yarn run webpack:BeforeSC2 | |
yarn run ts:ForSC2 | |
yarn run webpack:insertTools | |
- name: Build ModLoaderGui | |
working-directory: ${{ github.workspace }}/ModLoader/mod/ModLoaderGui | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy ModLoaderGui | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/ModLoaderGui/ModLoaderGui.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build ImageLoaderHook | |
working-directory: ${{ github.workspace }}/ModLoader/mod/ImageLoaderHook | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy ImageLoaderHook | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/ImageLoaderHook/ModLoader DoL ImageLoaderHook.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build CheckGameVersion | |
working-directory: ${{ github.workspace }}/ModLoader/mod/CheckGameVersion | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy CheckGameVersion | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/CheckGameVersion/CheckGameVersion.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build Diff3WayMerge | |
working-directory: ${{ github.workspace }}/ModLoader/mod/Diff3WayMerge | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy Diff3WayMerge | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/Diff3WayMerge/Diff3WayMerge.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build ModdedClothesAddon | |
working-directory: ${{ github.workspace }}/ModLoader/mod/ModdedClothesAddon | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy ModdedClothesAddon | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/ModdedClothesAddon/ModdedClothesAddon.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build ReplacePatch | |
working-directory: ${{ github.workspace }}/ModLoader/mod/ReplacePatch | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy ReplacePatch | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/ReplacePatch/ReplacePatcher.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build TweeReplacer | |
working-directory: ${{ github.workspace }}/ModLoader/mod/TweeReplacer | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy TweeReplacer | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/TweeReplacer/TweeReplacer.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Build CheckDoLCompressorDictionaries | |
working-directory: ${{ github.workspace }}/ModLoader/mod/CheckDoLCompressorDictionaries | |
run: | | |
yarn install | |
yarn run build:ts | |
yarn run build:webpack | |
node "${{ github.workspace }}/ModLoader/dist-insertTools/packModZip.js" "boot.json" | |
- name: Copy CheckDoLCompressorDictionaries | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/ModLoader/ | |
source: ${{ github.workspace }}/ModLoader/mod/CheckDoLCompressorDictionaries/CheckDoLCompressorDictionaries.mod.zip | |
destBase: ${{ github.workspace }}/ModLoader/out | |
target: ${{ github.workspace }}/ModLoader/out | |
- name: Copy dist-BeforeSC2 | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
source: ${{ github.workspace }}/ModLoader/dist-BeforeSC2/**/* | |
target: ${{ github.workspace }}/ModLoader/out/dist-BeforeSC2/ | |
- name: Copy dist-ForSC2 | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
source: ${{ github.workspace }}/ModLoader/dist-ForSC2/**/* | |
target: ${{ github.workspace }}/ModLoader/out/dist-ForSC2/ | |
- name: Copy dist-insertTools | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
source: ${{ github.workspace }}/ModLoader/dist-insertTools/**/* | |
target: ${{ github.workspace }}/ModLoader/out/dist-insertTools/ | |
- name: Copy README.md | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
source: ${{ github.workspace }}/ModLoader/README.md | |
target: ${{ github.workspace }}/ModLoader/out | |
# /ModLoader OK ========================================= | |
# /SC2 Init ========================================= | |
- name: Build SC2 | |
working-directory: ${{ github.workspace }}/SC2 | |
run: | | |
npm install | |
node build.js -d -u -b 2 | |
# /SC2 OK ========================================= | |
- name: Copy SC2 format.js | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
one: "true" | |
srcBase: ${{ github.workspace }}/SC2/build/twine2/sugarcube-2/ | |
source: ${{ github.workspace }}/SC2/build/twine2/sugarcube-2/format.js | |
destBase: ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/ | |
target: ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/ | |
# /DoL Init ========================================= | |
- name: Build DoL (Linux) | |
if: runner.os != 'Windows' | |
working-directory: ${{ github.workspace }}/DoL | |
run: ./compile.sh | |
- name: Build DoL (Win) | |
if: runner.os == 'Windows' | |
working-directory: ${{ github.workspace }}/DoL | |
run: ./compile.bat | |
# /DoL OK ========================================= | |
# - name: Upload debug | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Html debug-${{ github.sha }} | |
# path: | | |
# ${{ github.workspace }}/DoL/devTools/tweego/storyFormats/sugarcube-2/format.js | |
# ${{ github.workspace }}/ModLoader/out/ | |
- name: Inject ModLoader | |
working-directory: ${{ github.workspace }}/ModLoader/out | |
run: | | |
node "${{ github.workspace }}/ModLoader/out/dist-insertTools/insert2html.js" "${{ github.workspace }}/DoL/Degrees of Lewdity VERSION.html" "modList.json" "${{ github.workspace }}/ModLoader/out/dist-BeforeSC2/BeforeSC2.js" | |
# make package Init ========================================= | |
- name: MKDIR | |
run: | | |
mkdir ${{ github.workspace }}/output | |
- name: Copy html | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/DoL/ | |
source: ${{ github.workspace }}/DoL/Degrees of Lewdity VERSION.html.mod.html | |
target: ${{ github.workspace }}/output | |
- name: Copy style | |
uses: Lyoko-Jeremie/js-copy-github-action@master | |
with: | |
srcBase: ${{ github.workspace }}/DoL/ | |
source: ${{ github.workspace }}/DoL/style.css | |
target: ${{ github.workspace }}/output | |
# - name: Copy img | |
# uses: Lyoko-Jeremie/js-copy-github-action@master | |
# with: | |
# srcBase: ${{ github.workspace }}/DoL/ | |
# source: ${{ github.workspace }}/DoL/img/**/* | |
# target: ${{ github.workspace }}/output | |
- name: Copy img (Win) | |
if: runner.os == 'Windows' | |
run: copy -Path "${{ github.workspace }}/DoL/img" -Destination "${{ github.workspace }}/output" -Recurse | |
- name: Archive Release (Artifact) | |
uses: thedoctor0/zip-release@0.7.1 | |
with: | |
type: 'zip' | |
filename: DoL-ModLoader-${{ github.sha }}.zip | |
directory: ${{ github.workspace }}/output | |
# make package OK ========================================= | |
# - name: Upload | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Html Package-${{ github.sha }} | |
# path: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip | |
- name: Archive Release (Releases Manually) | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
files: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip | |
name: Release v${{ github.event.inputs.version }} | |
tag_name: v${{ github.event.inputs.version }}-${{ github.sha }} | |
body: Release v${{ github.event.inputs.version }}-${{ github.sha }}v | |
- name: Archive Release (Releases Auto) | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
with: | |
files: ${{ github.workspace }}/output/DoL-ModLoader-${{ github.sha }}.zip | |
name: Auto Release (${{ github.sha }}) | |
tag_name: auto-${{ github.sha }} | |
body: Auto Release (${{ github.sha }}) | |
prerelease: true |