Skip to content
23 changes: 22 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,37 @@ jobs:
include:
- os: macos-latest
artifact: macos
inklecate_url: https://github.com/inkle/ink/releases/download/0.9.0/inklecate_mac.zip
- os: windows-latest
artifact: win64
inklecate_url: https://github.com/inkle/ink/releases/download/0.9.0/inklecate_windows_and_linux.zip
- os: "ubuntu-20.04"
artifact: linux

inklecate_url: https://github.com/inkle/ink/releases/download/0.9.0/inklecate_windows_and_linux.zip
inklecate_pre: "mono "
inklecate_post: ".exe"

steps:

# Checkout project
- uses: actions/checkout@v2

# Download inklecate
- uses: suisei-cn/actions-download-file@v1
name: Download Inklecate
id: download_inklecate
with:
url: ${{ matrix.inklecate_url }}
target: "inklecate/"

# Install Inklecate
- name: Deploy Inkelcate
shell: bash
run: |
cd inklecate
unzip *.zip
echo "INKLECATE=${{ matrix.inklecate_pre }}$GITHUB_WORKSPACE/inklecate/inklecate${{ matrix.inklecate_post }}" >> $GITHUB_ENV

# Create a build directory to store all the CMake generated files
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
Expand Down
18 changes: 16 additions & 2 deletions inkcpp_cl/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <sstream>
#include <regex>
#include <filesystem>
#include <cstdlib>

#include <globals.h>
#include <runner.h>
Expand All @@ -13,8 +14,21 @@

void inklecate(const std::string& inkFilename, const std::string& jsonFilename)
{
std::string command = "inklecate -o " + jsonFilename + " " + inkFilename;
std::system(command.c_str());
// Get environment specific inklecate invocation command
const char* inklecateCmd = std::getenv("INKLECATE");
if (inklecateCmd == nullptr)
inklecateCmd = "inklecate";

// Create command
std::stringstream cmd;
cmd << inklecateCmd << " -o " << jsonFilename << " " << inkFilename;

// Run
int result = std::system(cmd.str().c_str());
if (result != 0) {
std::stringstream msg; msg << "Inklecate failed with exit code " << result;
throw std::runtime_error(msg.str());
}
}

void load_file(const std::string& filename, std::string& result)
Expand Down