DEV Community

Discussion on: A Modern Developer's Workflow For Twine

Collapse
 
bobslim profile image
Robert Lim • Edited

Heya people,

I found it a little easier to use the compiled binary from github rather than compiling using go. I ran into a couple of issues with the dependencies there, and I wasn't sure how to proceed as a non-go-user.

Replace this:

- name: build game
  run: |
      go get github.com/tmedwards/tweego
      export PATH=$PATH:$(go env GOPATH)/bin
      tweego YOUR_TWEE_FILE.twee -o dist/index.html
Enter fullscreen mode Exit fullscreen mode

with this:

- uses: jaxxstorm/action-install-gh-release@v1.10.0 
  with:
      repo: tmedwards/tweego
      chmod: 0775
- run tweego YOUR_TWEE_FILE.twee -o dist/index.html
Enter fullscreen mode Exit fullscreen mode

for extra credit, I also managed my build scripts in a package.json. This lets the build server and my local dev environment use the same scripts. You still have to install tweego for yourself (this file is easiest)

"scripts": {
    "twee": "tweego --output src/pages/game.html twine",
    "dev:twee": "npm run twee -- --watch",
}
Enter fullscreen mode Exit fullscreen mode

If not included in tweego, remember to include your chosen storyformat in the repo in .storyformat/formatname-1