diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f746f7..ec7dc4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,9 @@ name: CI -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: build_win: + name: Build (Windows) runs-on: windows-2022 steps: - name: Setup node @@ -19,15 +20,15 @@ jobs: repository: 'barnabwhy/tf_lzham' path: lzham - - name: Configure Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.4.1 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 with: - arch: amd64 + msbuild-architecture: x64 - name: Compile lzham run: | cd lzham - msbuild ./r5dev/vproj/liblzham.vcxproj /p:Configuration=Release + msbuild ./dev/vproj/liblzham.vcxproj /p:Configuration=Release /p:Platform=x64 - name: Checkout TFVPKTool uses: actions/checkout@v3 @@ -38,7 +39,7 @@ jobs: - name: Compile TFVPKTool run: | del tfvpktool/src/lzham/lib/liblzham_x64.lib - move lzham/r5dev/vproj/lib/Release/liblzham_x64.lib tfvpktool/src/lzham/lib/liblzham_x64.lib + move lzham/dev/vproj/lib/Release/liblzham_x64.lib tfvpktool/src/lzham/lib/liblzham_x64.lib cd tfvpktool npm install npm run compile:base @@ -65,38 +66,66 @@ jobs: with: name: Harmony VPK Tool - x64 Portable path: main/builds/Harmony VPK Tool*.exe + + build_linux: + name: Build (Linux) + runs-on: ubuntu-latest + steps: + - name: Setup node + uses: actions/setup-node@master + + - name: Checkout Harmony VPK Tool + uses: actions/checkout@v3 + with: + path: main + + - name: Checkout tf_lzham + uses: actions/checkout@v3 + with: + repository: 'barnabwhy/tf_lzham' + path: lzham - # build_linux: - # runs-on: ubuntu-latest - # steps: - # - name: Setup node - # uses: actions/setup-node@master - # - name: Checkout Harmony VPK Tool - # uses: actions/checkout@v3 - # with: - # path: main - # - name: Checkout TFVPKTool - # uses: actions/checkout@v3 - # with: - # repository: 'barnabwhy/TFVPKTool' - # path: tfvpktool - # - name: Compile TFVPKTool - # run: | - # cd tfvpktool - # npm install - # npm run compile:base - # mv src/build/Release/lzham.node dist/build/Release/lzham.node - # mv LICENSE.md dist/LICENSE.md - # - name: Move compiled TFVPKTool to Harmony VPK Tool - # run: | - # cd .. - # mv tfvpktool/dist main/tfvpktool - # cd main - # - name: NPM install - # run: npm install - # - name: Build - # run: npm run build:linux - # - uses: actions/upload-artifact@v3 - # with: - # name: Harmony VPK Tool - # path: builds/Harmony VPK Tool*.AppImage \ No newline at end of file + - name: Compile lzham + run: | + cd lzham + cmake -S "." -B "build" -G "Unix Makefiles" + cmake --build "build" + ls build/dev/vproj + + - name: Checkout TFVPKTool + uses: actions/checkout@v3 + with: + repository: 'barnabwhy/TFVPKTool' + path: tfvpktool + + - name: Compile TFVPKTool + run: | + rm tfvpktool/src/lzham/lib/liblzham_x64.lib + mv lzham/build/dev/vproj/libliblzham.a tfvpktool/src/lzham/lib/libliblzham.a + cd tfvpktool + sed -i 's/liblzham_x64.lib/libliblzham.a/g' src/binding.gyp + sed -i 's/c++20/c++2a/g' src/binding.gyp + npm install + npm run compile:base + mkdir -p dist/build/Release + mv src/build/Release/lzham.node dist/build/Release/lzham.node + mv LICENSE.md dist/LICENSE.md + + - name: Move compiled TFVPKTool to Harmony VPK Tool + run: | + mv tfvpktool/dist main/tfvpktool + + - name: NPM install + run: | + cd main + npm install + + - name: Build + run: | + cd main + npm run build:linux + + - uses: actions/upload-artifact@v3 + with: + name: Harmony VPK Tool - AppImage + path: main/builds/Harmony VPK Tool*.AppImage \ No newline at end of file