Skip to content

Commit

Permalink
Add linux building to CI (#2)
Browse files Browse the repository at this point in the history
* Linux build test

* Add workflow_dispatch so that we can manually run build

* test linux up to lzham only

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* move -> mv

* c++2a??!?!?!

* Update ci.yml

* did i finally do it?

* Finally it builds on windows AND linux

* oops, forgot to update path

* what is going on with win runner?

* Undo that?

* try and find the lib

* hopefully it actually works now

long story short, cmake mangled my vcxproj

* revert to this to see if it works

* un-revert this

* Tell it to build for x64 :)
  • Loading branch information
barnabwhy authored Jul 1, 2022
1 parent c660654 commit cf0e57c
Showing 1 changed file with 69 additions and 40 deletions.
109 changes: 69 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
- 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

0 comments on commit cf0e57c

Please sign in to comment.